Mageia Bugzilla – Attachment 978 Details for
Bug 3017
Amavisd does not start up after an unclean shutdown
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
Patch to amavisd init script to delete stale pid file.
amavisd.patch (text/plain), 833 bytes, created by
Dave Hodgins
on 2011-10-19 05:07:06 CEST
(
hide
)
Description:
Patch to amavisd init script to delete stale pid file.
Filename:
MIME Type:
Creator:
Dave Hodgins
Created:
2011-10-19 05:07:06 CEST
Size:
833 bytes
patch
obsolete
>--- /etc/rc.d/init.d/amavisd.original 2011-02-24 00:01:33.000000000 -0500 >+++ /etc/rc.d/init.d/amavisd 2011-10-18 22:59:58.389133117 -0400 >@@ -28,7 +28,7 @@ > prog_base="$(basename ${prog})" > > prog_config_file="/etc/amavisd/amavisd.conf" >- >+pidfile="/var/lib/amavis/amavisd.pid" > # Source configuration. > [ -e /etc/sysconfig/${prog_base} ] && . /etc/sysconfig/${prog_base} > >@@ -40,6 +40,12 @@ > # See how we were called. > case "$1" in > start) >+ if [ -f "$pidfile" ]; then >+ read RunningPID < "$pidfile" >+ if ! grep -q "${0##*/}" /proc/$RunningPID/cmdline > /dev/null 2>&1; then >+ echo "Stale $pidfile found. Deleting." && rm -f "$pidfile" >+ fi >+ fi > action $"Starting %s:" "${prog_base}" ${prog} -c ${prog_config_file} > RETVAL=$? > [ $RETVAL -eq 0 ] && touch /var/lock/subsys/${prog_base}
--- /etc/rc.d/init.d/amavisd.original 2011-02-24 00:01:33.000000000 -0500 +++ /etc/rc.d/init.d/amavisd 2011-10-18 22:59:58.389133117 -0400 @@ -28,7 +28,7 @@ prog_base="$(basename ${prog})" prog_config_file="/etc/amavisd/amavisd.conf" - +pidfile="/var/lib/amavis/amavisd.pid" # Source configuration. [ -e /etc/sysconfig/${prog_base} ] && . /etc/sysconfig/${prog_base} @@ -40,6 +40,12 @@ # See how we were called. case "$1" in start) + if [ -f "$pidfile" ]; then + read RunningPID < "$pidfile" + if ! grep -q "${0##*/}" /proc/$RunningPID/cmdline > /dev/null 2>&1; then + echo "Stale $pidfile found. Deleting." && rm -f "$pidfile" + fi + fi action $"Starting %s:" "${prog_base}" ${prog} -c ${prog_config_file} RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/${prog_base}
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 3017
: 978