Skip to content

Instantly share code, notes, and snippets.

@rla
Last active December 24, 2015 06:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rla/6755126 to your computer and use it in GitHub Desktop.
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.
#!/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