Last active
December 24, 2015 06:09
-
-
Save rla/6755126 to your computer and use it in GitHub Desktop.
Redmine (Thin server) init script for Debian.
Assumes that Thin is installed into the user's home directory.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: redmine | |
# Required-Start: $local_fs $remote_fs $network $syslog $named $mysql | |
# Required-Stop: $local_fs $remote_fs $network $syslog $named $mysql | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start/stop Redmine | |
### END INIT INFO | |
dir=/home/redmine | |
user=redmine | |
config=/home/redmine/thin.yml | |
case "$1" in | |
'start') | |
cd $dir | |
sudo -u $user $dir/bin/thin -C $config start | |
;; | |
'restart') | |
cd $dir | |
sudo -u $user $dir/bin/thin -C $config restart | |
;; | |
'stop') | |
cd $dir | |
sudo -u $user $dir/bin/thin -C $config stop | |
;; | |
*) | |
echo "Usage: $0 { start | restart | stop }" | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment