Skip to content

Instantly share code, notes, and snippets.

@cuixin
Created September 23, 2014 05:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cuixin/3ff2091f8f4727376a8d to your computer and use it in GitHub Desktop.
Save cuixin/3ff2091f8f4727376a8d to your computer and use it in GitHub Desktop.
ssdb service script
#!/bin/sh
# ssdb service by Steven
# put this file in /etc/init.d/ssdb
# sudo update-rc.d ssdb defaults
start(){
echo "start ssdb"
/usr/local/ssdb/ssdb-server -d /usr/local/ssdb/ssdb.conf
exit 0
}
stop(){
echo "stop ssdb"
kill `cat /usr/local/ssdb/var/ssdb.pid`
}
restart(){
echo "restart ssdb"
stop
sleep 0.5
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo "usage:$0 start|stop|restart"
exit 0;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment