#! /bin/sh #------------------------------------------------------------------------------ # /etc/rc.d/syslogd - start syslogd # # Creation: 31.12.2001 fm # Last Update: 20.07.2003 fm # # Copyright (c) 2001-2003 Frank Meyer # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #------------------------------------------------------------------------------ SYSLOGD_OPTIONS='' SYSLOGD_MARK_INTERVAL='' . /etc/config.d/base case $1 in start) idx=1 ( echo "#------------------------------------------------------------------------------" echo "# /etc/syslog.conf" echo "# This file has been created automatically by /etc/init.d/syslogd" echo "# If you want to change settings, edit /etc/config.d/base" echo "# and restart syslogd and klogd by" echo "# sh /etc/init.d/syslogd restart" echo "#------------------------------------------------------------------------------" ) > /etc/syslog.conf while [ "$idx" -le "$SYSLOGD_DEST_N" ] do eval dest='$SYSLOGD_DEST_'$idx echo "$dest" idx=`expr $idx + 1` done >> /etc/syslog.conf if [ "$START_SYSLOGD" = "yes" ] then if tty >/dev/null 2>&1 then /usr/local/bin/colecho "starting syslogd ..." gn fi options='' if [ "$SYSLOGD_OPTIONS" != "" ] then options="$options $SYSLOGD_OPTIONS" fi if [ "$SYSLOGD_MARK_INTERVAL" != "" ] then options="$options -m $SYSLOGD_MARK_INTERVAL" fi /sbin/syslogd $options if tty >/dev/null 2>&1 then /usr/local/bin/colecho "starting klogd ..." gn fi /sbin/klogd -c 1 fi ;; stop) if [ -f /var/run/syslogd.pid ] then if tty >/dev/null 2>&1 then /usr/local/bin/colecho "shutting down syslogd ..." gn fi /bin/kill `cat /var/run/syslogd.pid` fi if [ -f /var/run/klogd.pid ] then if tty >/dev/null 2>&1 then /usr/local/bin/colecho "shutting down klogd ..." gn fi /bin/kill `cat /var/run/klogd.pid` fi ;; restart) sh $0 stop sleep 2 sh $0 start ;; esac