You can start services also from ninit's command line. For example if you add to lilo/grub
init=/sbin/ninit srv1 srv2then ninit starts srv1 and srv2 instead of default.
See also
in,
out and
log/.
Please, see
daemontools
for a very good logging tool.
The files depends, params, environ, wait, soflimit, pidfile can be creted with echo or a text editor like vi/emacs. See also here. The program ninit-service displays a service dir nice.
test -d srv && ln -s srv srv_double nsvc -u srv nsvc -u srv_double nsvc -LWhat happen? Both are running :-)
ls -l /etc/dnscache -rw-r--r-- root root 8 Jan 18 2007 depends -rw-r--r-- root root 131 Jan 17 2007 environ lrwxrwxrwx root root 18 Jan 18 2007 in -> /etc/dnscache/seed@ lrwxrwxrwx root root 12 Dec 20 2006 out -> ../logger/in@ -rw-r--r-- root root 0 Dec 21 2006 respawn lrwxrwxrwx root root 23 Jan 17 2007 run -> /usr/local/bin/dnscache@ -rw-r--r-- root root 32 May 20 23:55 softlimit
cat /etc/ninit/dnscache/depends tynydns
cat /etc/ninit/dnscache/environ UID=208 GID=502 ROOT=/etc/dnscache/root IP=127.0.0.1 IPSEND=0.0.0.0 CACHESIZE=286600 DUMPCACHE=7200:dump/data SLURPCACHE=dump/data
cat /etc/ninit/dnscache/softlimit o250 m1500000 d3000000 f1000000The variable DUMPCACHE is defined in my djbdns-dumpcache patch.
sed -e '/getty/s/^/T/' /etc/inittab > /tmp/inittab ninit-inittab /tmp/inittab /etc/ninit /tmp/ninit.sh /tmp/ninit.shThen your services for gettys will be _T1,_T2,_T3,_T4,_T5,_T6.
Similarly you can edit first a copy of /etc/inittab and obtain a shell script creating services. You can copy/exec only parts of the output script.
See also
here for some
network services. The greatest rule is
here!