This section describes the operating system-specific parts of OTP that relate to Solaris.
Solaris takes about 17 MB of RAM on a system with 64 MB of total RAM. This leaves about 47 MB for the applications. If the system uses swapping, these figures cannot be improved because unnecessary daemon processes are swapped out. However, if swapping is disabled, or if the swap space is of limited resource in the system, it becomes necessary to kill off unnecessary daemon processes.
The disk space required by Solaris can be minimized by using the Core User support installation. It requires about 80 MB of disk space. This installs only the minimum software required to boot and run Solaris. The disk space can be further reduced by deleting unnecessary individual files. However, unless disk space is a critical resource the effort required and the risks involved cannot be justified.
This section is about installing an embedded system. The following topics are considered:
Several of the procedures in this section require expert knowledge of the Solaris operating system. For most of them super user privilege is needed.
It is recommended that the embedded environment is run by an ordinary user, that is, a user who does not have super user privileges.
In this section, it is assumed that the username is
/export/home/otpuser
It is also assumed that in the home directory of
/export/home/otpuser/otp
This directory is the installation directory of the embedded environment.
The procedure for installing an embedded system is the same as for an ordinary system (see Installation Guide), except for the following:
A true embedded system must start when the system boots. This section accounts for the necessary configurations needed to achieve that.
The embedded system and all the applications start
automatically if the script file shown below is added to
directory
S75otp.system
For more details on initialization (and termination) scripts, and naming thereof, see the Solaris documentation.
#!/bin/sh # # File name: S75otp.system # Purpose: Automatically starts Erlang and applications when the # system starts # Author: janne@erlang.ericsson.se # Resides in: /etc/rc3.d # if [ ! -d /usr/bin ] then # /usr not mounted exit fi killproc() { # kill the named process(es) pid=`/usr/bin/ps -e | /usr/bin/grep -w $1 | /usr/bin/sed -e 's/^ *//' -e 's/ .*//'` [ "$pid" != "" ] && kill $pid } # Start/stop processes required for Erlang case "$1" in 'start') # Start the Erlang emulator # su - otpuser -c "/export/home/otpuser/otp/bin/start" & ;; 'stop') killproc beam ;; *) echo "Usage: $0 { start | stop }" ;; esac
File
/export/home/otpuser/otp
The
Use of the
$SOME_PATH/erl_call -n Node init stop
To take Erlang down gracefully, see the
The
For Solaris running on VME boards from Force Computers, the onboard hardware watchdog can be activated, provided a VME bus driver is added to the operating system (see also Installation Problems).
See also the
If the
HEART_COMMAND=/usr/sbin/reboot
then the ownership and file permissions for
chown 0 /usr/sbin/reboot chmod 4755 /usr/sbin/reboot
See also the
When the Erlang runtime system is automatically started from
the
TERM=sun
This is to be added to the
For proper functioning of flushing file system data to disk on
Solaris 2.5.1, the version-specific patch with number
103640-02 must be added to the operating system. Other
patches might be needed, see the release README file
The following four installation procedures require super user privilege:
cp /etc/syslog.conf /etc/syslog.conf.ORIG
kern.LEVEL /etc/syslog.otp
chmod 644 /etc/syslog.conf
chmod 644 /etc/syslog.conf.ORIG
chmod 644 /etc/syslog.conf.OTP
The full name of the binary executable file is
derived from the position of application
/lib/os_mon-/priv/bin/mod_syslog]]>
Example: If the path to
A simple way to do this is to issue the following commands:
/lib/os_mon-/priv/bin/mod_syslog
chmod 4755 mod_syslog
chown root mod_syslog]]>
The following procedure does not require root privilege:
Browse the application configuration file (do
not edit it). The full name of the application
configuration file is derived from the position of the
The generic full name of the file is thus:
/lib/os_mon-/ebin/os_mon.app.]]>
Example: If the path to
If the values listed in
Example: Contents of an application configuration file:
[{os_mon, [{start_os_sup, true}, {os_sup_own, "/etc"}, {os_sup_syslogconf, "/etc/syslog.conf"}, {os_sup_errortag, std_error}]}].
See the
The hardware watchdog timer, which is controlled by the
It is recommended to add these lines to avoid a clash. The clash can make it impossible to boot the system.
This section describes how an embedded system is started. Four
programs are involved and they normally reside in the directory
In an embedded system, there is usually no interactive shell.
However, an operator can attach to the Erlang
system by command
Basically, the procedure is as follows:
This program is called when the machine is started. It can
be modified or rewritten to suit a special system. By
default, it must be called
The start program must call
This program is to set static parameters and environment
variables such as
The
The following script illustrates the default behaviour of the program:
/dev/null 2>&1 &]]>
The following script illustrates a modification where the node
is given the name
/dev/null 2>&1 &]]>
If a diskless and/or read-only client node is about to start,
file
CLIENTDIR=$ROOTDIR/clients/clientname
START_ERL_DATA=${1:-$CLIENTDIR/bin/start_erl.data}
This program is used to start the emulator, but you will not
be connected to the shell.
Usage: run_erl pipe_dir/ log_dir "exec command [parameters ...]"
Here:
Log files are written in
erlang.log.1
erlang.log.1, erlang.log.2
erlang.log.1, erlang.log.2, erlang.log.3
erlang.log.1, erlang.log.2, erlang.log.3, erlang.log.4
erlang.log.2, erlang.log.3, erlang.log.4, erlang.log.5
erlang.log.3, erlang.log.4, erlang.log.5, erlang.log.1
...
The most recent log file is the rightmost in each row. That is, the most recent file is the one with the highest number, or if there are already four files, the one before the skip.
When a log file is opened (for appending or created), a time stamp is written to the file. If nothing has been written to the log files for 15 minutes, a record is inserted that says that we are still alive.
This program is used to attach to a running Erlang runtime
system, started with
Usage: to_erl [pipe_name | pipe_dir]
Here
To disconnect from the shell without exiting the Erlang
system, type
This program starts the Erlang emulator with parameters
The following script illustrates the behaviour of the program:
#!/bin/sh
#
# This program is called by run_erl. It starts
# the Erlang emulator and sets -boot and -config parameters.
# It should only be used at an embedded target system.
#
# Usage: start_erl RootDir RelDir DataFile [ErlFlags ...]
#
ROOTDIR=$1
shift
RELDIR=$1
shift
DataFile=$1
shift
ERTS_VSN=`awk '{print $1}' $DataFile`
VSN=`awk '{print $2}' $DataFile`
BINDIR=$ROOTDIR/erts-$ERTS_VSN/bin
EMU=beam
PROGNAME=`echo $0 | sed 's/.*\///'`
export EMU
export ROOTDIR
export BINDIR
export PROGNAME
export RELDIR
exec $BINDIR/erlexec -boot $RELDIR/$VSN/start -config $RELDIR/$VSN/sys $*
If a diskless and/or read-only client node with the
SASL configuration parameter
As such a client cannot
read a new
The
Assuming the same
exec $BINDIR/erlexec -boot $CLIENTDIR/bin/start \
-config $CLIENTDIR/bin/sys $*