Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 9b44ea4d91
Fetching contributors…

Cannot retrieve contributors at this time

49 lines (43 sloc) 1.314 kB
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: daikon
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Daikon init script
# Description: Daikon connects to radishapp.com
### END INIT INFO
password="<%= @node[:daikon][:password] %>"
log_dir="<%= @node[:daikon][:home_dir] %>"
logfile="${log_dir}/daikon.log"
# using non-standard pidfile location, until daikon gem is updated
pidfile="${log_dir}/daikon.pid"
run_as_user="<%= @node[:daikon][:user] %>"
sleep_time_during_restart=5
# override above values, or set any other env variables you need
[ -f /etc/default/daikon ] && . /etc/default/daikon
case "$1" in
run-with-log)
# need this hack to ensure logfile location, until daikon gem is updated
/usr/bin/daikon run -- -k "${password}" >> "${logfile}" 2>&1 &
;;
start)
start-stop-daemon --start --pidfile ${pidfile} \
--chuid ${run_as_user} --chdir ${log_dir} \
--oknodo --startas $0 -- run-with-log
;;
stop)
start-stop-daemon --stop --pidfile ${pidfile}
;;
restart)
$0 stop
sleep ${sleep_time_during_restart}
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
# vim:ft=sh
Jump to Line
Something went wrong with that request. Please try again.