diff --git a/rc.syslog b/rc.syslog index 2a2b366..79dd7ee 100644 --- a/rc.syslog +++ b/rc.syslog @@ -6,8 +6,8 @@ # # Author: Florian La Roche , 1996 # Werner Fink , 1998-2008 -# Stephan Kulow , 2005-2008 -# Marius Tomaschewski , 2001-2008 +# Stephan Kulow , 2005-2008 +# Marius Tomaschewski , 2001-2008 # # /etc/init.d/syslog # @@ -29,9 +29,9 @@ BINDIR=/sbin # update $SYSLOG_DAEMON if not up-to-date test -n "$SYSLOG_DAEMON" && \ test -x "${BINDIR}/$SYSLOG_DAEMON" || { - for SYSLOG_DAEMON in rsyslogd syslog-ng syslogd ; do - test -x "${BINDIR}/$SYSLOG_DAEMON" && break - done + for SYSLOG_DAEMON in rsyslogd syslog-ng syslogd ; do + test -x "${BINDIR}/$SYSLOG_DAEMON" && break + done } # set daemon dependent variables @@ -52,8 +52,8 @@ case "$SYSLOG_DAEMON" in while read one two rest ; do test "x$one" = 'x$ModLoad' && \ test "x$two" = 'ximklog.so' && { - start_klogd=no - break + start_klogd=no + break } done < $config ;; @@ -61,6 +61,7 @@ case "$SYSLOG_DAEMON" in syslog=syslog-ng config=/etc/syslog-ng/syslog-ng.conf params="$SYSLOG_NG_PARAMS" + ngsocks="/var/run/syslog-ng/additional-log-sockets.conf" ;; *) syslog=syslogd @@ -115,7 +116,7 @@ case "$1" in # Syslog service already done rm -f /var/lock/subsys/earlysyslog case "$SYSLOG_DAEMON" in - rsyslogd) ;; # switch to normal config + rsyslogd) ;; # switch to normal config *) exit 0 ;; esac elif test "$2" = "early" ; then @@ -136,30 +137,41 @@ case "$1" in echo -n "Starting syslog services" test -z "$KERNEL_LOGLEVEL" && KERNEL_LOGLEVEL=1 - case $syslog in - (rsyslogd) - if [ "x$rsocks" != x ] ; then - rm -f "$rsocks" - touch "$rsocks" - fi - ;; + case $syslog in + rsyslogd) + if test -n "$rsocks" ; then + rm -f "$rsocks" + touch "$rsocks" + fi + ;; + syslog-ng) + echo 'source chroots{' > "$ngsocks" + ;; esac # add additional sockets to params or similar for variable in ${!SYSLOGD_ADDITIONAL_SOCKET*}; do eval value=\$$variable test -n "${value}" && test -d ${value%/*} && { - case $syslog in - rsyslogd) - if [ "x$rsocks" != x ] ; then - echo "\$AddUnixListenSocket $value" >> "$rsocks" - fi - ;; - *) - params="$params -a $value" - ;; - esac + case $syslog in + rsyslogd) + if test -n "$rsocks" ; then + echo "\$AddUnixListenSocket $value" >> "$rsocks" + fi + ;; + syslog-ng) + echo "unix-dgram(\"$value\");" >> "$ngsocks" + ;; + *) + params="$params -a $value" + ;; + esac } done + case $syslog in + syslog-ng) + echo "};" >> "$ngsocks" + ;; + esac startproc -p ${syslog_pid} ${syslog_bin} ${params} rc_status @@ -168,8 +180,8 @@ case "$1" in if test $? -eq 0 ; then if test "$start_klogd" = yes ; then - startproc ${klog_bin} -c $KERNEL_LOGLEVEL $KLOGD_PARAMS - rc_status + startproc ${klog_bin} -c $KERNEL_LOGLEVEL $KLOGD_PARAMS + rc_status fi fi rc_status -v @@ -180,9 +192,9 @@ case "$1" in echo -n "Shutting down syslog services" if test "$start_klogd" = yes ; then - killproc -TERM ${klog_bin} ; rc_status + killproc -TERM ${klog_bin} ; rc_status else - killproc -TERM ${klog_bin} + killproc -TERM ${klog_bin} fi killproc -p ${syslog_use_pid} -TERM ${syslog_use} ; rc_status -v rm -f /var/lock/subsys/syslogd @@ -207,10 +219,10 @@ case "$1" in reload|force-reload) echo -n "Reload syslog service" if test "$start_klogd" = yes ; then - killproc -TSTP ${klog_bin} ; rc_status + killproc -TSTP ${klog_bin} ; rc_status killproc -p ${syslog_use_pid} -HUP ${syslog_use} ; rc_status - killproc -CONT ${klog_bin} ; rc_status - killproc -USR2 ${klog_bin} ; rc_status -v + killproc -CONT ${klog_bin} ; rc_status + killproc -USR2 ${klog_bin} ; rc_status -v else killproc -p ${syslog_use_pid} -HUP ${syslog_use} ; rc_status -v fi diff --git a/syslogd.changes b/syslogd.changes index 1f71a5d..919b0b2 100644 --- a/syslogd.changes +++ b/syslogd.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Mon Apr 12 12:28:46 CEST 2010 - werner@suse.de + +- Reformat boot script + +------------------------------------------------------------------- +Wed Mar 31 20:47:31 CEST 2010 - pczanik@genesi-usa.com + +- modify /etc/init.d/syslog for syslog-ng 3.X + ------------------------------------------------------------------- Mon Mar 29 16:48:18 CEST 2010 - werner@suse.de diff --git a/syslogd.spec b/syslogd.spec index a9240a9..2573258 100644 --- a/syslogd.spec +++ b/syslogd.spec @@ -27,7 +27,7 @@ PreReq: coreutils %fillup_prereq klogd sed Provides: syslog AutoReqProv: on Version: 1.4.1 -Release: 714 +Release: 715 Summary: The Syslog daemon Source: sysklogd-1.4.1.tar.bz2 Source1: logrotate.syslog