I Can Haz Init Script
devo.ps
devo.ps
#!/bin/sh
# chkconfig: 2345 90 10
# description: The magical daemon
. /etc/init.d/daemon-functions
init_daemon "$1" /usr/bin/magic-daemonOn Gentoo, you would just create /etc/conf.d/memcached.xxx and then symlink /etc/init.d/memcached.xxx to /etc/init.d/memcached.
Relevant ChangeLog entry:
14 Jan 2005; Lisa Seelye <lisa@gentoo.org>
+metadata.xml, +files/1.1.12/conf, +files/1.1.12/init, +memcached-1.1.12_rc1.ebuild:
Add 1.1.12-rc1 and retool the conf/init scripts to take advantage of the new
-P (pidfile) option. The default behavior is to save the pidfile in
/var/run/memcached/memcached-PORT.pid. This, it seems would make it easier
for people to have multiple instances of memcached running (simply rename
/etc/init.d/memcached to /etc/init.d/memcached.instance and the conf.d file
accordingly.Losing a server to a rogue process for whatever reason used to be a big deal. Sometimes you even set resource limits...
I added similar functionality to Gunicorn (where multiple gunicorn workers per physical machine is a rather common requirement).
At the same time all init script are not suitable upstream; keeping the balance between simplicity and features is a hard one. Not every use would require a 10 foot long scripts that cover some awkward features that is seen in 1% of the cases - yet having a repository of capable init scripts seems a good way to mitigate the issue.