as I somehow managed it to kill the Subsonic server several times by accessing it via Flash player remotely, I wanted it to restart automatically.
Pragmatical solution: add the following line to /etc/crontab
- Code: Select all
@reboot yourusername while /bin/true; do if ! pgrep -f '[j]ava.*subsonic' >/dev/null; then /usr/local/bin/subsonic/subsonic.sh --quiet; echo "Subsonic started..."|mail -s "Subsonic daemon (re)started" youremail@address.here; fi; sleep 15; done
Pros:
- - no initscript needed
- automatically starts Subsonic after reboot
- automatically restarts Subsonic after crash
- email notification about Subsonic restart
- - unusual way for daemon start
- you have to add all possible options on one line, that may be confusing as it get long enough
HTH,
/DemoFreak