diff options
author | Philip M. Gollucci <pgollucci@FreeBSD.org> | 2010-04-26 23:14:05 +0000 |
---|---|---|
committer | Philip M. Gollucci <pgollucci@FreeBSD.org> | 2010-04-26 23:14:05 +0000 |
commit | 7aab0e034abd7395e31d90439de158b865425245 (patch) | |
tree | 48db3e3868a31799b4a702a731eac1ee712fe034 /www | |
parent | 0af85670556a82410928701842846dec1b113880 (diff) |
- Fix rc.d script
PR: ports/145295
Submitted by: Toomas Aas <toomas@tarkvarastuudio.ee>
Tweaked by: myself
Notes
Notes:
svn path=/head/; revision=253310
Diffstat (limited to 'www')
-rw-r--r-- | www/ruby-cruisecontrolrb/Makefile | 2 | ||||
-rw-r--r-- | www/ruby-cruisecontrolrb/files/cruisecontrolrb.in | 45 |
2 files changed, 21 insertions, 26 deletions
diff --git a/www/ruby-cruisecontrolrb/Makefile b/www/ruby-cruisecontrolrb/Makefile index e07ceb084d2b..c5458da622b6 100644 --- a/www/ruby-cruisecontrolrb/Makefile +++ b/www/ruby-cruisecontrolrb/Makefile @@ -6,7 +6,7 @@ PORTNAME= cruisecontrolrb PORTVERSION= 1.3.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= www devel ruby MASTER_SITES= RF PKGNAMEPREFIX= ${RUBY_PKGNAMEPREFIX} diff --git a/www/ruby-cruisecontrolrb/files/cruisecontrolrb.in b/www/ruby-cruisecontrolrb/files/cruisecontrolrb.in index 662ca1899c68..af6046e6e8c4 100644 --- a/www/ruby-cruisecontrolrb/files/cruisecontrolrb.in +++ b/www/ruby-cruisecontrolrb/files/cruisecontrolrb.in @@ -1,4 +1,5 @@ #!/bin/sh +# # PROVIDE: cruisecontrolrb # REQUIRE: DAEMON # KEYWORD: shutdown @@ -6,41 +7,35 @@ # 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 +# 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 -command="%%WWWDIR%%/cruise" +pidfile="%%PREFIX%%/www/${name}/tmp/pids/mongrel.pid" +command="%%PREFIX%%/www/${name}/cruise" + +start_cmd="cruisecontrolrb_start" +stop_cmd="cruisecontrolrb_stop" + +cruisecontrolrb_start() { + set -x + ${command} start ${command_args} +} +cruisecontrolrb_stop() { + kill $(cat $pidfile) +} load_rc_config $name : ${cruisecontrolrb_enable="NO"} : ${cruisecontrolrb_port="3333"} -command_args="-p ${curisecontrolrb_port}" -start_cmd="cruisecontrolrb_cmd start" -stop_cmd="cruisecontrolrb_cmd stop" -restart_cmd="cruisecontrolrb_restart" - -cruisecontrolrb_cmd() { - if [ ${command} = "start" ]; then - command_args="${command_args} -d" - fi - - ${command} $1 ${command_args} - -} - -cruisecontrolrb_restart() { - ${command} stop - ${command} start ${command_args} -} +command_args="-p ${cruisecontrolrb_port} -d" +run_rc_command "$1" |