Monday, August 1, 2011

Create simple Ubuntu(Debian?) start up script

- Create a file at /etc/init.d/<filename>
#!/bin/bash

case "${1:-''}" in
'start')
# put the command to start
;;
'stop')
# stop command here
;;
'restart')
# restart command here
;;
*)
echo "Usage: $SELF start|stop|restart"
exit 1
;;
esac


sudo update-rc.d <filename> defaults


sudo /etc/init.d/<filename> <start|stop|restart>


- To remove
sudo rm /etc/rc*/*<filename>


Credit: Ivan in How do I make sphinx restart when I reboot my Ubuntu server?

No comments:

Collectd PostgreSQL Plugin

I couldn't find this link when searching with google https://www.collectd.org/documentation/manpages/collectd.conf.html#plugin-postgresql