|
ninit uses minimal resources (arch: i386; kernel: 2.4.37):
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.0 8 8 ? S Oct08 0:03 /sbin/ninit text data bss dec hex filename 3642 20 56 3718 e86 /sbin/ninit
bzip2 -dc ninit-0.14.tar.bz2 | tar -xvf - cd ninit-0.14 Case-A: If you have dietlibc already working do: $ make withdiet; make tests # make install Case-B: If you do not have dietlibc do: $ make dietbuild; make tests # make installTo compile ninit with glibc do:
$ make nodiet; make tests # make installOnly make install must be started as root! Other install instructions are here. You can type also make strip before make install. The distributions should read this warning.
Case B. If you already have
minit running do
simply:
cd /etc && cp -p -R minit/* ninit
Case C. If your default init is /sbin/init it's also
easy.
I wrote a simple converter
ninit-inittab.
Try it with:
/sbin/ninit-inittab /etc/inittab /etc/ninit /tmp/ninit.sh /tmp/ninit.shLast two commands are equivalent to:
make ser_vi_ces
You can test the new executable (before make install) also with:
/sbin/ninit-reload -v -u /path/to/new/ninit cp /path/to/new/ninit /sbin cp /path/to/new/ninit-reload /sbin /sbin/ninit-reload -v -u /sbin/ninit
Ninit searches for a file called depends in the subdirectory default. This file tells ninit which services should be started by default (in fact it tells ninit that the service default depends on other services, but default is the directory ninit starts to search in). Instead of the file default/depends it is possible to start services with ninit-scan.
Ninit doesn't start services alone. It uses the helper program /etc/ninit/sys/run to start a service. On this way ninit doesn't parse the service instructions in the corresponding directory. This keeps ninit small and it's easy to change /etc/ninit/sys/run.
There is a companion utility /bin/nsvc that can be used much in the same way as the svc from daemontools. Communication works over two fifos, /etc/ninit/{in|out}. Those have to exist before ninit is started and they should be owned by root and have mode 600.
While sys/run is the main
ninit helper,
there are
also four auxiliary helpers
ninit-pidfile,
pututmpid,
ninit-runlevel and
ninit-sysvinit
used to start services.
The converter
ninit-inittab
can
usually create these services for you. If they are still missing, the
last choice is to use the program
ninit-shutdown,
or alternatively
the SysVinit programs shutdown, reboot, halt.
Other problems with halt are described
here..
Last modified: Feb 11 2010
Shutdown and reboot
On a box running
ninit as process no 1 it is better to avoid using the SysVinit
programs shutdown, reboot, and halt. First, check the directory
/etc/ninit. Assuming you have the services
{_l0|halt} and
{_l6|reboot}, you can try
nsvc -o halt
nsvc -o reboot
If you have service ctrlaltdel then
CTRL-ALT-DELETE halts the hox.
Future
See also
Here are the package README
and CHANGES.
Almost all for minit is true for ninit also.
Other related links.
Author: Nikola Vladov
If you like ninit, try also my
ngetty - single daemon for all virtual consoles.
Send comments and suggestions using ninit
mailing-list or
qform.
WARNING:
ninit is tested only on i386 and x86_64 arch.