Add new Redis cookbook
This commit is contained in:
19
cookbooks/redisio/templates/default/redis.upstart.conf.erb
Normal file
19
cookbooks/redisio/templates/default/redis.upstart.conf.erb
Normal file
@@ -0,0 +1,19 @@
|
||||
description "Start the redis instance on port <%= @port %>"
|
||||
author "Installed by chef redisio cookbook"
|
||||
|
||||
#start on runlevel [2345]
|
||||
stop on runlevel [06]
|
||||
|
||||
script
|
||||
if [ ! -d <%= @piddir %> ]; then
|
||||
mkdir -p <%= @piddir %>
|
||||
chown <%= @user %>:<%= @group %> <%= @piddir %>
|
||||
fi
|
||||
end script
|
||||
|
||||
# If the job exits, restart it. Give up with more than 10 restarts in 30 seconds.
|
||||
respawn
|
||||
respawn limit 10 30
|
||||
|
||||
exec su -s /bin/sh -c 'exec "$0" "$@"' <%= @user %> <%= File.join(@bin_path, 'redis-server') %> <%= @configdir %>/<%= @name %>.conf
|
||||
|
||||
Reference in New Issue
Block a user