initlog(1M) initlog(1M)
NAME
initlog - log console output
SYNOPSIS
/sbin/initlog shellscript
DESCRIPTION
The initlog program logs the output from any shell script. It was
created specially to log all console output at startup and shutdown.
The output of the specified shell script is duplicated using pseudo
terminals and redirected to /dev/osm if necessary [see osm(7)].
initlog is terminated once the shell script has run, unless the shell
script starts daemon processes in the background without redirecting
the output. In this case, the standard output process is only ter-
minated by initlog if no other process has opened the standard output
channel.
The output is given in lines to the /dev/osm driver for logging. Every
log entry receives a time stamp by default and a signature (name of
shell script).
ARGUMENTS
shellscript
Any executable shell script created by the user which can be
assigned options and arguments.
The /etc/default/initlog file
The parameterization of initlog is controlled by means of the
/etc/default/initlog file. The parameters in this file are structured
as follows:
Format 1: VARIABLE=value
Format 2: shellscriptVARIABLE=value
Format 1 settings are global while Format 2 settings, on the other
hand, are only effective for the specified shell script but have a
higher priority than global settings.
Possible VARIABLE entries include:
SHELL Specifies the required shell. If a shell is not specified,
/sbin/sh is entered as the default.
TIMESTAMP A time stamp is output before each logged line. Possible
values include:
0 no time stamp
1 with time stamp (default)
Page 1 Reliant UNIX 5.44 Printed 11/98
initlog(1M) initlog(1M)
LABEL Specifies a signature in the log line. The name of the
shell script is taken as the default. To suppress the sig-
nature, no entries are made following the keyword.
LOGFILE Specifies an alternative log file. The /dev/osm driver is
the default.
The log is turned off as soon as a control character (ESC sequence) is
output by the script (e. g. by means of vi or sysadm).
Logging can also be turned on and off explicitly. Therefore, shell
script has to output the following key terms including line wrap (\n):
InItLoG OfF Logging off
InItLoG On Logging on
The transferred parameters are forwarded to the shell script.
The log entries in /dev/osm are taken over by system logging.
EXAMPLES
The following variable is set in the /etc/default/initlog file:
tshSHELL=/sbin/ksh
The user's tsh script contains the following information:
#!/sbin/sh
echo Hello World
When tsh has been executed, the following message is output on the
screen:
Hello World
There is no logging in this case.
However, if the user's tsh script contains the following first line:
#!/sbin/initlog
echo Hello World
the following message is likewise output on the screen following exe-
cution of tsh:
Hello World
But logging also takes place in the /var/adm/log/osm file [see
osm.conf(4)]. The
Page 2 Reliant UNIX 5.44 Printed 11/98
initlog(1M) initlog(1M)
tail -1 /var/adm/log/osm
command then reports, for example:
Jun 27 11:43:48 tsh Hello World
The log line is preceded by the time stamp (default) and the signature
(default: name of the shell script).
NOTES
The initlog command is used for logging the output during system ini-
tialization.
The /etc/default/initlog file is optional and by default does not
exist.
The output of the shell script executed with initlog and its sub-
scripts or programs should only go to standard input, standard output
and standard error (stdin, stdout, stderr).
WARNING
Different input methods should not be used for the same input device
(e. g. /dev/console and stdin). In this case, the input stream would
be distributed arbitrarily to both channels.
FILES
/etc/default/initlog
/dev/osm
/var/adm/log/osm
/sbin/sh
SEE ALSO
ksh(1), sh(1), syslogd(1M), osm.conf(4), console(7), osm(7).
Page 3 Reliant UNIX 5.44 Printed 11/98