puppet-standalone-mashup/shared/additional-modules/god/templates/god-init.d

41 lines
835 B
D
Raw Normal View History

2012-06-01 18:24:53 +00:00
<%= scope.function_template(['base/init-d-header']) %>
2012-05-14 13:15:05 +00:00
<% bin = scope.lookupvar('god::bin') %>
2012-05-02 22:17:23 +00:00
<%= init_d_prolog %>
PATH=/usr/local/ruby/bin:<%= scope.lookupvar('base::path') %>
<%= init_d_prerun %>
start() {
echo -n "Starting $DESC: "
2012-05-14 13:15:05 +00:00
<%= bin %> -P <%= scope.lookupvar('god::pid') %> -l <%= scope.lookupvar('god::log') %>
2012-05-02 22:17:23 +00:00
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
sleep 2
2012-05-14 13:15:05 +00:00
for file in $(find <%= scope.lookupvar('god::dir') %> -name "*.god"); do
echo "$NAME: loading $file ..."
<%= bin %> load $file
done
2012-05-02 22:17:23 +00:00
fi
echo "$NAME."
}
stop() {
echo -n "Stopping $DESC: "
2012-05-14 13:15:05 +00:00
for pid in <%= scope.lookupvar('god::pid') %>; do
if [ -f pid ]; then
kill `cat $pid`
rm $PID
fi
done
2012-05-02 22:17:23 +00:00
2012-05-14 13:15:05 +00:00
killall -9 <%= bin %> || true
echo "$NAME."
2012-05-02 22:17:23 +00:00
}
2012-06-01 18:24:53 +00:00
<%= scope.function_template(['base/init-d-actions']) %>
2012-05-02 22:17:23 +00:00