diff options
author | Carlo Landmeter <clandmeter@gmail.com> | 2012-12-06 18:50:10 +0100 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2012-12-06 18:54:26 +0100 |
commit | 31ac7d0b6e5e817a9099399764d84f40c81caad8 (patch) | |
tree | 84fa3e62c69474a96688db257f1516739e879f46 /main/ruby-unicorn/unicorn.initd | |
parent | 3b6ebba9ab54d866dbcef646b5170ab2534ee86f (diff) | |
download | aports-31ac7d0b6e5e817a9099399764d84f40c81caad8.tar.bz2 aports-31ac7d0b6e5e817a9099399764d84f40c81caad8.tar.xz |
main/ruby-unicorn: add init and default redmine config
Diffstat (limited to 'main/ruby-unicorn/unicorn.initd')
-rw-r--r-- | main/ruby-unicorn/unicorn.initd | 44 |
1 files changed, 44 insertions, 0 deletions
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 +} |