Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Oct 2017 17:05:32 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 223132] /etc/rc.d/sendmail status returns the wrong exit code
Message-ID:  <bug-223132-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D223132

            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@FreeBSD.org
          Reporter: jim+freebsd@pirzyk.org

If you have a mail server that is running sendmail daemon (sendmail_enable=
=3DYES)
and sendmail queue runner (sendmail_msp_queue=3DYES) 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 wi=
ll
return non zero as the exit code:

pirzyk@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@amigo:~
3>sudo kill -9 874
pirzyk@amigo:~
4>sudo /etc/rc.d/sendmail status; echo $?
sendmail is not running.
sendmail_msp_queue is running as pid 877.
0
pirzyk@amigo:~
5>sudo /etc/rc.d/sendmail restart=20=20=20=20=20=20=20=20
sendmail not running? (check /var/run/sendmail.pid).
Starting sendmail.
pirzyk@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@amigo:~
7>sudo kill -9 877;
pirzyk@amigo:~
8>sudo /etc/rc.d/sendmail status; echo $?
sendmail is running as pid 6189.
sendmail_msp_queue is not running.
1

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-223132-8>