File tree Expand file tree Collapse file tree 2 files changed +65
-1
lines changed Expand file tree Collapse file tree 2 files changed +65
-1
lines changed Original file line number Diff line number Diff line change @@ -224,7 +224,7 @@ def whyrun_supported?
224224 end
225225
226226 # lsb_init
227- if node [ 'platform' ] == 'debian' || node [ 'platform' ] == 'ubuntu'
227+ if node [ 'platform' ] == 'debian' || node [ 'platform' ] == 'ubuntu' || node [ 'platform' ] == 'amazon'
228228 ruby_block "unlink #{ parsed_lsb_init_dir } /#{ new_resource . service_name } " do
229229 block { ::File . unlink ( "#{ parsed_lsb_init_dir } /#{ new_resource . service_name } " ) }
230230 only_if { ::File . symlink? ( "#{ parsed_lsb_init_dir } /#{ new_resource . service_name } " ) }
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ # ## BEGIN INIT INFO
3+ # Provides: <%= @name %>
4+ # Required-Start:
5+ # Required-Stop:
6+ # Default-Start:
7+ # Default-Stop:
8+ # Short-Description: initscript for runit-managed <%= @name %> service
9+ # ## END INIT INFO
10+
11+ # Author: Chef Software, Inc. <[email protected] >12+
13+ PATH=/sbin:/usr/sbin:/bin:/usr/bin
14+ DESC=" runit-managed <%= @name %>"
15+ NAME=< %= @name %>
16+ RUNIT=< %= @sv_bin %>
17+ RUNIT_ARGS=" <%= @sv_args %>"
18+ SCRIPTNAME=< %= @init_dir %> $NAME
19+
20+ # Exit if runit is not installed
21+ [ -x $RUNIT ] || exit 0
22+
23+ case " $1 " in
24+ start)
25+ $RUNIT $RUNIT_ARGS start $NAME
26+ ;;
27+ stop)
28+ $RUNIT $RUNIT_ARGS stop $NAME
29+ ;;
30+ status)
31+ $RUNIT $RUNIT_ARGS status $NAME && exit 0 || exit $?
32+ ;;
33+ reload)
34+ $RUNIT $RUNIT_ARGS reload $NAME
35+ ;;
36+ force-reload)
37+ $RUNIT $RUNIT_ARGS force-reload $NAME
38+ ;;
39+ force-stop)
40+ $RUNIT $RUNIT_ARGS force-stop $NAME
41+ ;;
42+ force-restart)
43+ $RUNIT $RUNIT_ARGS force-restart $NAME
44+ ;;
45+ force-shutdown)
46+ $RUNIT $RUNIT_ARGS force-shutdown $NAME
47+ ;;
48+ restart)
49+ $RUNIT $RUNIT_ARGS restart $NAME
50+ ;;
51+ shutdown)
52+ $RUNIT $RUNIT_ARGS shutdown $NAME
53+ ;;
54+ try-restart)
55+ $RUNIT $RUNIT_ARGS try-restart $NAME
56+ ;;
57+ * )
58+ echo " Usage: $SCRIPTNAME {start|stop|status|reload|force-reload|force-restart|force-shutdown|force-stop|restart|shutdown|try-restart}" >&2
59+ exit 3
60+ ;;
61+ esac
62+
63+ :
64+
You can’t perform that action at this time.
0 commit comments