Você pode usar arquivos em /etc/init
como modelos. Por exemplo, isso é /etc/init/mountall-net.conf
:
# mountall-net - Mount network filesystems
#
# Send mountall the USR1 signal to inform it to try network filesystems
# again.
description "Mount network filesystems"
start on net-device-up
task
script
PID=$(status mountall 2>/dev/null | sed -e '/,/{s/.*,[^0-9]*//;q};d')
[ -n "$PID" ] && kill -USR1 $PID || true
end script
e este é o '/etc/init/ufw.conf':
# ufw - Uncomplicated Firewall
#
# The Uncomplicated Firewall is a front-end for iptables, to make managing a
# Netfilter firewall easier.
description "Uncomplicated firewall"
start on net-device-added INTERFACE=lo
stop on runlevel [!023456]
console output
pre-start exec /lib/ufw/ufw-init start quiet
post-stop exec /lib/ufw/ufw-init stop
O último arquivo tem um link simbólico em /etc/init.d
:
$ ls -l /etc/init.d/ufw
lrwxrwxrwx 1 root root 21 2009-11-05 00:14 /etc/init.d/ufw -> /lib/init/upstart-job