Skip to content

Instantly share code, notes, and snippets.

@Seraf
Created April 14, 2014 09:04
Show Gist options
  • Save Seraf/10630083 to your computer and use it in GitHub Desktop.
Save Seraf/10630083 to your computer and use it in GitHub Desktop.
LISA Server Daemon
#! /bin/sh
### BEGIN INIT INFO
# Provides: lisa-server
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop Lisa server
### END INIT INFO
logger "Lisa Server: Start script executed"
case "$1" in
start)
logger "Lisa Server: Starting"
echo "Starting Lisa Server..."
twistd -y lisa-server --logfile="/var/log/lisa/server/lisa.log" --pidfile="/var/run/lisa/server.pid --static=/var/lib/lisa/server/static --plugins=/var/lib/lisa/server/plugins"
;;
stop)
logger "Lisa Server: Stopping"
echo "Stopping Lisa server..."
kill `cat /var/run/lisa/server.pid`
;;
*)
logger "Lisa server: Invalid usage"
echo "Usage: /etc/init.d/lisa-server {start|stop}"
exit 1
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment