OBS User unknown 2008-09-13 10:19:17 +00:00 committed by Git OBS Bridge
parent 3a673ac17f
commit f4630f5a4f
6 changed files with 110 additions and 24 deletions

View File

@ -1,11 +1,15 @@
#
# Please note, that changing of log file permissions in this
# file is not sufficient if syslog-ng is used as log daemon.
#
# It is required to specify the permissions in the syslog-ng
# configuration /etc/syslog-ng/syslog-ng.conf.in as well.
# configuration file /etc/syslog-ng/syslog-ng.conf as well.
#
/var/log/warn /var/log/messages /var/log/allmessages /var/log/localmessages /var/log/firewall {
# the firewall,acpid,NetworkManager log files
# are used by syslog-ng and rsyslog only, the
# other by all syslog daemons.
/var/log/warn /var/log/messages /var/log/allmessages /var/log/localmessages /var/log/firewall /var/log/acpid /var/log/NetworkManager {
compress
dateext
maxage 365
@ -20,6 +24,7 @@
endscript
}
# used by all syslog daemons
/var/log/mail /var/log/mail.info /var/log/mail.warn /var/log/mail.err {
compress
dateext
@ -35,6 +40,7 @@
endscript
}
# used by all syslog daemons
/var/log/news/news.crit /var/log/news/news.err /var/log/news/news.notice {
compress
dateext

View File

@ -2,9 +2,12 @@
#
# Copyright (c) 1996-2001 SuSE GmbH Nuernberg, Germany.
# Copyright (c) 2002-2003 SuSE Linux AG, Nuernberg, Germany.
# Copyright (c) 2004-2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# Author: Florian La Roche <florian@suse.de>, 1996
# Werner Fink <werner@suse.de>, 1998-2001
# Werner Fink <werner@suse.de>, 1998-2008
# Stephan Kulow <coolo@suse.de>, 2005-2008
# Marius Tomaschewski <mt@suse.de>, 2001-2008
#
# /etc/init.d/syslog
#
@ -24,13 +27,17 @@ BINDIR=/sbin
# update $SYSLOG_DAEMON if not up-to-date
test -n "$SYSLOG_DAEMON" && \
test -x "${BINDIR}/$SYSLOG_DAEMON" || {
for SYSLOG_DAEMON in syslog-ng syslogd ; do
for SYSLOG_DAEMON in rsyslogd syslog-ng syslogd ; do
test -x "${BINDIR}/$SYSLOG_DAEMON" && break
done
}
# set daemon dependent variables
case "$SYSLOG_DAEMON" in
rsyslogd)
syslog=rsyslogd
config=/etc/rsyslog.early.conf
;;
syslog-ng)
syslog=syslog-ng
config=/etc/syslog-ng/syslog-ng.conf
@ -68,6 +75,9 @@ case "$SYSLOG_DAEMON" in
done < ${config}
;;
*)
# in hope this works with the rsyslog.early.conf file
# (hard to implement for rsyslog with its includes/if
# statements)...
while read select action ; do
case "$select" in \#*|"") continue ;; esac
case "$action" in *@*) exit 0 ;; esac

View File

@ -2,9 +2,12 @@
#
# Copyright (c) 1996-2001 SuSE GmbH Nuernberg, Germany.
# Copyright (c) 2002-2003 SuSE Linux AG, Nuernberg, Germany.
# Copyright (c) 2004-2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# Author: Florian La Roche <florian@suse.de>, 1996
# Werner Fink <werner@suse.de>, 1998-2001,2008
# Werner Fink <werner@suse.de>, 1998-2008
# Stephan Kulow <coolo@suse.de>, 2005-2008
# Marius Tomaschewski <mt@suse.de>, 2001-2008
#
# /etc/init.d/syslog
#
@ -26,13 +29,33 @@ BINDIR=/sbin
# update $SYSLOG_DAEMON if not up-to-date
test -n "$SYSLOG_DAEMON" && \
test -x "${BINDIR}/$SYSLOG_DAEMON" || {
for SYSLOG_DAEMON in syslog-ng syslogd ; do
for SYSLOG_DAEMON in rsyslogd syslog-ng syslogd ; do
test -x "${BINDIR}/$SYSLOG_DAEMON" && break
done
}
# set daemon dependent variables
rsocks=""
start_klogd=yes
case "$SYSLOG_DAEMON" in
rsyslogd)
syslog=rsyslogd
if test "$2" = "early" ; then
config=/etc/rsyslog.early.conf
else
config=/etc/rsyslog.conf
fi
params="-c ${RSYSLOGD_COMPAT_VERSION:=3} -f $config $RSYSLOGD_PARAMS"
rsocks="/var/run/rsyslog/additional-log-sockets.conf"
test -r "$config" && \
while read one two rest ; do
test "x$one" = 'x$ModLoad' && \
test "x$two" = 'ximklog.so' && {
start_klogd=no
break
}
done < $config
;;
syslog-ng)
syslog=syslog-ng
config=/etc/syslog-ng/syslog-ng.conf
@ -44,12 +67,6 @@ case "$SYSLOG_DAEMON" in
params="$SYSLOGD_PARAMS"
;;
esac
# add additional sockets to params
for variable in ${!SYSLOGD_ADDITIONAL_SOCKET*}; do
eval value=\$$variable
test -n "${value}" && test -d ${value%/*} && \
params="$params -a $value"
done
syslog_pid="/var/run/${syslog}.pid"
syslog_bin=${BINDIR}/$syslog
@ -116,6 +133,30 @@ 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
;;
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
}
done
startproc -p ${syslog_pid} ${syslog_bin} ${params}
rc_status
@ -123,8 +164,10 @@ case "$1" in
echo ${syslog_bin} > /var/lock/subsys/syslogd
if test $? -eq 0 ; then
startproc ${klog_bin} -c $KERNEL_LOGLEVEL $KLOGD_PARAMS
rc_status
if test "$start_klogd" = yes ; then
startproc ${klog_bin} -c $KERNEL_LOGLEVEL $KLOGD_PARAMS
rc_status
fi
fi
rc_status -v
;;
@ -133,7 +176,11 @@ case "$1" in
test "$2" = "early" && exit 0
echo -n "Shutting down syslog services"
killproc -TERM ${klog_bin} ; rc_status
if test "$start_klogd" = yes ; then
killproc -TERM ${klog_bin} ; rc_status
else
killproc -TERM ${klog_bin}
fi
killproc -p ${syslog_use_pid} -TERM ${syslog_use} ; rc_status -v
rm -f /var/lock/subsys/syslogd
;;
@ -156,20 +203,27 @@ case "$1" in
;;
reload|force-reload)
echo -n "Reload syslog service"
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
if test "$start_klogd" = yes ; then
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
else
killproc -p ${syslog_use_pid} -HUP ${syslog_use} ; rc_status -v
fi
;;
status)
echo -n "Checking for service syslog:"
checkproc ${klog_bin} ; rc_status
if test "$start_klogd" = yes ; then
checkproc ${klog_bin} ; rc_status
fi
checkproc -p ${syslog_use_pid} ${syslog_use} ; rc_status -v
;;
probe)
if test "${syslog_use_pid}" != "${syslog_pid}" ; then
echo restart
else
# Note: does not work when an included rsyslog config changed
test ${config} -nt ${syslog_pid} && echo reload
fi
;;

View File

@ -7,8 +7,9 @@ syslog-ng, syslogd
.SH DESCRIPTION
There are different syslog daemon implementations
supported as the system's syslog service, currently
.IR syslogd \ and
.IR syslog-ng .
.IR syslogd ,
.IR syslog-ng \ and
.IR rsyslogd
By default
.IR syslog-ng
is installed and enabled.
@ -36,3 +37,5 @@ Marius Tomaschewski <mt@novell.com>
.BR syslog.conf (5)
.BR syslog-ng (8)
.BR syslog-ng.conf (5)
.BR rsyslogd (8)
.BR rsyslog.conf (5)

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Wed Sep 3 14:29:46 CEST 2008 - mt@suse.de
- Added log files used by syslog-ng (and rsyslog) daemons to the
/etc/logrotate.d/syslog file. Added logrotate to klogd requires.
- Added rsyslog support to the /etc/init.d/syslog and earlysyslog
init scripts.
-------------------------------------------------------------------
Fri Aug 22 15:24:08 CEST 2008 - ro@suse.de

View File

@ -27,7 +27,7 @@ PreReq: coreutils %fillup_prereq klogd sed
Provides: syslog
AutoReqProv: on
Version: 1.4.1
Release: 696
Release: 704
Summary: The Syslog daemon
Source: sysklogd-1.4.1.tar.bz2
Source1: logrotate.syslog
@ -81,7 +81,7 @@ License: GPL v2 or later
PreReq: %insserv_prereq %fillup_prereq
Provides: sysklogd
Provides: syslogd:/sbin/klogd
Requires: /etc/init.d/network
Requires: /etc/init.d/network logrotate
Summary: The kernel log daemon
Group: System/Daemons
@ -238,6 +238,11 @@ fi
%{omc_svcdir}/syslog.xml
%changelog
* Wed Sep 03 2008 mt@suse.de
- Added log files used by syslog-ng (and rsyslog) daemons to the
/etc/logrotate.d/syslog file. Added logrotate to klogd requires.
- Added rsyslog support to the /etc/init.d/syslog and earlysyslog
init scripts.
* Fri Aug 22 2008 ro@suse.de
- remove deprecated options from fillup_and_insserv call
* Wed Aug 13 2008 werner@suse.de