unix/fiss-minit

minit.8 in master
Repositories | Summary | Log | Files | README | COPYING

minit.8 (4875B) download


  1.TH minit 8
  2.SH NAME
  3minit \- a UNIX process no 1
  4.SH SYNOPSIS
  5.B minit
  6
  7.SH DESCRIPTION
  8.B minit
  9is a possible first process the kernel starts.
 10
 11to use minit as system init, first read available documentation in 
 12.I /usr/share/doc/minit
 13and then add the parameter 
 14\fIinit=/sbin/minit\fR
 15to your kernel command line.
 16
 17.I lilo
 18users need to add it to the \fIappend="something"\fR
 19option in \fI/etc/lilo.conf\fR,
 20
 21.I grub
 22users can just append it to their "\fIkernel\fR image options" lines.
 23
 24Or, of course, you can just call the binary /sbin/init, which is the
 25default name the kernel starts when no kernel options are given.
 26
 27.SH USAGE
 28minit will by default start the minit service called "default".  If
 29command line arguments are present, those are started instead of
 30"default".
 31
 32It is possible to blacklist a service that is normally started by
 33passing its name with a - in front of it.  Example: default depends on
 34init, init depends on loadgfxdriver, loadgfxdriver hangs the kernel in
 35your kernel version so you want to boot without running it.  Then you
 36could use grub to pass the additional kernel arguments "default
 37-loadgfxdriver" to minit.  Minit would then run default and all its
 38dependencies except loadgfxdriver.
 39
 40If the last service exits, minit will terminate.
 41
 42In case of catastrophic failure (for example if /etc/minit does not
 43exist), minit will attempt to execute /sbin/sulogin.  A careful admin
 44will put some kind of emergency login command and shell there to provide
 45a way to hopefully be able to recover from partially corrupted boot
 46media or botched minit installations.
 47
 48.SH SERVICES
 49minit services are defined in /etc/minit/[servicename]/ .  When a service
 50is started, minit changes into that directory, and reads the text file
 51"depends".  Every line in that file is interpreted as the name of a
 52service and launched recursively like this.  Finally, the file "run" is
 53executed.  This is usually a symbolic link to a binary.
 54
 55If the file "params" exists, each line is passed as a command line
 56argument to the service binary.  There is currently no way to pass
 57command line arguments containing newline characters using this
 58mechanism.  You would have to make run a shell script to do that.
 59
 60All services are launched asynchronously, unless the service directory
 61contains a file called "sync".  If that file exists, minit blocks until
 62the service finishes.  This is meant for things that need to be
 63completed before anything else can occur in the boot process, for
 64example mounting /usr or /proc.  Warning: minit will block when
 65executing sync services, potentially leading to a deadlocked system.
 66minit will also not respond to msvc while waiting for a sync service to
 67commence.
 68
 69If a subdirectory called "log" exists, it is interpreted as a minit
 70service, too, and its standard input is connected via a pipe to the
 71standard output of the service.  This is meant to be used with tools
 72like multilog from the daemontools, see http://cr.yp.to/daemontools.html
 73
 74It is possible to provide data on stdin to a process by putting it into
 75a file (or fifo) called "in" in the service directory.  Likewise, if a
 76file or fifo called "out" exists, stdout and stderr of the service will
 77be redirected there.
 78
 79If a file called "nice" exists, its contents is interpreted as an
 80integer and passed as argument to nice(2).
 81
 82If run is a symbolic link, minit will adjust argv[0] to the name
 83part of it so programs like ps(1) and top(1) display the right name
 84instead of "run".
 85
 86If a file called "respawn" exists, minit will restart the service should
 87it ever exit.  The default is not to respawn, because in typical
 88scenarios most minit services are actually boot time housekeeping and
 89initialization processes and not actual services that are expected to
 90run for prolonged periods of time.
 91
 92If a symbolic link called "root" exists, minit will chdir there before
 93running the service.
 94
 95.SH "CONVERTING A DAEMON INTO A SERVICE"
 96
 97The concept of minit works around long running service processes that do
 98not terminate.  If they do terminate, it is because of some unexpected
 99failure or programming mistake and minit is expected to restart them.
100
101Unfortunately, most unix services are written as daemons.  When run from
102a shell, they fork into the background and return immediately.  In order
103for minit to be able to detect when those services abort, and to restart
104them if needed, minit needs to know the PID the service is running
105under.
106
107Most services have some way of turning off forking into the background.
108However, if the particular service does not have a way, pidfilehack can
109often be used.
110
111.SH AUTHOR
112minit was written by Felix von Leitner and can be downloaded from
113his page at
114.I http://www.fefe.de/minit/
115
116This manpage was written by Erich Schubert <[email protected]>
117for the Debian GNU/Linux operating system.
118
119.SH "SEE ALSO"
120msvc(8), serdo(8), pidfilehack(8)