From c4f3b665ffcd486d87a43bca0f8761de80921755 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Wed, 30 Dec 2015 21:48:43 +0100 Subject: [PATCH] saving uncommitted changes in /etc prior to emerge run --- conf.d/rsyslog | 10 +++++----- init.d/rsyslog | 22 +++++++++++++--------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/conf.d/rsyslog b/conf.d/rsyslog index d8cbe875..da48c01c 100644 --- a/conf.d/rsyslog +++ b/conf.d/rsyslog @@ -1,25 +1,25 @@ # /etc/conf.d/rsyslog # Configuration file -RSYSLOG_CONFIGFILE="/etc/rsyslog.conf" +#RSYSLOG_CONFIGFILE="/etc/rsyslog.conf" # PID file # If you should ever change this, remember to update # "/etc/logrotate.d/rsyslog", too. -RSYSLOG_PIDFILE="/run/rsyslogd.pid" +#RSYSLOG_PIDFILE="/run/rsyslogd.pid" # You can use this configuration option to pass additional options to the # start-stop-daemon, see start-stop-daemon(8) for more details. # Per default we wait 1000ms after we have started the service to ensure # that the daemon is really up and running. -RSYSLOG_SSDARGS="--wait 1000" +#RSYSLOG_SSDARGS="--wait 1000" # The termination timeout (start-stop-daemon parameter "retry") ensures # that the service will be terminated within a given time (60 + 5 seconds # per default) when you are stopping the service. # You need to increase the value when you are working with a large queue. # See http://www.rsyslog.com/doc/queues.html for further information. -RSYSLOG_TERMTIMEOUT="TERM/60/KILL/5" +#RSYSLOG_TERMTIMEOUT="TERM/60/KILL/5" # Options to rsyslogd @@ -27,4 +27,4 @@ RSYSLOG_TERMTIMEOUT="TERM/60/KILL/5" # Notes: # * Do not specify another PIDFILE but use the variable above to change the location # * Do not specify another CONFIGFILE but use the variable above to change the location -RSYSLOG_OPTS="" +#RSYSLOG_OPTS="" diff --git a/init.d/rsyslog b/init.d/rsyslog index a74f218e..078740d2 100755 --- a/init.d/rsyslog +++ b/init.d/rsyslog @@ -1,13 +1,16 @@ #!/sbin/runscript -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ RSYSLOG_CONFIGFILE=${RSYSLOG_CONFIGFILE:-"/etc/rsyslog.conf"} RSYSLOG_PIDFILE=${RSYSLOG_PIDFILE:-"/run/rsyslogd.pid"} +RSYSLOG_SSDARGS=${RSYSLOG_SSDARGS:-"--wait 1000"} +RSYSLOG_TERMTIMEOUT=${RSYSLOG_TERMTIMEOUT:-"TERM/60/KILL/5"} +RSYSLOG_OPTS=${RSYSLOG_OPTS:-""} command="/usr/sbin/rsyslogd" -command_args="${RSYSLOG_OPTS} -f ${RSYSLOG_CONFIGFILE} -i ${RSYSLOG_PIDFILE}" +command_args="${RSYSLOG_OPTS} -f \"${RSYSLOG_CONFIGFILE}\" -i \"${RSYSLOG_PIDFILE}\"" start_stop_daemon_args="${RSYSLOG_SSDARGS}" pidfile="${RSYSLOG_PIDFILE}" retry="${RSYSLOG_TERMTIMEOUT}" @@ -41,22 +44,23 @@ stop_pre() { } stop_post() { - rm -f ${RSYSLOG_PIDFILE} + if [ -f "${RSYSLOG_PIDFILE}" ]; then + vebegin "Removing stale PID file" + rm --force "${RSYSLOG_PIDFILE}" + veend $? + fi } configtest() { - # This will currently only detect fatal errors - # See https://github.com/rsyslog/rsyslog/issues/79 - - local _test_command="${command} -N 999 -f ${RSYSLOG_CONFIGFILE}" + local _command_args="-N 999 -f \"${RSYSLOG_CONFIGFILE}\"" local _retval=0 ebegin "Checking rsyslogd's configuration" - ${_test_command} >/dev/null 2>&1 + eval ${command} ${_command_args} >/dev/null 2>&1 _retval=$? if [ ${_retval} -ne 0 ]; then - ${_test_command} + eval ${command} ${_command_args} fi eend ${_retval} "failed, please correct errors above" -- 2.39.5