[syslog-ng]Syslog-ng on Boot

jesse.keefe@convergys.com jesse.keefe@convergys.com
Tue, 22 Jan 2002 13:11:13 -0500


For those who asked about starting syslog-ng on boot, here is what I did
for Solaris 8.
I simply modified the /etc/rc2.d/S74syslog script:

case "$1" in
'start')
        if [ -f /etc/syslog-ng/syslog-ng.conf -a -f /usr/sbin/syslog-ng ];
then
                echo 'syslog-ng service starting.'
                #
                # Before syslogd starts, save any messages from previous
                # crash dumps so that messages appear in chronological
order.
                #
                /usr/bin/savecore -m
                if [ -r /etc/dumpadm.conf ]; then
                        . /etc/dumpadm.conf
                        [ "x$DUMPADM_DEVICE" != xswap ] && \
                            /usr/bin/savecore -m -f $DUMPADM_DEVICE
                fi
                if [ ! -f /var/adm/messages ]; then
                        /usr/bin/cp /dev/null /var/adm/messages
                        /usr/bin/chmod 0644 /var/adm/messages
                fi
                /usr/sbin/syslog-ng >/dev/msglog 2>&1 &
        fi
        ;;

'stop')
        echo 'syslog-ng service stopping.'
        if [ -f /var/run/syslog-ng.pid ]; then
                syspid=`/usr/bin/cat /var/run/syslog-ng.pid`
                [ "$syspid" -gt 0 ] && kill -15 $syspid
        fi
        ;;

*)
        echo "Usage: $0 { start | stop }"
        exit 1
        ;;
esac

------------------------------------------
Jesse Keefe <jesse.keefe@convergys.com>  |
Systems Administrator                    |
Convergys Corp.                          |
229 West Seventh Street                  |
P.O. Box 1638                            |
Cincinnati, Oh 45201                     |
(513)723-3689                            |


--

NOTICE:  The information contained in this electronic mail transmission is
intended by Convergys Corporation for the use of the named individual or
entity to which it is directed and may contain information that is
privileged or otherwise confidential.  If you have received this electronic
mail transmission in error, please delete it from your system without
copying or forwarding it, and notify the sender of the error by reply email
or by telephone (collect), so that the sender's address records can be
corrected.