daily pastebin goal
81%
SHARE
TWEET

Untitled

a guest Aug 9th, 2012 9 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. #
  3. ### BEGIN INIT INFO
  4. # Provides: flashpolicyd
  5. # Required-Start: $remote_fs $syslog
  6. # Required-Stop: $remote_fs $syslog
  7. # Should-Start: $network $time
  8. # Should-Stop: $network $time
  9. # Default-Start: 2 3 4 5
  10. # Default-Stop: 0 1 6
  11. # Short-Description: Start and stop the flash policy server daemon
  12. # Description: Controls the flash policy server daemon "flashpolicyd"
  13. ### END INIT INFO
  14.  
  15. # Must be a valid filename
  16. NAME=flashpolicyd
  17. #/var/run/app must be writable by your user
  18. PIDFILE=/var/run/app/flashpolicyd.pid
  19. #This is the command to be run, give the full pathname
  20. DAEMON="/usr/local/lib/flashpolicyd/flashpolicyd.rb"
  21. #Daemonization options
  22. DAEMON_OPTS="--xml flashpolicy.xml --log /var/log/flashpolicyd.log"
  23. USER=johnny
  24.  
  25. case "$1" in
  26.   start)
  27.         echo -n "Starting daemon: "$NAME
  28.         start-stop-daemon --start --quiet --chuid $USER --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS
  29.         echo "."
  30.         ;;
  31.   stop)
  32.         echo -n "Stopping daemon: "$NAME
  33.         start-stop-daemon --stop --quiet --chuid $USER --oknodo --pidfile $PIDFILE
  34.         echo "."
  35.         ;;
  36.   restart)
  37.         echo -n "Restarting daemon: "$NAME
  38.         start-stop-daemon --stop --quiet --chuid $USER --oknodo --retry 30 --pidfile $PIDFILE
  39.         start-stop-daemon --start --quiet --chuid $USER --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS
  40.         echo "."
  41.         ;;
  42.  
  43.   *)
  44.         echo "Usage: "$1" {start|stop|restart}"
  45.         exit 1
  46. esac
  47.  
  48. exit 0
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top