From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Dec 10 00:30:05 2009 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEE71106568B for ; Thu, 10 Dec 2009 00:30:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 8BA248FC14 for ; Thu, 10 Dec 2009 00:30:05 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id nBA0U5Re031279 for ; Thu, 10 Dec 2009 00:30:05 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id nBA0U5BZ031276; Thu, 10 Dec 2009 00:30:05 GMT (envelope-from gnats) Resent-Date: Thu, 10 Dec 2009 00:30:05 GMT Resent-Message-Id: <200912100030.nBA0U5BZ031276@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, Glen Barber Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD8B51065679 for ; Thu, 10 Dec 2009 00:29:35 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 67C838FC15 for ; Thu, 10 Dec 2009 00:29:35 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id nBA0TZo2030516 for ; Thu, 10 Dec 2009 00:29:35 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id nBA0TZXs030515; Thu, 10 Dec 2009 00:29:35 GMT (envelope-from nobody) Message-Id: <200912100029.nBA0TZXs030515@www.freebsd.org> Date: Thu, 10 Dec 2009 00:29:35 GMT From: Glen Barber To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/141330: [patch] mail/p5-qpsmtpd: rc script fixes X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 00:30:05 -0000 >Number: 141330 >Category: ports >Synopsis: [patch] mail/p5-qpsmtpd: rc script fixes >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Dec 10 00:30:05 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Glen Barber >Release: 8.0-STABLE >Organization: >Environment: FreeBSD orion 8.0-STABLE FreeBSD 8.0-STABLE #7 r200016: Wed Dec 2 00:18:02 EST 2009 root@orion:/usr/obj/usr/src/sys/ORION amd64 >Description: The mail/p5-qpsmtpd rc.d script: - contains a typo - does not daemonize the process by default - does not check if the process is currently running - does not provide output to STDOUT on start-up, shutdown, or when errors are encountered >How-To-Repeat: >Fix: The attached patch addresses the following: - fixes a typo following the '-u' argument - adds the '-d' (daemon) argument by default - adds sanity checking for starting/stopping the service - provides verbose output Patch attached with submission follows: diff -ruN /usr/ports/mail/p5-qpsmtpd.orig/files/qpsmtpd.in /usr/ports/mail/p5-qpsmtpd/files/qpsmtpd.in --- /usr/ports/mail/p5-qpsmtpd.orig/files/qpsmtpd.in 2008-12-25 09:55:17.000000000 -0500 +++ /usr/ports/mail/p5-qpsmtpd/files/qpsmtpd.in 2009-12-09 19:12:54.000000000 -0500 @@ -68,12 +68,33 @@ start_cmd() { - eval $command -p $qpsmtpd_port -c $qpsmtpd_max_connections -u $qpsmtpd_users -m $qpsmtpd_max_per_ip -l $qpsmtpd_listen_on --pid-file $pidfile + if [ -e $pidfile ]; then + echo "$name already running as PID `cat $pidfile`." + exit 1 + else + eval $command \ + -p $qpsmtpd_port \ + -c $qpsmtpd_max_connections \ + -u $qpsmtpd_user \ + -m $qpsmtpd_max_per_ip \ + -l $qpsmtpd_listen_on \ + --pid-file $pidfile \ + -d \ + && echo "$name started as PID `cat $pidfile`." \ + || echo "Failed to start $name" + fi } stop_cmd() { - kill `cat $pidfile` + if [ -e $pidfile ]; then + kill `cat $pidfile` \ + && echo "$name stopped." \ + || echo "Could not stop `cat $pidfile`." + else + echo "Cannot find $pidfile - $name not running?" + exit 1 + fi } run_rc_command "$1" >Release-Note: >Audit-Trail: >Unformatted: