Linux standalone startup (alternative way)
Posted: Sat Oct 02, 2010 12:42 pm
Hi,
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
Pros:
HTH,
/DemoFreak
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