According to the LSB, 'running "stop" on a service already stopped or not running' is considered a successful action (and should thus return 0). When running "service sendmail stop" (or invoking the init script directly) and sendmail isn't running, it returns 1: [root@delfi3-1 ~]# service sendmail stop Shutting down sendmail: [FAILED] [root@delfi3-1 ~]# echo $? 1 [root@delfi3-1 ~]#
This is important to us as the init scripts not being LSB-compliant breaks the Heartbeat HA (high availability) scripts.
I tracked this down to line 219 of /etc/rc.d/init.d/functions. The line currently reads RC=1 It either should be changed to RC=0 or else a more careful check to see if the service is already stopped should be undertaken before returning error (1).
This is an initscripts problem, then. The same stop mechanism is used in many init scripts.
*** This bug has been marked as a duplicate of 151104 ***