#!/sbin/runscript gem_path=$(gem env gemdir) name="unicorn_rails" start_script="$gem_path/bin/$name" app_dir="/usr/share/webapps/redmine" user="redmine" start() { ebegin "Starting redmine" start-stop-daemon --start --quiet \ -u $user \ -d $app_dir \ $start_script -- \ -D -E production eend $? } stop() { ebegin "Stopping redmine" start-stop-daemon --stop \ --name $name eend $? sleep 1 } reload() { ebegin "Reload redmine" start-stop-daemon --signal USR2 \ --name $name eend $? }