[Bug 223132] /etc/rc.d/sendmail status returns the wrong exit code
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Fri Oct 20 17:05:32 UTC 2017
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223132
Bug ID: 223132
Summary: /etc/rc.d/sendmail status returns the wrong exit code
Product: Base System
Version: 11.1-RELEASE
Hardware: Any
OS: Any
Status: New
Severity: Affects Some People
Priority: ---
Component: conf
Assignee: freebsd-bugs at FreeBSD.org
Reporter: jim+freebsd at pirzyk.org
If you have a mail server that is running sendmail daemon (sendmail_enable=YES)
and sendmail queue runner (sendmail_msp_queue=YES) and the sendmai daemon dies,
/etc/rc.d/sendmail status does see the daemon is not running but returns 0 as
the exit code. This prevents other programs (like puppet) from restarting
sendmail to fix the issue. If the sendmail_msp_queue is not running, it will
return non zero as the exit code:
pirzyk at amigo:~
2>sudo /etc/rc.d/sendmail status; echo $?
sendmail is running as pid 874.
sendmail_msp_queue is running as pid 877.
0
pirzyk at amigo:~
3>sudo kill -9 874
pirzyk at amigo:~
4>sudo /etc/rc.d/sendmail status; echo $?
sendmail is not running.
sendmail_msp_queue is running as pid 877.
0
pirzyk at amigo:~
5>sudo /etc/rc.d/sendmail restart
sendmail not running? (check /var/run/sendmail.pid).
Starting sendmail.
pirzyk at amigo:~
6>sudo /etc/rc.d/sendmail status; echo $?
sendmail is running as pid 6189.
sendmail_msp_queue is running as pid 877.
0
pirzyk at amigo:~
7>sudo kill -9 877;
pirzyk at amigo:~
8>sudo /etc/rc.d/sendmail status; echo $?
sendmail is running as pid 6189.
sendmail_msp_queue is not running.
1
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list