1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
# (better) lsb compliance
Index: ruby-thin/lib/thin/controllers/service.sh.erb
===================================================================
--- ruby-thin.orig/lib/thin/controllers/service.sh.erb 2012-01-10 01:15:50.000000000 -0800
+++ ruby-thin/lib/thin/controllers/service.sh.erb 2012-01-10 01:17:56.000000000 -0800
@@ -4,7 +4,7 @@
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
-# Default-Stop: S 0 1 6
+# Default-Stop: 0 1 6
# Short-Description: thin initscript
# Description: thin
### END INIT INFO
@@ -15,20 +15,28 @@
DAEMON=<%= Command.script %>
SCRIPT_NAME=<%= INITD_PATH %>
-CONFIG_PATH=<%= config_files_path %>
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
+run_action() {
+ ACTION="$1"
+ <% rubies.each do |etcname, path| %>
+ if [ -x <%= path %> ]; then
+ <%= path %> $DAEMON $ACTION --all <%= "/etc/thin" + etcname %>
+ fi
+ <% end %>
+}
+
case "$1" in
start)
- $DAEMON start --all $CONFIG_PATH
+ run_action start
;;
stop)
- $DAEMON stop --all $CONFIG_PATH
+ run_action stop
;;
- restart)
- $DAEMON restart --all $CONFIG_PATH
+ restart|force-reload|reload)
+ run_action restart
;;
*)
echo "Usage: $SCRIPT_NAME {start|stop|restart}" >&2
|