From nobody@FreeBSD.org  Fri Apr  2 16:02:26 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B1809106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  2 Apr 2010 16:02:26 +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 863EE8FC13
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  2 Apr 2010 16:02:26 +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 o32G2PJf011011
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 2 Apr 2010 16:02:25 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o32G2PQ0011010;
	Fri, 2 Apr 2010 16:02:25 GMT
	(envelope-from nobody)
Message-Id: <201004021602.o32G2PQ0011010@www.freebsd.org>
Date: Fri, 2 Apr 2010 16:02:25 GMT
From: Toomas Aas <toomas@tarkvarastuudio.ee>
To: freebsd-gnats-submit@FreeBSD.org
Subject: www/ruby-cruisecontrolrb installs a non-working rc.d script
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         145295
>Category:       ports
>Synopsis:       www/ruby-cruisecontrolrb installs a non-working rc.d script
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pgollucci
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 02 16:10:11 UTC 2010
>Closed-Date:    Mon Apr 26 23:14:16 UTC 2010
>Last-Modified:  Mon Apr 26 23:20:03 UTC 2010
>Originator:     Toomas Aas
>Release:        6.4
>Organization:
>Environment:
FreeBSD mail.tarkvarastuudio.ee 6.4-RELEASE-p4 FreeBSD 6.4-RELEASE-p4 #2: Tue Oct 13 08:03:57 EEST 2009     toomas@mail.tarkvarastuudio.ee:/usr/obj/usr/src/sys/TVS  amd64
>Description:
After installing the www/ruby-cruisecontrolrb port, setting cruisecontrolrb_enable="YES" in /etc/rc.conf and issuing the command /usr/local/etc/rc.d/cruisecontrolrb start, the process does not start.

It seems to me that there are three problems with the script:

1. The script does not have the run_rc_command line;
2. There is a typo on line 28 ("curisecontrol" instead of "cruisecontrol", causing invalid arguments being passed to the start command;
3. 'stop' is not a valid argument for the cruise command, which means that stop command does not stop the daemon, giving an error message instead.

>How-To-Repeat:
Install the www/ruby-cruisecontrolrb port and try running the supplied rc.d script:
/usr/local/etc/rc.d/cruisecontrolrb start
>Fix:
Replace the port-supplied script with the following:

#!/bin/sh
# PROVIDE: cruisecontrolrb
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# This script is modified by placing the following variables inside
# /etc/rc.conf.local, /etc/rc.conf, or /etc/rc.conf.d/cruisecontrolrb:
#
# cruisecontrolrb_enable (bool):
#   Set it to YES to enable this service.
#   Default: NO
# cruisecontrolrb_port (port):
#   Set it to a port
#   Default: 3333

. /etc/rc.subr

name=cruisecontrolrb
rcvar=${name}_enable
pidfile="/usr/local/www/cruisecontrolrb/tmp/pids/mongrel.pid"
command="/usr/local/www/cruisecontrolrb/cruise"

load_rc_config $name

: ${cruisecontrolrb_enable="NO"}
: ${cruisecontrolrb_port="3333"}

command_args="-p ${cruisecontrolrb_port}"
start_cmd="cruisecontrolrb_cmd start"
stop_cmd="cruisecontrolrb_cmd stop"
cruisecontrolrb_cmd() {
    case $1 in
        start)
             command_args="${command_args} -d"
             ${command} $1 ${command_args}
             ;;
        stop)
            kill `cat $pidfile`
            ;;
    esac
}

run_rc_command "$1"


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->pgollucci 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Fri Apr 2 16:10:27 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=145295 
State-Changed-From-To: open->closed 
State-Changed-By: pgollucci 
State-Changed-When: Mon Apr 26 23:14:15 UTC 2010 
State-Changed-Why:  
Committed, with minor changes. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=145295 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/145295: commit references a PR
Date: Mon, 26 Apr 2010 23:14:18 +0000 (UTC)

 pgollucci    2010-04-26 23:14:05 UTC
 
   FreeBSD ports repository
 
   Modified files:
     www/ruby-cruisecontrolrb Makefile 
     www/ruby-cruisecontrolrb/files cruisecontrolrb.in 
   Log:
   - Fix rc.d script
   
   PR:             ports/145295
   Submitted by:   Toomas Aas <toomas@tarkvarastuudio.ee>
   Tweaked by:     myself
   
   Revision  Changes    Path
   1.7       +1 -1      ports/www/ruby-cruisecontrolrb/Makefile
   1.4       +20 -25    ports/www/ruby-cruisecontrolrb/files/cruisecontrolrb.in
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
