Skip to content

Instantly share code, notes, and snippets.

@wolfspyre
Forked from gregology/dashboard
Last active August 29, 2015 14:26
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 wolfspyre/2ab796a5ef9dc9bc625a to your computer and use it in GitHub Desktop.
Save wolfspyre/2ab796a5ef9dc9bc625a to your computer and use it in GitHub Desktop.
Service script for dashing. Update DASHING_DIR variable, add this file to /etc/init.d/ , chmod to 755, and let update rc.d with $ sudo update-rc.d dashboard defaults This scripts stops the dashing service with "killall thin" which will kill all thin services running on your server.
#!/bin/bash
# Dashing service
# Add this file to /etc/init.d/
# $ sudo cp dashboard /etc/init.d/
# Update variables DASHING_DIR, GEM_HOME, & PATH to suit your installation
# $ sudo nano /etc/init.d/dashboard
# Make executable
# $ sudo chmod 755 /etc/init.d/dashboard
# Update rc.d
# $ sudo update-rc.d dashboard defaults
# Dashboard will start at boot. Check out the boot log for trouble shooting "/var/log/boot.log"
# USAGE: start|stop|status|logs
### BEGIN INIT INFO
# Provides: dashboard
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
# Gregology <greg@gho.st>
# https://gist.github.com/gregology/5313326
# Based on Faraz Haider's LifeRay Startup Service script
# https://gist.github.com/haiderfaraz/2773431
DASHING_DIR=/path/to/dashboard/
GEM_HOME=/usr/local/lib/ruby/gems/1.9.1
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
case "$1" in
start)
echo "Starting Dashing."
cd $DASHING_DIR; dashing start -d
;;
stop)
echo "Stopping Dashing."
killall thin
;;
logs)
echo "See the logs of the Dashing."
tail -f $DASHING_DIR'log/thin.log'
;;
status)
# Check to see if the process is running
ps aux|grep -i dashing
;;
*)
echo "Dashing"
echo $"Usage: $0 {start|stop|status|logs}"
exit 1
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment