aboutsummaryrefslogtreecommitdiff
path: root/riemann.fmi.uni-sofia.bg/ninit/FAQ.html
blob: 0105374e94547f0eb1b37e6d7590b8ce4f6e3e6d (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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
<html>
<link rel="stylesheet" type="text/css" href="style.css">
<title>FAQ for ninit</title>
<body>

<div class="top">
<ul class="nav">
  <li><a href="all.html">All files</a>
</ul>

<h1>FAQ for ninit</h1>
<div class="endtop"></div>
</div>

<!--
Useful srings for copy/paste

<table><td><a name=q2><font color=red>Q:</font></a><td><b>
</td><tr><td><td><b>
</b></td></table>
-->

<ul>
<li><a href="#q1">Why another init?</a></li>
<li><a href="#q2">What's the difference between minit and ninit?</a></li>
<li><a href="#q3">Your pidfilehack doesn't work with minit.</a></li>
<li><a href="#q4">Why do you split ninit in separate programs - ninit and helpers?</a></li>
<li><a href="#q5">Is there web interface for creating services?</a></li>
<li><a href="#q6">How about security?  Is ninit reliable?</a></li>
<li><a href="#q7">Why documentation is in a separate file?</a></li>
<!--
  <li><a href="#q8">There is a program env in package.  
  Why it is not installed?</a></li>
-->
<li><a href="#q9">Your documentation is bad!</a></li>
<!--
  <li><a href="#q10">When I try to compile I receive:
  "misc/tryprocess.c:2:20: error: unistd.h: No such file 
  or directory"</a></li>
-->
<li><a href="#q10a">Should I start the service sysvinit at boot time?</a></li>
<li><a href="#q11">Halt and reboot doesn't work clean with ninit.</a></li>
<li><a href="#q12">Which are the new files in <tt>ninit</tt>
which are missing in <tt>minit</tt>?</a></li>
<li><a href="#q13">Why my ninit uses more than 36k RAM?</a></li>
<li><a href="#q14">Why serdo doesn't start script in current dir?</a></li>
<li><a href="#q15">How to see which version I use?</a></li>
<li><a href="#qlast">How can I ask a new question?</a></li>


<!--
<li><a href="#q1"> </a></li>
11 - counter now.
-->
</ul>



<table><td><a name=q1><font color=red>Q:</font></a></a><td>
<b>Why another init?</b></td>
<tr><td><td>
  Hm-mmm!  
  I offer <a href=guarantee.html>security</a> guarantee.
  On my boxes ninit uses minimal resources - only 8K RAM.
  I was looking for the name and my friend 
  Pencho Marinov suggested me:  "Ninit is a good name
  since it's small.  The people will spell it <b>nano</b>-init!"
</td>
</table>


<table><td><a name=q2><font color=red>Q:</font></a><td><b>
What's the difference between 
<a href=http://www.fefe.de/minit/>minit</a> and ninit?
</b></td><tr><td><td>
    ninit is a fork from minit.  On user level ninit support all
    features of minit.  There is one difference.  Ninit doesn't
    support unnamed pipes between a service and a log-service.
    It does logging with named pipes.  I decided to remove
    unnamed pipes.  This saves code.
<p>
    Ninit create the links and named pipes for log services alone.
    There is one restriction only.  The service dir must be writable.
    One have to start such services after mount, or create links
    manually before starting the service.  Example
<pre>
  mkfifo -m 600 log/in
  ln -s log/in out
</pre>
</td></table>


<table><td><a name=q3><font color=red>Q:</font></a><td><b>
Your pidfilehack doesn't work with 
<a href=http://www.fefe.de/minit/>minit</a>.
</b></td><tr><td><td>
In recent versions I decided to rename pidfilehack to 
<a href=man/pidfile.man>ninit-pidfile</a>.

With ninit you can prepare a service and if it forks and 
writes the PID
in some file then type in the service directory:
<pre>
	echo /path/to/deamon.pidfile > pidfile
</pre>
<!--
If you have running minit do before reboot
<pre>
  OAcd /etc/ninit  &&  rm -f in out
  ln /etc/minit/in  in
  ln /etc/minit/out out 
</pre>
    Above checks are included in version 0.12-pre.
    See misc/update_pipes.sh there.
<p>
    The problem is:  my pidfilehack and nsvc have hard-coded
    /etc/ninit/{in|out} pipes.  After above links are made
    ninit's pidfilehack will work with minit also.
-->
</td></table>

<table><td><a name=q4><font color=red>Q:</font></a><td><b>
Why do you split ninit in separate programs -- ninit and helpers?
</b></td><tr><td><td>
I have to write a separate page for this question.
</td></table>


<table><td><a name=q5><font color=red>Q:</font></a><td><b>
Is there web interface for creating services?
</b></td><tr><td><td>
Not yet.  Who do this?
</td></table>


<table><td><a name=q6><font color=red>Q:</font></a><td><b>
How about security?  Is ninit reliable?
</b></td><tr><td><td>
    I wrote all following Daniel 
    <a href=http://cr.yp.to>Bernstein</a>
    and Felix von 
    <a href=http://www.fefe.de/>Leitner</a>.
    I'm not so great like them, bath I try to 
    write similar code to their.

    Since I believe that the programs are secure ninit comes
    with a <a href=guarantee.html>guarantee</a>.
</td></table>


<table><td><a name=q7><font color=red>Q:</font></a><td><b>
Why documentation is in a separate file?
</b></td><tr><td><td>
    So I can change and keep it up to date easy.  
    You can also install
    <a href=ninit-html.tar.bz2>HTML-docs</a>
    on your box.  They are public.
</td></table>


<!--
<table><td><a name=q8><font color=red>Q:</font></a><td><b>
There is a program env in package.  Why it is not installed?
</b></td><tr><td><td>
    It does the same as /bin/env from core utils.  My is small and
    works with less RAM on my box.  If you want use it.  If you want
    to change the environ of some service use the file 
    service/environ or this env.
<pre>
	 mkdir /etc/ninit/bin
	 cp ./env /etc/ninit/bin
</pre>
</td></table>
-->

<table><td><a name=q9><font color=red>Q:</font></a><td><b>
Your documentation is bad!
</b></td><tr><td><td>
    I know.  May be you will help to make it better.
    See also
    <a href=man/README>this</a>.
</td></table>

<!--
<table><td><a name=q10><font color=red>Q:</font></a><td><b>
When I try to compile I receive: <br>"misc/tryprocess.c:2:20: error:
unistd.h: No such file or directory"</b></td><tr><td><td>
    You haven't install headers files of C libraries. 
    Try first to build next program:
<pre>
  #include &lt;unistd.h&gt;
  int main() { write(1, "I like C\n", 9); return 0; }  
</pre>
</td></table>
-->

<table><td><a name=q10a><font color=red>Q:</font></a><td><b>
Should I start the service sysvinit at boot time?
</b></td><tr><td><td>
No!  Five minutes after boot time ninit try to start 
this service.  If such service exists it open the fifo 
<tt>/dev/initctl</tt>.  If there is any activity
on the fifo it invokes the emulator 
<a href=man/sysvinit.man>ninit-sysvinit</a>.
If you don't plan to start the commands
<tt>halt, reboot, shutdown, telinit</tt>, then you can do:
<pre>
	cd /etc/ninit
	mv sysvinit sysvinit_
	nsvc -o update
</pre>
Some scripts in <tt>/etc/init.d/</tt> uses the above sysvinit commands.
</td></table>


<table><td><a name=q11><font color=red>Q:</font></a><td><b>
Halt and reboot doesn't work clean with ninit.
</b></td><tr><td><td>
    How to stop the system running ninit see 
    <a href=ninit.html#HaltReboot>here</a>.
    If you have a servive <b>sysvinit</b> then
    all must be fine.  See also 
    <a href=man/sysvinit.man>ninit-sysvinit</a>.

<p>
    If you have again problems with 
    <tt>nsvc -o {halt|reboot|_l0|_l6}</tt> 
    the problem is probably 
    <tt>init.d/halt</tt> script.
    For example on FEDORA last script ends with:
<pre>
  [ -n "$kexec_command" ] && $kexec_command -e >&amp; /dev/null
  
  HALTARGS="-i -d"
  [ -f /poweroff -o ! -f /halt ] && HALTARGS="$HALTARGS -p"
  
  exec $command $HALTARGS
</pre>

You have to include the following lines before the text above.
<pre>
  if [ -n "$NINIT_RUNLEVEL" ] ; then
     # use ninit-reboot instead of halt|reboot|poweroff
     NINIT_HALT=HALT
     [ -f /poweroff -o ! -f /halt ] && NINIT_HALT=POWER_OFF
     [ "$command" = "/sbin/reboot" ] && NINIT_HALT=RESTART
     exec /sbin/ninit-reboot $NINIT_HALT
  fi
</pre>

See also the manpages halt(8), poweroff(8), reboot(8),
<a href=man/reboot.man>ninit-reboot</a> and
<a href=man/sysvinit.man>ninit-sysvinit</a>.
The commands
<tt>halt, reboot, poweroff</tt> belongs to the
<a href=ftp://ftp.cistron.nl/pub/people/miquels/sysvinit/>sysvinit</a>
package.

<!--
<p>
After version ninit-0.11 the converter
<a href=man/inittab.man>ninit-inittab</a> sets also 
the <a href="files.html#Environ">environ</a> variable
NINIT_RUNLEVEL.
-->
</td></table>


<table><td><a name=q12><font color=red>Q:</font></a><td><b>
Which are the new files in <tt>ninit</tt>
which are missing in <tt>minit</tt>?
</b></td><tr><td><td>
They are:  &nbsp;
<a href="files.html#Environ">environ</a>,
<a href="files.html#Wait">wait</a>,
<a href="files.html#Maxwait">maixwait</a>,
<a href="files.html#Softlimit">softlimit</a>,
<a href="files.html#Sleep">sleep</a>,
<a href="files.html#End">end</a>,
<a href="files.html#Uid">uid</a>,
<a href="files.html#Setup">setup</a>,
<a href="files.html#Rsetup">rsetup</a>,
<a href="files.html#Sys-rsetup">sys-rsetup</a>,
<a href="files.html#Pidfile">pidfile</a>,
<a href="files.html#Alarm">alarm</a>,
<a href="files.html#Pause">pause</a>,
<a href="files.html#Pause-wait">pause-wait</a>,
<a href="files.html#Cron">cron</a>.

Ninit start services using the helper programs 
from <tt>/etc/ninit/<a href=man/run.html>sys/</a></tt>
dierctory.  It aslo have 
<a href=man/sysvinit.man>sysvinit</a> emulator.
</td></table>


<table><td><a name=q13><font color=red>Q:</font></a><td><b>
Why my ninit uses more than 36k RAM?
</b></td><tr><td><td>
   You have build ninit with glibc.  Read 
<a href=install.html>here</a> how to make small static binaries.
</td></table>


<table><td><a name=q14><font color=red>Q:</font></a><td><b>
Why serdo doesn't start script in current dir?
</b></td><tr><td><td>
   See my comments in serdo.c source after main.  If you still
   want uncomment one line there to support this feature.
   It's not a <b>security whole</b>, but I personally find 
   it <b>too dangerous</b>.
</td></table>



<table><td><a name=q15><font color=red>Q:</font></a><td><b>
How to see which version I use?
</b></td><tr><td><td>
   In the recent versions it's coded in the file 
   <tt>/etc/init/.sync</tt><br>
   <tt>cat /etc/ninit/.sync</tt>
</td></table>



<table><td><a name=qlast><font color=red>Q:</font></a><td><b>
How can I ask a new question?
</b></td><tr><td><td>
    Read first this file and documentation carefully.
    Look also the package 
    <a href=README>README</a>.
<br>
There is a
&#109;&#97;&#105;&#108;&#105;&#110;&#103;&#32;&#108;&#105;&#115;&#116;
for ninit.  To &#115;&#117;&#98;&#115;&#99;&#114;&#105;&#98;&#101;&#44;
send an empty &#109;&#101;&#115;&#115;&#97;&#103;&#101;
to <font size=+1><br> <a href=
&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#110;&#105;&#110;&#105;&#116;&#45;&#115;&#117;&#98;&#115;&#99;&#114;&#105;&#98;&#101;&#64;&#114;&#105;&#101;&#109;&#97;&#110;&#110;&#46;&#102;&#109;&#105;&#46;&#117;&#110;&#105;&#45;&#115;&#111;&#102;&#105;&#97;&#46;&#98;&#103;
>
&#110;&#105;&#110;&#105;&#116;&#45;&#115;&#117;&#98;&#115;&#99;&#114;&#105;&#98;&#101;&#64;&#114;&#105;&#101;&#109;&#97;&#110;&#110;&#46;&#102;&#109;&#105;&#46;&#117;&#110;&#105;&#45;&#115;&#111;&#102;&#105;&#97;&#46;&#98;&#103;
</a></font>.

Some delay is posstible due to
<a href=http://en.wikipedia.org/wiki/Greylisting>
&#103;&#114;&#101;&#121;&#108;&#105;&#115;&#116;&#105;&#110;&#103;</a>.

Send me private &#101;&#109;&#97;&#105;&#108;&#115;
using <a href=&#47;&#101;&#109;&#97;&#105;&#108;&#46;&#104;&#116;&#109;&#108;>qform</a>.
</td></table>

<p>
Last updated:  15 Jan 2010


<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>

Gratuitious blank lines added so that FAQ.html#link works.
</body>
</html>