0
I usually just copy some existing script like /etc/init.d/ssh
, remove extra things and edit remaining things. This is not very convenient.
Is there a simple tool to create good Debian initscripts?
Expecting something like this:
r@l:~# generate_initscript ololo \
--start-command='daemon --name ololo /usr/bin/ololo' \
--stop-command='daemon --name ololo --stop' > /etc/init.d/ololo
r@l:~# cat /etc/init.d/ololo
#! /bin/sh
### BEGIN INIT INFO
# Provides: ololo
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: 'ololo' script created by generate_initscript
### END INIT INFO
set -e
. /lib/lsb/init-functions
case "$1" in
start)
daemon --name ololo /usr/bin/ololo
;;
stop)
daemon --name ololo --stop
;;
*)
echo "Usage: /etc/init.d/ololo {start|stop}"
exit 1
esac
exit 0
1
Maybe MetaInit is worth mentioning too: https://wiki.debian.org/MetaInit or https://packages.debian.org/jessie/metainit
– mivk – 2015-06-12T17:09:33.127