From owner-freebsd-bugs@freebsd.org Fri Oct 20 17:05:32 2017 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A640BE3AF1A for ; Fri, 20 Oct 2017 17:05:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F0C082FB8 for ; Fri, 20 Oct 2017 17:05:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id v9KH5WMu060349 for ; Fri, 20 Oct 2017 17:05:32 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 223132] /etc/rc.d/sendmail status returns the wrong exit code Date: Fri, 20 Oct 2017 17:05:32 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: conf X-Bugzilla-Version: 11.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: jim+freebsd@pirzyk.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2017 17:05:32 -0000 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.=