Bug 145295 - www/ruby-cruisecontrolrb installs a non-working rc.d script
Summary: www/ruby-cruisecontrolrb installs a non-working rc.d script
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Philip M. Gollucci
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-02 17:10 UTC by Toomas Aas
Modified: 2010-04-27 00:20 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Toomas Aas 2010-04-02 17:10:11 UTC
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.

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"
How-To-Repeat: Install the www/ruby-cruisecontrolrb port and try running the supplied rc.d script:
/usr/local/etc/rc.d/cruisecontrolrb start
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2010-04-02 17:10:27 UTC
Responsible Changed
From-To: freebsd-ports-bugs->pgollucci

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Philip M. Gollucci freebsd_committer freebsd_triage 2010-04-27 00:14:15 UTC
State Changed
From-To: open->closed

Committed, with minor changes. Thanks!
Comment 3 dfilter service freebsd_committer freebsd_triage 2010-04-27 00:14:18 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"