This repo contains some proper working start/stop scripts or damons for a lot of linux distributions or operating systems.
You can find an explanation and instructions in my blog article here:
How to set up proper start/stop services
This provides examples for the following linux distributions (or operating systems):
- Debian and Ubuntu (sysvinit)
- Ubuntu (upstart)
- CentOS 6 (sysvinit)
- Arch Linux (systemd)
- Mac OS X (launchd)
- Gentoo (runscript)
- Windows (nssm)