1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
ninit-sysvinit(8) ninit-sysvinit(8)
NAME
ninit-sysvinit - SysVinit emulator listening on /dev/initctl
SYNOPSIS
ninit-sysvinit
ninit-sysvinit powerS
DESCRIPTION
ninit does not use the /dev/initctl fifo. As a result the SysVinit
commands telinit, reboot, halt, shutdown do not work. Some of them
need to write to /dev/initctl to work properly.
ninit-sysvinit is a SysVinit emulator which listens on /dev/initctl and
starts some services if there is any activity on the fifo.
USAGE
Five seconds after starting all services ninit tries to start the
sysvinit service. If the last service exists then ninit opens and lis-
tens on /dev/initctl. Never include the service sysvinit in
/etc/ninit/default nor start it at boot time.
OPTIONS
ninit-sysvinit reads the control file sysvinit-timeout in the service
directory. It must contain two numbers n1:n2. If there is not any
activity on /dev/initctrl for more than n1 seconds the program exits.
If the number n1 is zero ninit-sysvinit wait forever.
If needed, ninit can start ninit-sysvinit later again.
RUNLEVELS
SysVinit has runlevels 0123456S. The command
telinit S
writes the request to /dev/initctl and ninit-sysvinit starts the ser-
vice levelS. It works similarly with telinit 5, telinit Q or telinit
U. Then ninit-sysvinit starts the level5, levelQ or levelU service if
it exists.
POWER ACTIONS
ninit-sysvinit also starts the services powerF, powerO or powerL. The
letters come from F(AIL), O(K) or L(OW). The program can obtain the
power request from /dev/initctl or from a SIGPWR signal and the file
/etc/powerstatus. See the manual page init(8) for more info.
SIGNALS
Don't send signal SIGPWR to ninit-sysvinit. Manpage init(8) says:
Usage of SIGPWR and /etc/powerstatus is discouraged. Someone wanting to
interact with init should use the /dev/initctl control channel.
If some program still needs to use signal SIGPWR it must send it
dirrectly to ninit.
ENVIRON
SysVinit shutdown sets the variable INIT_HALT=POWERDOWN or
INIT_HALT=HALT depending on the options -r -h -H -P. You can (re)set
this variable using:
nsvc -E INIT_HALT
nsvc -E INIT_HALT=POWERDOWN
AUTHOR
If you don't plan to use SysvInit's shutdown, reboot, halt or telninit
commands, you can do:
cd /etc/ninit
mv sysvinit sysvinit_
ninit-reload -v -u /sbin/ninit
Why did I write this SysVinit emulator? This is a good question.
Ninit has the ninit-shutdown, nkillall and ninit-reboot programs.
There is no need to use SysVinit halt, reboot... to stop the box clean.
See the code of the emulator. Maybe you will find the answer there.
Nikola Vladov
FILES
/dev/initctl
/etc/powerstatus
NINIT_HOME/sysvinit/sysvinit-timeout
SEE ALSO
nsvc(8), ninit-shutdown(8), ninit-runlevel(8)
init(8), shutdown(8), halt(8), reboot(8), telinit(8)
Dec 28, 2009 ninit-sysvinit(8)
|