From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Aug 14 15:40:02 2013 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F2E5AEE for ; Wed, 14 Aug 2013 15:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D158722EF for ; Wed, 14 Aug 2013 15:40:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r7EFe1CF034112 for ; Wed, 14 Aug 2013 15:40:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r7EFe1GL034111; Wed, 14 Aug 2013 15:40:01 GMT (envelope-from gnats) Resent-Date: Wed, 14 Aug 2013 15:40:01 GMT Resent-Message-Id: <201308141540.r7EFe1GL034111@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Oliver Fromme Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4C2B2AD for ; Wed, 14 Aug 2013 15:38:03 +0000 (UTC) (envelope-from olli@grabthar.secnetix.de) Received: from grabthar.secnetix.de (grabthar.secnetix.de [IPv6:2a01:170:102f::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D1C4022D9 for ; Wed, 14 Aug 2013 15:38:02 +0000 (UTC) Received: from grabthar.secnetix.de (localhost [127.0.0.1]) by grabthar.secnetix.de (8.14.7/8.14.7) with ESMTP id r7EFbwIR000719; Wed, 14 Aug 2013 17:37:58 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by grabthar.secnetix.de (8.14.7/8.14.7/Submit) id r7EFbwup000718; Wed, 14 Aug 2013 17:37:58 +0200 (CEST) (envelope-from olli) Message-Id: <201308141537.r7EFbwup000718@grabthar.secnetix.de> Date: Wed, 14 Aug 2013 17:37:58 +0200 (CEST) From: Oliver Fromme To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.114 Subject: ports/181298: mail/mailman: Implement "status" for rc.d script Cc: Oliver Fromme X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Oliver Fromme List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Aug 2013 15:40:02 -0000 >Number: 181298 >Category: ports >Synopsis: mail/mailman: Implement "status" for rc.d script >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Aug 14 15:40:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Oliver Fromme >Release: FreeBSD 9.1-STABLE-20130621 i386 >Organization: secnetix GmbH & Co. KG http://www.secnetix.de/bsd >Environment: n/a >Description: The rc.d script provided with the mailman port doesn't support a "status" argument. The patch below adds this. >How-To-Repeat: Without the patch: # service mailman status /usr/local/etc/rc.d/mailman: unknown directive 'status'. Usage: /usr/local/etc/rc.d/mailman [fast|force|one|quiet](start|stop|restart|rcvar|reload) With the patch applied: # service mailman status mailman is running as pid 38369. # echo $? 0 # service mailman stop # service mailman status mailman is not running. # echo $? 1 >Fix: Apply the following patch to ports/mail/mailman/files/mailman.in: --- mailman.in.orig 2012-07-14 15:54:48.000000000 +0200 +++ mailman.in 2013-08-14 17:29:02.000000000 +0200 @@ -23,7 +23,8 @@ start_cmd=${name}_start stop_cmd=${name}_stop -extra_commands="reload" +status_cmd=${name}_status +extra_commands="reload status" mailman_start() { %%MAILMANDIR%%/bin/mailmanctl -s -q start @@ -35,4 +36,15 @@ || echo ${name} not running? \(check ${pidfile}\) } +mailman_status() { + local retcode=0 + if [ -f $pidfile ] && ps -p $(cat $pidfile) > /dev/null; then + echo $name is running as pid $(cat $pidfile). + else + echo $name is not running. + retcode=1 + fi + return $retcode +} + run_rc_command "$1" >Release-Note: >Audit-Trail: >Unformatted: