Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- HOME=/root/musicbrainz-server
- LOG=/root/musicbrainz-server/musicbrainzstartup.log
- PIDFILE=$HOME/fcgi.pid
- SOCKET=/tmp/fcgi.sock.musicbrainz.psgi
- NPROC=5
- cd $HOME
- case "$1" in
- start)
- if [ -f "${PIDFILE}" ]; then
- echo "${PIDFILE}" exists. Is the server already running?
- exit 1
- fi
- exec plackup -Ilib -s FCGI -E deployment --listen $SOCKET --nproc $NPROC --pid fcgi.pid --keep-stderr=1 >> $LOG 2>&1 &PID=$!
- echo $PID > "${PIDFILE}"
- echo "Server started with PID=$PID"
- ;;
- stop)
- if [ -f "${PIDFILE}" ]; then
- PID=$(cat "${PIDFILE}")
- kill $PID
- rm "${PIDFILE}"
- echo "Server stopped."
- else
- echo "Can't find ${PIDFILE}. Is the server running?"
- fi
- ;;
- hourly)
- exec -- ./admin/replication/LoadReplicationChanges >> $LOG/hourly.log 2>&1
- ;;
- daily)
- #exec -- ./admin/cron/daily.sh >> $LOG/daily.log 2>&1
- ;;
- weekly)
- #exec -- ./admin/cron/weekly.sh >> $LOG/weekly.log 2>&1
- ;;
- *)
- echo $"Usage: $0 {start|stop|hourly|daily|weekly}"
- exit 1
- esac
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement