About
To compile this, you need to have libowfat (http://www.fefe.de/libowfat/)!
Each service gets its own directory under /etc/minit (change this in the
source, it's a #define right at the start of minit.h).
Each service directory can contain the following files/symlinks:
depends
a plain text file containing a service name per line.
Example: /etc/minit/sshd/depends could contain "network".
Each of these services will be started before this service is
started. If you need to wait for static initializations to
complete, use the sync flag.
run
a symbolic link to the program name. No hard link, because argv[0]
for the programs is created by extracting the part after the last
slash in the contents of the symbolic link.
Example: "/usr/bin/sshd" would be run with argv[0]="sshd".
params
a plain text file containing command line parameters for the
service, one parameter per line. No shell expansion is done. If
you need shell expansion, have run point to a shell script instead
of the real daemon. Note: Have the shell script exec the daemon
instead of simply running it to save system ressources.
respawn
touch this file to make minit respawn the process when it dies.
This should be touched for getty and network servers.
sync
touch this file to make minit wait until the service ends. sync is
mutually exclusive with respawn. This is meant for static
initializations like "ifconfig".
log
if this directory exists, it is taken as service and minit creates
a pipe between stdout of this service and stdin of the log service.
If the log service can not be started, this service will block if it
writes to stdout. File descriptors will be reused, i.e. if the log
process dies and is restarted, no log entries will be lost and there
will be no SIGPIPE.
nice
a plain text file containing the value to add to the nice level via the
nice systemcall.
in
this file is used for stdin.
out
this file is used for stdout and stderr.
e.g. a symlink to /dev/null
Please see http://cr.yp.to/daemontools/multilog.html for a very good
logging tool.
minit will try to run the command line arguments as services. The
kernel passes its arguments to init. That means you can for example
have a service /etc/minit/sos-shell that starts a /bin/sh and then use
LILO to boot "bzImage sos-shell". minit will then run that service.
If none of the services worked (or none were given), minit will spawn
the service "default". The normal way to configure minit is to have
default be an empty service and just list all the services you want
minit to start at boot time in default/depends.
Other special services (besides "default") are "ctrlaltdel" and "kbreq".
ctrlaltdel will be run when the console user presses ctrl-alt-del and is
meant to reboot the computer. kbreq is the keyboard request, which
can be mapped using loadkeys. On my box, it is on Alt+Arrow-Up. I use
it to shut down the computer.