diff options
author | pgollucci <pgollucci@FreeBSD.org> | 2010-04-27 07:14:05 +0800 |
---|---|---|
committer | pgollucci <pgollucci@FreeBSD.org> | 2010-04-27 07:14:05 +0800 |
commit | 20140b0c688c20863924d9b727bb9abcbfbb51c6 (patch) | |
tree | f3b2fe3400414c8c3015bc2787747a07ee41a24d | |
parent | 58367d6eabc3683e5c1ed0c937a613860a8e68b3 (diff) | |
download | freebsd-ports-gnome-20140b0c688c20863924d9b727bb9abcbfbb51c6.tar.gz freebsd-ports-gnome-20140b0c688c20863924d9b727bb9abcbfbb51c6.tar.zst freebsd-ports-gnome-20140b0c688c20863924d9b727bb9abcbfbb51c6.zip |
- Fix rc.d script
PR: ports/145295
Submitted by: Toomas Aas <toomas@tarkvarastuudio.ee>
Tweaked by: myself
-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" |