Bug 119429 - shutting down sm-client fails
Summary: shutting down sm-client fails
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: sendmail
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Thomas Woerner
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks: FC2Blocker 200920
TreeView+ depends on / blocked
 
Reported: 2004-03-30 13:26 UTC by Gene Czarcinski
Modified: 2007-11-30 22:10 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-07-19 10:08:06 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Gene Czarcinski 2004-03-30 13:26:54 UTC
Description of problem:

When sendmail is shutdown (manually or at reboot/shutdown), a message
is issued that shutting down sm-client FAILED

Comment 1 Albert Strasheim 2004-04-05 17:50:01 UTC
This seems to be SELinux related.

With my default install (i.e. all packages, selected all the default
options regarding SELinux when installing), I get the following in
/var/log/maillog when starting up sendmail and sm-client after logging
in as root (using the root:sysadm_r:sysadm_t context):

Apr  5 19:53:28 asok sm-msp-queue[28799]: unable to write
/var/run/sm-client.pid: Permission denied

Thus, sm-client doesn't start, but you still receive the OK message
(not good). So when you shut down sm-client, the FAILED message appears.

With setenforce 0, sm-client starts up and shuts down without problems.

Comment 2 Gene Czarcinski 2004-04-05 17:57:01 UTC
Good point.  This was submoitted before I realized that a lot of these
really needed to be reported against the policy package.

Comment 3 Daniel Walsh 2004-04-08 13:41:45 UTC
fixed in sendmail-8.12.11-4.5

Comment 4 Gene Czarcinski 2004-04-12 14:48:50 UTC
Installed the update sendmail.  Shutdown for sm-client still fails.

Comment 5 Adam Herscher 2004-05-10 15:12:54 UTC
commenting out these 2 lines in the sendmail init.d script fixed the 
problem for me:

       touch /var/run/sm-client.pid
       chown smmsp:smmsp /var/run/sm-client.pid

sendmail will not write to the sm-client.pid file if it already 
exists (touched & chowned), even if the permissions are correct, 
unless the file is world writeable (strange indeed).

if the file does not exist, sendmail will create it:

-rw-------    1 root     smmsp          49 May 10 08:18 sm-client.pid

this fixed the unable to write maillog error on my system, and fixed 
the script itself (--check and killproc were not functioning 
correctly due to the pid file not being written)

i'm using sendmail-8.12.8-9.80


Comment 6 Daniel Walsh 2004-06-23 19:30:01 UTC
Does this fix look ok to you Thomas?

Dan

Comment 7 Sean Kelly 2004-10-24 02:08:46 UTC
If it's helpful/related, I've just upgraded to BIND 8.13.1 on RH9 and 
sm-client also FAILED on "stop" directive to the /etc/init.d/sendmail 
rc script. I've found that if I wait a few seconds, it does indeed 
stop OK if I run the stop script again. It seems like the program has 
some sort of internal cleanup tht takes longer than is required for 
this OK/FAILED check on exit. (?) I was also having problems when old 
sendmail processes were still running. I had to killall sendmail at 
one point to get them to go away, possibly from all the stop 
failures, but start successes I'd been getting.


Comment 8 Arek Wojtowicz 2005-02-04 12:10:07 UTC
The problem exist also in Fedora Core 3. If we look at
/etc/init.d/sendmail starting script we see:

...
        if test -f /var/run/sm-client.pid ; then
                echo -n $"Shutting down sm-client: "
                killproc sm-client
                RETVAL=$?
                echo
                [ $RETVAL -eq 0 ] && rm -f /var/run/sm-client.pid
                [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sm-client
        fi
        return $RETVAL
}
...

So it basically checks wheather /var/run/sm-client.pid exist na if it
does it
executes:

killproc sm-client (notice that /var/run/sm-client.pid is empty)

killproc checks whether /var/run/sm-client.pid is empty an then tries
to find out pid of the process:
...
     if [ -z "$pid" ]; then
                pid=`pidof -o $$ -o $PPID -o %PPID -x $1 || \
                        pidof -o $$ -o $PPID -o %PPID -x $base`
        fi
...

unfortunately $1 = $base = sm-client and process name is in fact
sendmail that's why it doesn't kill the second process. Quick patch to
make it working:

--- sendmail.orig       2005-02-04 13:05:11.725648784 +0100
+++ sendmail    2005-02-04 13:04:57.837760064 +0100
@@ -108,7 +108,7 @@
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sendmail
        if test -f /var/run/sm-client.pid ; then
                echo -n $"Shutting down sm-client: "
-               killproc sm-client 
+               killproc sendmail 
                RETVAL=$?
                echo
                [ $RETVAL -eq 0 ] && rm -f /var/run/sm-client.pid

Comment 9 Thomas Woerner 2006-07-19 10:08:06 UTC
Fixed in rawhide in package sendmail-8.13.7-3 or newer.


Note You need to log in before you can comment on or make changes to this bug.