From 31ac7d0b6e5e817a9099399764d84f40c81caad8 Mon Sep 17 00:00:00 2001 From: Carlo Landmeter Date: Thu, 6 Dec 2012 18:50:10 +0100 Subject: main/ruby-unicorn: add init and default redmine config --- main/ruby-unicorn/unicorn.initd | 44 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 main/ruby-unicorn/unicorn.initd (limited to 'main/ruby-unicorn/unicorn.initd') diff --git a/main/ruby-unicorn/unicorn.initd b/main/ruby-unicorn/unicorn.initd new file mode 100644 index 0000000000..228023cd38 --- /dev/null +++ b/main/ruby-unicorn/unicorn.initd @@ -0,0 +1,44 @@ +#!/sbin/runscript + +gem_path=$(gem env gemdir) +name="unicorn_rails" +start_script="$gem_path/bin/$name" + +depend() { + use logger dns + need net + after firewall +} + +start() { + checkconfig || return 1 + + ebegin "Starting unicorn" + start-stop-daemon --start --quiet \ + $start_script -- \ + -D -E $ENV -c $CONF + eend $? +} + +stop() { + ebegin "Stopping unicorn" + start-stop-daemon --stop \ + --name $name + eend $? + sleep 1 +} + + +reload() { + ebegin "Reload unicorn" + start-stop-daemon --signal USR2 \ + --name $name + eend $? +} + +checkconfig() { + if [ -z "$CONF" ]; then + eerror "No configuration file set in confd!" + return 1 + fi +} -- cgit v1.2.3