diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2016-04-29 08:04:05 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2016-04-29 12:36:41 +0000 |
commit | b951abfe754edd478b0a17f12cad5fb56e42eee1 (patch) | |
tree | e71d1359aad8863964935b6d374f6e97b715dbde /unmaintained/ruby-unicorn/unicorn.initd | |
parent | 966bc7207f72795a226a704782b524c2b2fbefb3 (diff) | |
download | aports-b951abfe754edd478b0a17f12cad5fb56e42eee1.tar.bz2 aports-b951abfe754edd478b0a17f12cad5fb56e42eee1.tar.xz |
move main/ruby-* to unmaintained
Diffstat (limited to 'unmaintained/ruby-unicorn/unicorn.initd')
-rw-r--r-- | unmaintained/ruby-unicorn/unicorn.initd | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/unmaintained/ruby-unicorn/unicorn.initd b/unmaintained/ruby-unicorn/unicorn.initd new file mode 100644 index 0000000000..daa4fa47a5 --- /dev/null +++ b/unmaintained/ruby-unicorn/unicorn.initd @@ -0,0 +1,44 @@ +#!/sbin/openrc-run + +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 +} |