Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- ### BEGIN INIT INFO
- # Provides: flashpolicyd
- # Required-Start: $remote_fs $syslog
- # Required-Stop: $remote_fs $syslog
- # Should-Start: $network $time
- # Should-Stop: $network $time
- # Default-Start: 2 3 4 5
- # Default-Stop: 0 1 6
- # Short-Description: Start and stop the flash policy server daemon
- # Description: Controls the flash policy server daemon "flashpolicyd"
- ### END INIT INFO
- # Must be a valid filename
- NAME=flashpolicyd
- #/var/run/app must be writable by your user
- PIDFILE=/var/run/app/flashpolicyd.pid
- #This is the command to be run, give the full pathname
- DAEMON="/usr/local/lib/flashpolicyd/flashpolicyd.rb"
- #Daemonization options
- DAEMON_OPTS="--xml flashpolicy.xml --log /usr/local/lib/flashpolicyd/flashpolicyd.log"
- USER=johnny
- case "$1" in
- start)
- echo -n "Starting daemon: "$NAME
- start-stop-daemon --start --quiet --chuid $USER --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS
- echo "."
- ;;
- stop)
- echo -n "Stopping daemon: "$NAME
- start-stop-daemon --stop --quiet --chuid $USER --oknodo --pidfile $PIDFILE
- echo "."
- ;;
- restart)
- echo -n "Restarting daemon: "$NAME
- start-stop-daemon --stop --quiet --chuid $USER --oknodo --retry 30 --pidfile $PIDFILE
- start-stop-daemon --start --quiet --chuid $USER --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS
- echo "."
- ;;
- *)
- echo "Usage: "$1" {start|stop|restart}"
- exit 1
- esac
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement