For minit, everything is a service, which should either be started
once or respawned. Minit expects its configuration in the
/etc/minit directory.
Minit searches for a file called "`depends"' in the subdirectory
default. This file tells minit what services should be started
by default (in fact it tells minit that the service default
depends on other services, but "`default"' is the directory minit starts
to search in).
A typical default/depends file looks like that:
scice% cat default/depends
mount
network
local-tuning
local-services
remote-services
getty
Minit now goes parallel to the directories mount, network, etc.
Those directories can either include "`depends"' files again, or
if no dependency exists, a "'run"' file. Let us have a look into the directory
"'getty"':
scice% ls -l getty/
total 4
drwxr-x--- 2 nico nico 43 Dec 9 2003 1
drwxr-x--- 2 nico nico 43 Dec 9 2003 2
drwxr-x--- 2 nico nico 43 Dec 9 2003 3
drwxr-x--- 2 nico nico 43 Dec 9 2003 4
drwxr-x--- 2 nico nico 43 Dec 9 2003 5
drwxr-x--- 2 nico nico 43 Dec 9 2003 6
drwxr-x--- 2 nico nico 43 Dec 9 2003 7
drwxr-x--- 2 nico nico 43 Dec 9 2003 8
-rw-r----- 1 nico nico 81 Feb 24 2004 depends
scice% cat getty/depends
network/hostname
getty/1
getty/2
getty/3
getty/4
getty/5
getty/6
getty/7
getty/8
So getty itself depends on other services (which can depend
on other services, too).
The directory "`getty/1"' has no dependencies,
but the three files "`param"', "`respawn"' and "'run"':
scice% ls -l getty/1
total 4
-rw-r----- 1 nico nico 20 Dec 9 2003 params
-rw-r----- 1 nico nico 0 Dec 9 2003 respawn
lrwxrwxrwx 1 nico nico 12 Aug 25 08:08 run -> /sbin/fgetty
scice% cat getty/1/params
/dev/vc/1
--noclear
run is the program minit should run, when starting this service.
params contains the paramaters passed to the program. One parameter on
each line. And the existence of the zero-sized file
respawn tells minit to restart the service when it exits.
nico
2004-10-13