aboutsummaryrefslogtreecommitdiff
path: root/man/ninit.8
blob: e6a9e8abe854332f9982d2a41b758243391898b6 (plain)
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
.TH ninit 8 "Jan 15, 2010"
.SH NAME
ninit \- a UNIX process no 1
.SH SYNOPSIS
.B ninit 
[\-Mnumber] [\-Hhome] [\-Ssystem] [service] ...

.SH DESCRIPTION
.B ninit
is a possible first process the kernel starts.  It can
start/stop/monitor all services the OS needs.

To use ninit as system init, first read available documentation in 
.I http://riemann.fmi.uni-sofia.bg/ninit/
and then add the parameter 
\fIinit=/sbin/ninit\fR
to your kernel command line.

If you want to use ninit
only to start/monitor services and continue to use 
the default init(8) then put in 
.I /etc/inittab 
.br
.B NI:12345:respawn:/sbin/ninit
.br
In this case you should remove the service 
.B sysvinit
and don't use the programs:
ninit\-runlevel(8), ninit\-sysvinit(8).
Similarly it is possible to start ninit using
.B /etc/init.d/ninit
script.


.SH USAGE
.B ninit 
will by default do nothing except start the ninit 
service defined in
.I /etc/ninit/default
which usually contains a file named
.I depends
specifying which services are to be started at bootup.

To control ninit use the companion program 
.B nsvc.
Do not make it SUID unless you know what are you doing!

The program
.B ninit\-sysvinit
listens to the fifo
.I /dev/initctl
and allows SysVinit programs
shutdown, halt, reboot, telinit to work properly.
If there is a service
.I /etc/ninit/sysvinit
it starts 
.B ninit\-sysvinit.


To stop the box running 
.B ninit
use the programs 
.B ninit\-shutdown
or
.B nsvc.

.SH "NONROOT USAGE"
Any nonroot user can use 
.B /sbin/ninit
to start/monitor own services.  First make private 
ninit directory with
.br
.B /etc/ninit/bin/ninit\-conf ~/.ninit
.br 
and put somewhere in shell profile:
.B export NINIT_HOME=~/.ninit

Then create some services in $NINIT_HOME and start
.br
.B /sbin/ninit -H$NINIT_HOME

.SH OPTIONS
.TP
.B \-Mnumber
Tells ninit to use 
.B number
bytes for memory buffer.  One service uses approximately 30 bytes.
.TP
.B \-Hhome
Changes the ninit home.  Default: 
.I /etc/ninit
.TP
.B \-Ssystem
Changes the ninit system directory.  Default:
.I sys

.SH SIGNALS
On receiving of some signals 
.B ninit
starts appropiate service. 

.TP
.B SIGINT
Normally the kernel sends this signal to ninit when CTRL-ALT-DEL is
pressed. It activates the \fIctrlaltdel\fP action and ninit
starts the service 
.I ctrlaltdel
.TP
.B SIGWINCH
The kernel sends this signal when the \fIKeyboardSignal\fP key is hit.
It activates the \fIkbrequest\fP action
and ninit starts the service 
.I kbreq
.TP
.B SIGHUP
Has the same effect as telinit q.
Ninit restarts the service 
.I levelQ
.TP
.B SIGUSR1
On receipt of this signal, ninit closes and re-opens its control fifo,
.I /dev/initctl. 
Useful for bootscripts when /dev is remounted.
.TP
.B SIGPWR
Ninit starts the service 
.I powerS.  
This service starts the program
.B ninit-sysvinit
with one argument: powerS.

.SH SERVICES
Each service has own subdirectory in 
.I /etc/ninit/
three.  There are lots of config files for a service.
The main daemon
.B ninit
check only the files 
.I depends, sync, respawn, end
to start a service.
Check olso the link:
.br
.I http://riemann.fmi.uni-sofia.bg/ninit/files.html
 
If the servive name start with '#' or '\-' it is blacklisted.
You can now blacklist services temporarily by passing it on
the kernel command line.  The first time they are to be started
will then be skipped.  Use this, for example, to not start the dhcp
client when your notebook is not plugged in a network.
Look in ninitfeatures.h if ninit is compiled to use this option.

.SH FILES
.I NINIT_HOME/in
.br
.I NINIT_HOME/out
.br
.I NINIT_HOME/sys/
.br
.I /dev/initctl


.SH AUTHOR
ninit was written by Nikola Vladov and can be downloaded from
.I http://riemann.fmi.uni-sofia.bg/ninit/

.SH SEE ALSO
nsvc(8), ninit-service(8), ninit-reload(8)
.br
ninit-shutdown(8), ninit-reboot(8), nkillall(8)
.br
ninit-sysvinit(8), ninit-runlevel(8)
.br
minit(8), 
.I http://www.fefe.de/minit/
.br
init(8), shutdown(8), halt(8), reboot(8)

Part of this manpage was written by Erich Schubert.