Skip to content

Instantly share code, notes, and snippets.

@preaction
Created May 16, 2012 07:53
Show Gist options
  • Select an option

  • Save preaction/2708470 to your computer and use it in GitHub Desktop.

Select an option

Save preaction/2708470 to your computer and use it in GitHub Desktop.
A SysV-style init/rc script for Plackup
#!/bin/sh
# A basic plackup script
NAME=RT
PLACKUP=rt-server
USER=rt
PID_FILE=/tmp/rt-server.pid
case $1 in
start)
echo -n "Starting $NAME"
$PLACKUP --user $USER --server Starman --pid $PID_FILE -D
echo
;;
stop)
echo -n "Stopping $NAME"
if [ -e "$PID_FILE" ]
then
cat $PID_FILE | xargs kill $PIDS
echo
else
echo $NAME not running
fi
;;
restart|force-reload)
$0 stop
$0 start
;;
*)
echo "Usage: $0 { stop | start | restart }"
exit 1
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment