Guest User

Untitled

a guest
Jul 13th, 2015
50
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. HOME=/root/musicbrainz-server
  3. LOG=/root/musicbrainz-server/musicbrainzstartup.log
  4. PIDFILE=$HOME/fcgi.pid
  5. SOCKET=/tmp/fcgi.sock.musicbrainz.psgi
  6. NPROC=5
  7. cd $HOME
  8. case "$1" in
  9. start)
  10. if [ -f "${PIDFILE}" ]; then
  11. echo "${PIDFILE}" exists. Is the server already running?
  12. exit 1
  13. fi
  14. exec plackup -Ilib -s FCGI -E deployment --listen $SOCKET --nproc $NPROC --pid fcgi.pid --keep-stderr=1 >> $LOG 2>&1 &PID=$!
  15. echo $PID > "${PIDFILE}"
  16. echo "Server started with PID=$PID"
  17. ;;
  18. stop)
  19. if [ -f "${PIDFILE}" ]; then
  20. PID=$(cat "${PIDFILE}")
  21. kill $PID
  22. rm "${PIDFILE}"
  23. echo "Server stopped."
  24. else
  25. echo "Can't find ${PIDFILE}. Is the server running?"
  26. fi
  27. ;;
  28. hourly)
  29. exec -- ./admin/replication/LoadReplicationChanges >> $LOG/hourly.log 2>&1
  30. ;;
  31. daily)
  32.  
  33. #exec -- ./admin/cron/daily.sh >> $LOG/daily.log 2>&1
  34. ;;
  35.  
  36.  
  37. weekly)
  38. #exec -- ./admin/cron/weekly.sh >> $LOG/weekly.log 2>&1
  39. ;;
  40. *)
  41. echo $"Usage: $0 {start|stop|hourly|daily|weekly}"
  42. exit 1
  43. esac
  44.  
  45. exit 0
RAW Paste Data