summaryrefslogtreecommitdiffstats
path: root/main/ruby-redmine-unicorn/unicorn.initd
diff options
context:
space:
mode:
Diffstat (limited to 'main/ruby-redmine-unicorn/unicorn.initd')
-rw-r--r--main/ruby-redmine-unicorn/unicorn.initd44
1 files changed, 44 insertions, 0 deletions
diff --git a/main/ruby-redmine-unicorn/unicorn.initd b/main/ruby-redmine-unicorn/unicorn.initd
new file mode 100644
index 000000000..228023cd3
--- /dev/null
+++ b/main/ruby-redmine-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
+}