Initial Chef repository
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Author: Jamie Winsor (<jamie@vialstudios.com>)
|
||||
#
|
||||
# chkconfig: 345 99 1
|
||||
# Description: Bluepill loader for <%= @service_name %>
|
||||
# Provides: <%= @service_name %>
|
||||
# Default-Start: 3 4 5
|
||||
# Default-Stop: 0 1 2 6
|
||||
|
||||
BLUEPILL_BIN=<%= node['bluepill']['bin'] %>
|
||||
BLUEPILL_CONFIG=<%= @config_file %>
|
||||
SERVICE_NAME=<%= @service_name %>
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo "Loading bluepill configuration for $SERVICE_NAME "
|
||||
$BLUEPILL_BIN load $BLUEPILL_CONFIG
|
||||
;;
|
||||
stop)
|
||||
$BLUEPILL_BIN $SERVICE_NAME stop
|
||||
$BLUEPILL_BIN $SERVICE_NAME quit
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
##
|
||||
# PROVIDE: named
|
||||
# REQUIRE: SERVERS cleanvar
|
||||
# KEYWORD: shutdown
|
||||
#
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="<%= @service_name %>"
|
||||
rcvar=`set_rcvar`
|
||||
|
||||
# Set some defaults
|
||||
<%= @service_name %>_enable=${<%= @service_name %>_enable:-"NO"}
|
||||
|
||||
pidfile="/var/run/<%= @service_name %>.pid"
|
||||
command="/usr/local/bin/bluepill"
|
||||
|
||||
start_precmd="${command} load <%= node['bluepill']['conf_dir'] %>/<%= @service_name %>.pill"
|
||||
start_cmd="${command} ${name} start"
|
||||
|
||||
status_cmd="${command} ${name} status"
|
||||
|
||||
stop_cmd="${command} ${name} stop"
|
||||
stop_postcmd="${command} ${name} quit"
|
||||
|
||||
load_rc_config ${name}
|
||||
|
||||
PATH="${PATH}:/usr/local/bin"
|
||||
|
||||
run_rc_command "$1"
|
||||
34
cookbooks/bluepill/templates/default/bluepill_init.lsb.erb
Normal file
34
cookbooks/bluepill/templates/default/bluepill_init.lsb.erb
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: <%= @service_name %>
|
||||
# Required-Start: bar
|
||||
# Defalt-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 2 6
|
||||
# Description: Bluepill loader for <%= @service_name %>
|
||||
### END INIT INFO
|
||||
|
||||
BLUEPILL_BIN=<%= node['bluepill']['bin'] %>
|
||||
BLUEPILL_CONFIG=<%= @config_file %>
|
||||
SERVICE_NAME=<%= @service_name %>
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo "Loading bluepill configuration for $SERVICE_NAME "
|
||||
$BLUEPILL_BIN load $BLUEPILL_CONFIG
|
||||
;;
|
||||
stop)
|
||||
$BLUEPILL_BIN $SERVICE_NAME stop
|
||||
$BLUEPILL_BIN $SERVICE_NAME quit
|
||||
;;
|
||||
restart)
|
||||
$BLUEPILL_BIN $SERVICE_NAME restart
|
||||
;;
|
||||
status)
|
||||
$BLUEPILL_BIN $SERVICE_NAME status
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
32
cookbooks/bluepill/templates/default/bluepill_init.rhel.erb
Normal file
32
cookbooks/bluepill/templates/default/bluepill_init.rhel.erb
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Author: Jamie Winsor (<jamie@vialstudios.com>)
|
||||
#
|
||||
# chkconfig: 345 99 1
|
||||
# Description: Bluepill loader for <%= @service_name %>
|
||||
# Provides: <%= @service_name %>
|
||||
# Default-Start: 3 4 5
|
||||
# Default-Stop: 0 1 2 6
|
||||
|
||||
BLUEPILL_BIN=<%= node['bluepill']['bin'] %>
|
||||
BLUEPILL_CONFIG=<%= @config_file %>
|
||||
SERVICE_NAME=<%= @service_name %>
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo "Loading bluepill configuration for $SERVICE_NAME "
|
||||
$BLUEPILL_BIN load $BLUEPILL_CONFIG
|
||||
;;
|
||||
stop)
|
||||
$BLUEPILL_BIN $SERVICE_NAME stop
|
||||
$BLUEPILL_BIN $SERVICE_NAME quit
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1 @@
|
||||
local6.* <%= node["bluepill"]["logfile"] %>
|
||||
Reference in New Issue
Block a user