]> pere.pagekite.me Git - homepage.git/blob - blog/tags/bootsystem/index.html
0dc3868ca13f3fb92e23c1a5ec8ab586c4f17fef
[homepage.git] / blog / tags / bootsystem / index.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html>
4 <head>
5 <title>Petter Reinholdtsen: Entries Tagged bootsystem</title>
6 <link rel="stylesheet" type="text/css" media="screen" href="http://people.skolelinux.org/pere/blog/style.css">
7 <link rel="alternate" title="RSS Feed" href="bootsystem.rss" type="application/rss+xml">
8 </head>
9 <body>
10
11 <div class="title">
12 <h1>
13 <a href="http://people.skolelinux.org/pere/blog/">Petter Reinholdtsen</a>
14
15 </h1>
16
17 </div>
18
19 <p>Entries tagged "bootsystem".</p>
20
21
22
23
24 <div class="entry">
25 <div class="title">
26 <a href="http://people.skolelinux.org/pere/blog/Debian_boots_quicker_and_quicker.html">Debian boots quicker and quicker</a>
27 </div>
28 <div class="date">
29 2009-06-24 21:40
30 </div>
31
32 <div class="body">
33
34 <p>I spent Monday and tuesday this week in London with a lot of the
35 people involved in the boot system on Debian and Ubuntu, to see if we
36 could find more ways to speed up the boot system. This was an Ubuntu
37 funded
38 <a href="https://wiki.ubuntu.com/FoundationsTeam/BootPerformance/DebianUbuntuSprint">developer
39 gathering</a>. It was quite productive. We also discussed the future
40 of boot systems, and ways to handle the increasing number of boot
41 issues introduced by the Linux kernel becoming more and more
42 asynchronous and event base. The Ubuntu approach using udev and
43 upstart might be a good way forward. Time will show.</p>
44
45 <p>Anyway, there are a few ways at the moment to speed up the boot
46 process in Debian. All of these should be applied to get a quick
47 boot:</p>
48
49 <ul>
50
51 <li>Use dash as /bin/sh.</li>
52
53 <li>Disable the init.d/hwclock*.sh scripts and make sure the hardware
54 clock is in UTC.</li>
55
56 <li>Install and activate the insserv package to enable
57 <a href="http://wiki.debian.org/LSBInitScripts/DependencyBasedBoot">dependency
58 based boot sequencing</a>, and enable concurrent booting.</li>
59
60 </ul>
61
62 These points are based on the Google summer of code work done by
63 <a href="http://initscripts-ng.alioth.debian.org/soc2006-bootsystem/">Carlos
64 Villegas</a>.
65
66 <p>Support for makefile-style concurrency during boot was uploaded to
67 unstable yesterday. When we tested it, we were able to cut 6 seconds
68 from the boot sequence. It depend on very correct dependency
69 declaration in all init.d scripts, so I expect us to find edge cases
70 where the dependences in some scripts are slightly wrong when we start
71 using this.</p>
72
73 <p>On our IRC channel for this effort, #pkg-sysvinit, a new idea was
74 introduced by Raphael Geissert today, one that could affect the
75 startup speed as well. Instead of starting some scripts concurrently
76 from rcS.d/ and another set of scripts from rc2.d/, it would be
77 possible to run a of them in the same process. A quick way to test
78 this would be to enable insserv and run 'mv /etc/rc2.d/S* /etc/rcS.d/;
79 insserv'. Will need to test if that work. :)</p>
80
81 </div>
82 <div class="tags">
83
84
85
86 Tags: <a href="http://people.skolelinux.org/pere/blog/tags/bootsystem">bootsystem</a>, <a href="http://people.skolelinux.org/pere/blog/tags/debian">debian</a>, <a href="http://people.skolelinux.org/pere/blog/tags/english">english</a>.
87
88 </div>
89 </div>
90 <div class="padding"></div>
91
92 <div class="entry">
93 <div class="title">
94 <a href="http://people.skolelinux.org/pere/blog/Taking_over_sysvinit_development.html">Taking over sysvinit development</a>
95 </div>
96 <div class="date">
97 2009-07-22 23:00
98 </div>
99
100 <div class="body">
101
102 <p>After several years of frustration with the lack of activity from
103 the existing sysvinit upstream developer, I decided a few weeks ago to
104 take over the package and become the new upstream. The number of
105 patches to track for the Debian package was becoming a burden, and the
106 lack of synchronization between the distribution made it hard to keep
107 the package up to date.</p>
108
109 <p>On the new sysvinit team is the SuSe maintainer Dr. Werner Fink,
110 and my Debian co-maintainer Kel Modderman. About 10 days ago, I made
111 a new upstream tarball with version number 2.87dsf (for Debian, SuSe
112 and Fedora), based on the patches currently in use in these
113 distributions. We Debian maintainers plan to move to this tarball as
114 the new upstream as soon as we find time to do the merge. Since the
115 new tarball was created, we agreed with Werner at SuSe to make a new
116 upstream project at <a href="http://savannah.nongnu.org/">Savannah</a>, and continue
117 development there. The project is registered and currently waiting
118 for approval by the Savannah administrators, and as soon as it is
119 approved, we will import the old versions from svn and continue
120 working on the future release.</p>
121
122 <p>It is a bit ironic that this is done now, when some of the involved
123 distributions are moving to upstart as a syvinit replacement.</p>
124
125 </div>
126 <div class="tags">
127
128
129
130 Tags: <a href="http://people.skolelinux.org/pere/blog/tags/bootsystem">bootsystem</a>, <a href="http://people.skolelinux.org/pere/blog/tags/debian">debian</a>, <a href="http://people.skolelinux.org/pere/blog/tags/english">english</a>, <a href="http://people.skolelinux.org/pere/blog/tags/nuug">nuug</a>.
131
132 </div>
133 </div>
134 <div class="padding"></div>
135
136 <div class="entry">
137 <div class="title">
138 <a href="http://people.skolelinux.org/pere/blog/Debian_has_switched_to_dependency_based_boot_sequencing.html">Debian has switched to dependency based boot sequencing</a>
139 </div>
140 <div class="date">
141 2009-07-27 23:50
142 </div>
143
144 <div class="body">
145
146 <p>Since this evening, with the upload of sysvinit version 2.87dsf-2,
147 and the upload of insserv version 1.12.0-10 yesterday, Debian unstable
148 have been migrated to using dependency based boot sequencing. This
149 conclude work me and others have been doing for the last three days.
150 It feels great to see this finally part of the default Debian
151 installation. Now we just need to weed out the last few problems that
152 are bound to show up, to get everything ready for Squeeze.</p>
153
154 <p>The next step is migrating /sbin/init from sysvinit to upstart, and
155 fixing the more fundamental problem of handing the event based
156 non-predictable kernel in the early boot.</p>
157
158 </div>
159 <div class="tags">
160
161
162
163 Tags: <a href="http://people.skolelinux.org/pere/blog/tags/bootsystem">bootsystem</a>, <a href="http://people.skolelinux.org/pere/blog/tags/debian">debian</a>, <a href="http://people.skolelinux.org/pere/blog/tags/english">english</a>, <a href="http://people.skolelinux.org/pere/blog/tags/nuug">nuug</a>.
164
165 </div>
166 </div>
167 <div class="padding"></div>
168
169 <div class="entry">
170 <div class="title">
171 <a href="http://people.skolelinux.org/pere/blog/Parallellizing_the_boot_in_Debian_Squeeze___ready_for_wider_testing.html">Parallellizing the boot in Debian Squeeze - ready for wider testing</a>
172 </div>
173 <div class="date">
174 2010-05-06 23:25
175 </div>
176
177 <div class="body">
178
179 <p>These days, the init.d script dependencies in Squeeze are quite
180 complete, so complete that it is actually possible to run all the
181 init.d scripts in parallell based on these dependencies. If you want
182 to test your Squeeze system, make sure
183 <a href="http://wiki.debian.org/LSBInitScripts/DependencyBasedBoot">dependency
184 based boot sequencing</a> is enabled, and add this line to
185 /etc/default/rcS:</p>
186
187 <blockquote><pre>
188 CONCURRENCY=makefile
189 </pre></blockquote>
190
191 <p>That is it. It will cause sysv-rc to use the startpar tool to run
192 scripts in parallel using the dependency information stored in
193 /etc/init.d/.depend.boot, /etc/init.d/.depend.start and
194 /etc/init.d/.depend.stop to order the scripts. Startpar is configured
195 to try to start the kdm and gdm scripts as early as possible, and will
196 start the facilities required by kdm or gdm as early as possible to
197 make this happen.</p>
198
199 <p>Give it a try, and see if you like the result. If some services
200 fail to start properly, it is most likely because they have incomplete
201 init.d script dependencies in their startup script (or some of their
202 dependent scripts have incomplete dependencies). Report bugs and get
203 the package maintainers to fix it. :)</p>
204
205 <p>Running scripts in parallel could be the default in Debian when we
206 manage to get the init.d script dependencies complete and correct. I
207 expect we will get there in Squeeze+1, if we get manage to test and
208 fix the remaining issues.</p>
209
210 <p>If you report any problems with dependencies in init.d scripts to
211 the BTS, please usertag the report to get it to show up at
212 <a href="http://bugs.debian.org/cgi-bin/pkgreport.cgi?users=initscripts-ng-devel@lists.alioth.debian.org">the
213 list of usertagged bugs related to this</a>.</p>
214
215 </div>
216 <div class="tags">
217
218
219
220 Tags: <a href="http://people.skolelinux.org/pere/blog/tags/bootsystem">bootsystem</a>, <a href="http://people.skolelinux.org/pere/blog/tags/debian">debian</a>, <a href="http://people.skolelinux.org/pere/blog/tags/english">english</a>.
221
222 </div>
223 </div>
224 <div class="padding"></div>
225
226 <div class="entry">
227 <div class="title">
228 <a href="http://people.skolelinux.org/pere/blog/systemd__an_interesting_alternative_to_upstart.html">systemd, an interesting alternative to upstart</a>
229 </div>
230 <div class="date">
231 2010-05-13 22:20
232 </div>
233
234 <div class="body">
235
236 <p>The last few days a new boot system called
237 <a href="http://www.freedesktop.org/wiki/Software/systemd">systemd</a>
238 has been
239 <a href="http://0pointer.de/blog/projects/systemd.html">introduced</a>
240
241 to the free software world. I have not yet had time to play around
242 with it, but it seem to be a very interesting alternative to
243 <a href="http://upstart.ubuntu.com/">upstart</a>, and might prove to be
244 a good alternative for Debian when we are able to switch to an event
245 based boot system. Tollef is
246 <a href="http://bugs.debian.org/580814">in the process</a> of getting
247 systemd into Debian, and I look forward to seeing how well it work. I
248 like the fact that systemd handles init.d scripts with dependency
249 information natively, allowing them to run in parallel where upstart
250 at the moment do not.</p>
251
252 <p>Unfortunately do systemd have the same problem as upstart regarding
253 platform support. It only work on recent Linux kernels, and also need
254 some new kernel features enabled to function properly. This means
255 kFreeBSD and Hurd ports of Debian will need a port or a different boot
256 system. Not sure how that will be handled if systemd proves to be the
257 way forward.</p>
258
259 <p>In the mean time, based on the
260 <a href="http://lists.debian.org/debian-devel/2010/05/msg00122.html">input
261 on debian-devel@</a> regarding parallel booting in Debian, I have
262 decided to enable full parallel booting as the default in Debian as
263 soon as possible (probably this weekend or early next week), to see if
264 there are any remaining serious bugs in the init.d dependencies. A
265 new version of the sysvinit package implementing this change is
266 already in experimental. If all go well, Squeeze will be released
267 with parallel booting enabled by default.</p>
268
269 </div>
270 <div class="tags">
271
272
273
274 Tags: <a href="http://people.skolelinux.org/pere/blog/tags/bootsystem">bootsystem</a>, <a href="http://people.skolelinux.org/pere/blog/tags/debian">debian</a>, <a href="http://people.skolelinux.org/pere/blog/tags/english">english</a>, <a href="http://people.skolelinux.org/pere/blog/tags/nuug">nuug</a>.
275
276 </div>
277 </div>
278 <div class="padding"></div>
279
280 <div class="entry">
281 <div class="title">
282 <a href="http://people.skolelinux.org/pere/blog/Parallellized_boot_is_now_the_default_in_Debian_unstable.html">Parallellized boot is now the default in Debian/unstable</a>
283 </div>
284 <div class="date">
285 2010-05-14 22:40
286 </div>
287
288 <div class="body">
289
290 <p>Since this evening, parallel booting is the default in
291 Debian/unstable for machines using dependency based boot sequencing.
292 Apparently the testing of concurrent booting has been wider than
293 expected, if I am to believe the
294 <a href="http://lists.debian.org/debian-devel/2010/05/msg00122.html">input
295 on debian-devel@</a>, and I concluded a few days ago to move forward
296 with the feature this weekend, to give us some time to detect any
297 remaining problems before Squeeze is frozen. If serious problems are
298 detected, it is simple to change the default back to sequential boot.
299 The upload of the new sysvinit package also activate a new upstream
300 version.</p>
301
302 More information about
303 <a href="http://wiki.debian.org/LSBInitScripts/DependencyBasedBoot">dependency
304 based boot sequencing</a> is available from the Debian wiki. It is
305 currently possible to disable parallel booting when one run into
306 problems caused by it, by adding this line to /etc/default/rcS:</p>
307
308 <blockquote><pre>
309 CONCURRENCY=none
310 </pre></blockquote>
311
312 <p>If you report any problems with dependencies in init.d scripts to
313 the BTS, please usertag the report to get it to show up at
314 <a href="http://bugs.debian.org/cgi-bin/pkgreport.cgi?users=initscripts-ng-devel@lists.alioth.debian.org">the
315 list of usertagged bugs related to this</a>.</p>
316
317 </div>
318 <div class="tags">
319
320
321
322 Tags: <a href="http://people.skolelinux.org/pere/blog/tags/bootsystem">bootsystem</a>, <a href="http://people.skolelinux.org/pere/blog/tags/debian">debian</a>, <a href="http://people.skolelinux.org/pere/blog/tags/debian edu">debian edu</a>, <a href="http://people.skolelinux.org/pere/blog/tags/english">english</a>.
323
324 </div>
325 </div>
326 <div class="padding"></div>
327
328 <div class="entry">
329 <div class="title">
330 <a href="http://people.skolelinux.org/pere/blog/Parallellized_boot_seem_to_hold_up_well_in_Debian_testing.html">Parallellized boot seem to hold up well in Debian/testing</a>
331 </div>
332 <div class="date">
333 2010-05-27 23:55
334 </div>
335
336 <div class="body">
337
338 <p>A few days ago, parallel booting was enabled in Debian/testing.
339 The feature seem to hold up pretty well, but three fairly serious
340 issues are known and should be solved:
341
342 <p><ul>
343
344 <li>The wicd package seen to
345 <a href="http://bugs.debian.org/508289">break NFS mounting</a> and
346 <a href="http://bugs.debian.org/581586">network setup</a> when
347 parallel booting is enabled. No idea why, but the wicd maintainer
348 seem to be on the case.</li>
349
350 <li>The nvidia X driver seem to
351 <a href="http://bugs.debian.org/583312">have a race condition</a>
352 triggered more easily when parallel booting is in effect. The
353 maintainer is on the case.</li>
354
355 <li>The sysv-rc package fail to properly enable dependency based boot
356 sequencing (the shutdown is broken) when old file-rc users
357 <a href="http://bugs.debian.org/575080">try to switch back</a> to
358 sysv-rc. One way to solve it would be for file-rc to create
359 /etc/init.d/.legacy-bootordering, and another is to try to make
360 sysv-rc more robust. Will investigate some more and probably upload a
361 workaround in sysv-rc to help those trying to move from file-rc to
362 sysv-rc get a working shutdown.</li>
363
364 </ul></p>
365
366 <p>All in all not many surprising issues, and all of them seem
367 solvable before Squeeze is released. In addition to these there are
368 some packages with bugs in their dependencies and run level settings,
369 which I expect will be fixed in a reasonable time span.</p>
370
371 <p>If you report any problems with dependencies in init.d scripts to
372 the BTS, please usertag the report to get it to show up at
373 <a href="http://bugs.debian.org/cgi-bin/pkgreport.cgi?users=initscripts-ng-devel@lists.alioth.debian.org">the
374 list of usertagged bugs related to this</a>.</p>
375
376 <p>Update: Correct bug number to file-rc issue.</p>
377
378 </div>
379 <div class="tags">
380
381
382
383 Tags: <a href="http://people.skolelinux.org/pere/blog/tags/bootsystem">bootsystem</a>, <a href="http://people.skolelinux.org/pere/blog/tags/debian">debian</a>, <a href="http://people.skolelinux.org/pere/blog/tags/debian edu">debian edu</a>, <a href="http://people.skolelinux.org/pere/blog/tags/english">english</a>.
384
385 </div>
386 </div>
387 <div class="padding"></div>
388
389 <div class="entry">
390 <div class="title">
391 <a href="http://people.skolelinux.org/pere/blog/KDM_fail_at_boot_with_NVidia_cards___and_no_one_try_to_fix_it_.html">KDM fail at boot with NVidia cards - and no one try to fix it?</a>
392 </div>
393 <div class="date">
394 2010-06-01 17:05
395 </div>
396
397 <div class="body">
398
399 <p>It is strange to watch how a bug in Debian causing KDM to fail to
400 start at boot when an NVidia video card is used is handled. The
401 problem seem to be that the nvidia X.org driver uses a long time to
402 initialize, and this duration is longer than kdm is configured to
403 wait.</p>
404
405 <p>I came across two bugs related to this issue,
406 <a href="http://bugs.debian.org/583312">#583312</a> initially filed
407 against initscripts and passed on to nvidia-glx when it became obvious
408 that the nvidia drivers were involved, and
409 <a href="http://bugs.debian.org/524751">#524751</a> initially filed against
410 kdm and passed on to src:nvidia-graphics-drivers for unknown reasons.</p>
411
412 <p>To me, it seem that no-one is interested in actually solving the
413 problem nvidia video card owners experience and make sure the Debian
414 distribution work out of the box for these users. The nvidia driver
415 maintainers expect kdm to be set up to wait longer, while kdm expect
416 the nvidia driver maintainers to fix the driver to start faster, and
417 while they wait for each other I guess the users end up switching to a
418 distribution that work for them. I have no idea what the solution is,
419 but I am pretty sure that waiting for each other is not it.</p>
420
421 <p>I wonder why we end up handling bugs this way.</p>
422
423 </div>
424 <div class="tags">
425
426
427
428 Tags: <a href="http://people.skolelinux.org/pere/blog/tags/bootsystem">bootsystem</a>, <a href="http://people.skolelinux.org/pere/blog/tags/debian">debian</a>, <a href="http://people.skolelinux.org/pere/blog/tags/debian edu">debian edu</a>, <a href="http://people.skolelinux.org/pere/blog/tags/english">english</a>.
429
430 </div>
431 </div>
432 <div class="padding"></div>
433
434 <div class="entry">
435 <div class="title">
436 <a href="http://people.skolelinux.org/pere/blog/Upstart_or_sysvinit___as_init_d_scripts_see_it.html">Upstart or sysvinit - as init.d scripts see it</a>
437 </div>
438 <div class="date">
439 2010-06-06 23:55
440 </div>
441
442 <div class="body">
443
444 <p>If Debian is to migrate to upstart on Linux, I expect some init.d
445 scripts to migrate (some of) their operations to upstart job while
446 keeping the init.d for hurd and kfreebsd. The packages with such
447 needs will need a way to get their init.d scripts to behave
448 differently when used with sysvinit and with upstart. Because of
449 this, I had a look at the environment variables set when a init.d
450 script is running under upstart, and when it is not.</p>
451
452 <p>With upstart, I notice these environment variables are set when a
453 script is started from rcS.d/ (ignoring some irrelevant ones like
454 COLUMNS):</p>
455
456 <blockquote><pre>
457 DEFAULT_RUNLEVEL=2
458 previous=N
459 PREVLEVEL=
460 RUNLEVEL=
461 runlevel=S
462 UPSTART_EVENTS=startup
463 UPSTART_INSTANCE=
464 UPSTART_JOB=rc-sysinit
465 </pre></blockquote>
466
467 <p>With sysvinit, these environment variables are set for the same
468 script.</p>
469
470 <blockquote><pre>
471 INIT_VERSION=sysvinit-2.88
472 previous=N
473 PREVLEVEL=N
474 RUNLEVEL=S
475 runlevel=S
476 </pre></blockquote>
477
478 <p>The RUNLEVEL and PREVLEVEL environment variables passed on from
479 sysvinit are not set by upstart. Not sure if it is intentional or not
480 to not be compatible with sysvinit in this regard.</p>
481
482 <p>For scripts needing to behave differently when upstart is used,
483 looking for the UPSTART_JOB environment variable seem to be a good
484 choice.</p>
485
486 </div>
487 <div class="tags">
488
489
490
491 Tags: <a href="http://people.skolelinux.org/pere/blog/tags/bootsystem">bootsystem</a>, <a href="http://people.skolelinux.org/pere/blog/tags/debian">debian</a>, <a href="http://people.skolelinux.org/pere/blog/tags/english">english</a>.
492
493 </div>
494 </div>
495 <div class="padding"></div>
496
497 <div class="entry">
498 <div class="title">
499 <a href="http://people.skolelinux.org/pere/blog/Automatic_upgrade_testing_from_Lenny_to_Squeeze.html">Automatic upgrade testing from Lenny to Squeeze</a>
500 </div>
501 <div class="date">
502 2010-06-11 22:50
503 </div>
504
505 <div class="body">
506
507 <p>The last few days I have done some upgrade testing in Debian, to
508 see if the upgrade from Lenny to Squeeze will go smoothly. A few bugs
509 have been discovered and reported in the process
510 (<a href="http://bugs.debian.org/585410">#585410</a> in nagios3-cgi,
511 <a href="http://bugs.debian.org/584879">#584879</a> already fixed in
512 enscript and <a href="http://bugs.debian.org/584861">#584861</a> in
513 kdebase-workspace-data), and to get a more regular testing going on, I
514 am working on a script to automate the test.</p>
515
516 <p>The idea is to create a Lenny chroot and use tasksel to install a
517 Gnome or KDE desktop installation inside the chroot before upgrading
518 it. To ensure no services are started in the chroot, a policy-rc.d
519 script is inserted. To make sure tasksel believe it is to install a
520 desktop on a laptop, the tasksel tests are replaced in the chroot
521 (only acceptable because this is a throw-away chroot).</p>
522
523 <p>A naive upgrade from Lenny to Squeeze using aptitude dist-upgrade
524 currently always fail because udev refuses to upgrade with the kernel
525 in Lenny, so to avoid that problem the file /etc/udev/kernel-upgrade
526 is created. The bug report
527 <a href="http://bugs.debian.org/566000">#566000</a> make me suspect
528 this problem do not trigger in a chroot, but I touch the file anyway
529 to make sure the upgrade go well. Testing on virtual and real
530 hardware have failed me because of udev so far, and creating this file
531 do the trick in such settings anyway. This is a
532 <a href="http://www.linuxquestions.org/questions/debian-26/failed-dist-upgrade-due-to-udev-config_sysfs_deprecated-nonsense-804130/">known
533 issue</a> and the current udev behaviour is intended by the udev
534 maintainer because he lack the resources to rewrite udev to keep
535 working with old kernels or something like that. I really wish the
536 udev upstream would keep udev backwards compatible, to avoid such
537 upgrade problem, but given that they fail to do so, I guess
538 documenting the way out of this mess is the best option we got for
539 Debian Squeeze.</p>
540
541 <p>Anyway, back to the task at hand, testing upgrades. This test
542 script, which I call <tt>upgrade-test</tt> for now, is doing the
543 trick:</p>
544
545 <blockquote><pre>
546 #!/bin/sh
547 set -ex
548
549 if [ "$1" ] ; then
550 desktop=$1
551 else
552 desktop=gnome
553 fi
554
555 from=lenny
556 to=squeeze
557
558 exec &lt; /dev/null
559 unset LANG
560 mirror=http://ftp.skolelinux.org/debian
561 tmpdir=chroot-$from-upgrade-$to-$desktop
562 fuser -mv .
563 debootstrap $from $tmpdir $mirror
564 chroot $tmpdir aptitude update
565 cat > $tmpdir/usr/sbin/policy-rc.d &lt;&lt;EOF
566 #!/bin/sh
567 exit 101
568 EOF
569 chmod a+rx $tmpdir/usr/sbin/policy-rc.d
570 exit_cleanup() {
571 umount $tmpdir/proc
572 }
573 mount -t proc proc $tmpdir/proc
574 # Make sure proc is unmounted also on failure
575 trap exit_cleanup EXIT INT
576
577 chroot $tmpdir aptitude -y install debconf-utils
578
579 # Make sure tasksel autoselection trigger. It need the test scripts
580 # to return the correct answers.
581 echo tasksel tasksel/desktop multiselect $desktop | \
582 chroot $tmpdir debconf-set-selections
583
584 # Include the desktop and laptop task
585 for test in desktop laptop ; do
586 echo > $tmpdir/usr/lib/tasksel/tests/$test &lt;&lt;EOF
587 #!/bin/sh
588 exit 2
589 EOF
590 chmod a+rx $tmpdir/usr/lib/tasksel/tests/$test
591 done
592
593 DEBIAN_FRONTEND=noninteractive
594 DEBIAN_PRIORITY=critical
595 export DEBIAN_FRONTEND DEBIAN_PRIORITY
596 chroot $tmpdir tasksel --new-install
597
598 echo deb $mirror $to main > $tmpdir/etc/apt/sources.list
599 chroot $tmpdir aptitude update
600 touch $tmpdir/etc/udev/kernel-upgrade
601 chroot $tmpdir aptitude -y dist-upgrade
602 fuser -mv
603 </pre></blockquote>
604
605 <p>I suspect it would be useful to test upgrades with both apt-get and
606 with aptitude, but I have not had time to look at how they behave
607 differently so far. I hope to get a cron job running to do the test
608 regularly and post the result on the web. The Gnome upgrade currently
609 work, while the KDE upgrade fail because of the bug in
610 kdebase-workspace-data</p>
611
612 <p>I am not quite sure what kind of extract from the huge upgrade logs
613 (KDE 167 KiB, Gnome 516 KiB) it make sense to include in this blog
614 post, so I will refrain from trying. I can report that for Gnome,
615 aptitude report 760 packages upgraded, 448 newly installed, 129 to
616 remove and 1 not upgraded and 1024MB need to be downloaded while for
617 KDE the same numbers are 702 packages upgraded, 507 newly installed,
618 193 to remove and 0 not upgraded and 1117MB need to be downloaded</p>
619
620 <p>I am very happy to notice that the Gnome desktop + laptop upgrade
621 is able to migrate to dependency based boot sequencing and parallel
622 booting without a hitch. Was unsure if there were still bugs with
623 packages failing to clean up their obsolete init.d script during
624 upgrades, and no such problem seem to affect the Gnome desktop+laptop
625 packages.</p>
626
627 </div>
628 <div class="tags">
629
630
631
632 Tags: <a href="http://people.skolelinux.org/pere/blog/tags/bootsystem">bootsystem</a>, <a href="http://people.skolelinux.org/pere/blog/tags/debian">debian</a>, <a href="http://people.skolelinux.org/pere/blog/tags/debian edu">debian edu</a>, <a href="http://people.skolelinux.org/pere/blog/tags/english">english</a>.
633
634 </div>
635 </div>
636 <div class="padding"></div>
637
638 <div class="entry">
639 <div class="title">
640 <a href="http://people.skolelinux.org/pere/blog/What_should_start_from__etc_rcS_d__in_Debian____almost_nothing.html">What should start from /etc/rcS.d/ in Debian? - almost nothing</a>
641 </div>
642 <div class="date">
643 2011-07-30 14:00
644 </div>
645
646 <div class="body">
647
648 <p>In the Debian boot system, several packages include scripts that
649 are started from /etc/rcS.d/. In fact, there is a bite more of them
650 than make sense, and this causes a few problems. What kind of
651 problems, you might ask. There are at least two problems. The first
652 is that it is not possible to recover a machine after switching to
653 runlevel 1. One need to actually reboot to get the machine back to
654 the expected state. The other is that single user boot will sometimes
655 run into problems because some of the subsystems are activated before
656 the root login is presented, causing problems when trying to recover a
657 machine from a problem in that subsystem. A minor additional point is
658 that moving more scripts out of rcS.d/ and into the other rc#.d/
659 directories will increase the amount of scripts that can run in
660 parallel during boot, and thus decrease the boot time.</p>
661
662 <p>So, which scripts should start from rcS.d/. In short, only the
663 scripts that _have_ to execute before the root login prompt is
664 presented during a single user boot should go there. Everything else
665 should go into the numeric runlevels. This means things like
666 lm-sensors, fuse and x11-common should not run from rcS.d, but from
667 the numeric runlevels. Today in Debian, there are around 115 init.d
668 scripts that are started from rcS.d/, and most of them should be moved
669 out. Do your package have one of them? Please help us make single
670 user and runlevel 1 better by moving it.</p>
671
672 <p>Scripts setting up the screen, keyboard, system partitions
673 etc. should still be started from rcS.d/, but there is for example no
674 need to have the network enabled before the single user login prompt
675 is presented.</p>
676
677 <p>As always, things are not so easy to fix as they sound. To keep
678 Debian systems working while scripts migrate and during upgrades, the
679 scripts need to be moved from rcS.d/ to rc2.d/ in reverse dependency
680 order, ie the scripts that nothing in rcS.d/ depend on can be moved,
681 and the next ones can only be moved when their dependencies have been
682 moved first. This migration must be done sequentially while we ensure
683 that the package system upgrade packages in the right order to keep
684 the system state correct. This will require some coordination when it
685 comes to network related packages, but most of the packages with
686 scripts that should migrate do not have anything in rcS.d/ depending
687 on them. Some packages have already been updated, like the sudo
688 package, while others are still left to do. I wish I had time to work
689 on this myself, but real live constrains make it unlikely that I will
690 find time to push this forward.</p>
691
692 </div>
693 <div class="tags">
694
695
696
697 Tags: <a href="http://people.skolelinux.org/pere/blog/tags/bootsystem">bootsystem</a>, <a href="http://people.skolelinux.org/pere/blog/tags/debian">debian</a>, <a href="http://people.skolelinux.org/pere/blog/tags/english">english</a>.
698
699 </div>
700 </div>
701 <div class="padding"></div>
702
703 <div class="entry">
704 <div class="title">
705 <a href="http://people.skolelinux.org/pere/blog/How_is_booting_into_runlevel_1_different_from_single_user_boots_.html">How is booting into runlevel 1 different from single user boots?</a>
706 </div>
707 <div class="date">
708 2011-08-04 12:40
709 </div>
710
711 <div class="body">
712
713 <p>Wouter Verhelst have some
714 <a href="http://grep.be/blog/en/retorts/pere_kubuntu_boot">interesting
715 pcomments and opinions</a> on my blog post on
716 <a href="http://people.skolelinux.org/pere/blog/What_should_start_from__etc_rcS_d__in_Debian____almost_nothing.html">the
717 need to clean up /etc/rcS.d/ in Debian</a> and my blog post about
718 <a href="http://people.skolelinux.org/pere/blog/What_is_missing_in_the_Debian_desktop__or_why_my_parents_use_Kubuntu.html">the
719 default KDE desktop in Debian</a>. I only have time to address one
720 small piece of his comment now, and though it best to address the
721 misunderstanding he bring forward:</p>
722
723 <p><blockquote>
724 Currently, a system admin has four options: [...] boot to a
725 single-user system (by adding 'single' to the kernel command line;
726 this runs rcS and rc1 scripts)
727 </blockquote></p>
728
729 <p>This make me believe Wouter believe booting into single user mode
730 and booting into runlevel 1 is the same. I am not surprised he
731 believe this, because it would make sense and is a quite sensible
732 thing to believe. But because the boot in Debian is slightly broken,
733 runlevel 1 do not work properly and it isn't the same as single user
734 mode. I'll try to explain what is actually happing, but it is a bit
735 hard to explain.</p>
736
737 <p>Single user mode is defined like this in /etc/inittab:
738 "<tt>~~:S:wait:/sbin/sulogin</tt>". This means the only thing that is
739 executed in single user mode in sulogin. Single user mode is a boot
740 state "between" the runlevels, and when booting into single user mode,
741 only the scripts in /etc/rcS.d/ are executed before the init process
742 enters the single user state. When switching to runlevel 1, the state
743 is in fact not ending in runlevel 1, but it passes through runlevel 1
744 and end up in the single user mode (see /etc/rc1.d/S03single, which
745 runs "init -t1 S" to switch to single user mode at the end of runlevel
746 1. It is confusing that the 'S' (single user) init mode is not the
747 mode enabled by /etc/rcS.d/ (which is more like the initial boot
748 mode).</p>
749
750 <p>This summary might make it clearer. When booting for the first
751 time into single user mode, the following commands are executed:
752 "<tt>/etc/init.d/rc S; /sbin/sulogin</tt>". When booting into
753 runlevel 1, the following commands are executed: "<tt>/etc/init.d/rc
754 S; /etc/init.d/rc 1; /sbin/sulogin</tt>". A problem show up when
755 trying to continue after visiting single user mode. Not all services
756 are started again as they should, causing the machine to end up in an
757 unpredicatble state. This is why Debian admins recommend rebooting
758 after visiting single user mode.</p>
759
760 <p>A similar problem with runlevel 1 is caused by the amount of
761 scripts executed from /etc/rcS.d/. When switching from say runlevel 2
762 to runlevel 1, the services started from /etc/rcS.d/ are not properly
763 stopped when passing through the scripts in /etc/rc1.d/, and not
764 started again when switching away from runlevel 1 to the runlevels
765 2-5. I believe the problem is best fixed by moving all the scripts
766 out of /etc/rcS.d/ that are not <strong>required</strong> to get a
767 functioning single user mode during boot.</p>
768
769 <p>I have spent several years investigating the Debian boot system,
770 and discovered this problem a few years ago. I suspect it originates
771 from when sysvinit was introduced into Debian, a long time ago.</p>
772
773 </div>
774 <div class="tags">
775
776
777
778 Tags: <a href="http://people.skolelinux.org/pere/blog/tags/bootsystem">bootsystem</a>, <a href="http://people.skolelinux.org/pere/blog/tags/debian">debian</a>, <a href="http://people.skolelinux.org/pere/blog/tags/english">english</a>.
779
780 </div>
781 </div>
782 <div class="padding"></div>
783
784 <p style="text-align: right;"><a href="bootsystem.rss"><img src="http://people.skolelinux.org/pere/blog/xml.gif" alt="RSS Feed" width="36" height="14"></a></p>
785
786
787
788
789 <div id="sidebar">
790
791 <h2>Archive</h2>
792 <ul>
793
794 <li>2011
795 <ul>
796
797 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/01/">January (16)</a></li>
798
799 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/02/">February (6)</a></li>
800
801 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/03/">March (6)</a></li>
802
803 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/04/">April (7)</a></li>
804
805 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/05/">May (3)</a></li>
806
807 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/06/">June (2)</a></li>
808
809 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/07/">July (7)</a></li>
810
811 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/08/">August (3)</a></li>
812
813 </ul></li>
814
815 <li>2010
816 <ul>
817
818 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/01/">January (2)</a></li>
819
820 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/02/">February (1)</a></li>
821
822 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/03/">March (3)</a></li>
823
824 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/04/">April (3)</a></li>
825
826 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/05/">May (9)</a></li>
827
828 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/06/">June (14)</a></li>
829
830 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/07/">July (12)</a></li>
831
832 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/08/">August (13)</a></li>
833
834 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/09/">September (7)</a></li>
835
836 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/10/">October (9)</a></li>
837
838 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/11/">November (13)</a></li>
839
840 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/12/">December (12)</a></li>
841
842 </ul></li>
843
844 <li>2009
845 <ul>
846
847 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/01/">January (8)</a></li>
848
849 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/02/">February (8)</a></li>
850
851 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/03/">March (12)</a></li>
852
853 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/04/">April (10)</a></li>
854
855 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/05/">May (9)</a></li>
856
857 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/06/">June (3)</a></li>
858
859 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/07/">July (4)</a></li>
860
861 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/08/">August (3)</a></li>
862
863 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/09/">September (1)</a></li>
864
865 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/10/">October (2)</a></li>
866
867 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/11/">November (3)</a></li>
868
869 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/12/">December (3)</a></li>
870
871 </ul></li>
872
873 <li>2008
874 <ul>
875
876 <li><a href="http://people.skolelinux.org/pere/blog/archive/2008/11/">November (5)</a></li>
877
878 <li><a href="http://people.skolelinux.org/pere/blog/archive/2008/12/">December (7)</a></li>
879
880 </ul></li>
881
882 </ul>
883
884
885
886 <h2>Tags</h2>
887 <ul>
888
889 <li><a href="http://people.skolelinux.org/pere/blog/tags/3d-printer">3d-printer (13)</a></li>
890
891 <li><a href="http://people.skolelinux.org/pere/blog/tags/amiga">amiga (1)</a></li>
892
893 <li><a href="http://people.skolelinux.org/pere/blog/tags/aros">aros (1)</a></li>
894
895 <li><a href="http://people.skolelinux.org/pere/blog/tags/bitcoin">bitcoin (2)</a></li>
896
897 <li><a href="http://people.skolelinux.org/pere/blog/tags/bootsystem">bootsystem (12)</a></li>
898
899 <li><a href="http://people.skolelinux.org/pere/blog/tags/debian">debian (53)</a></li>
900
901 <li><a href="http://people.skolelinux.org/pere/blog/tags/debian edu">debian edu (64)</a></li>
902
903 <li><a href="http://people.skolelinux.org/pere/blog/tags/digistan">digistan (7)</a></li>
904
905 <li><a href="http://people.skolelinux.org/pere/blog/tags/english">english (95)</a></li>
906
907 <li><a href="http://people.skolelinux.org/pere/blog/tags/fiksgatami">fiksgatami (12)</a></li>
908
909 <li><a href="http://people.skolelinux.org/pere/blog/tags/fildeling">fildeling (11)</a></li>
910
911 <li><a href="http://people.skolelinux.org/pere/blog/tags/intervju">intervju (10)</a></li>
912
913 <li><a href="http://people.skolelinux.org/pere/blog/tags/kart">kart (15)</a></li>
914
915 <li><a href="http://people.skolelinux.org/pere/blog/tags/ldap">ldap (8)</a></li>
916
917 <li><a href="http://people.skolelinux.org/pere/blog/tags/lenker">lenker (4)</a></li>
918
919 <li><a href="http://people.skolelinux.org/pere/blog/tags/ltsp">ltsp (1)</a></li>
920
921 <li><a href="http://people.skolelinux.org/pere/blog/tags/multimedia">multimedia (13)</a></li>
922
923 <li><a href="http://people.skolelinux.org/pere/blog/tags/norsk">norsk (131)</a></li>
924
925 <li><a href="http://people.skolelinux.org/pere/blog/tags/nuug">nuug (118)</a></li>
926
927 <li><a href="http://people.skolelinux.org/pere/blog/tags/open311">open311 (2)</a></li>
928
929 <li><a href="http://people.skolelinux.org/pere/blog/tags/opphavsrett">opphavsrett (21)</a></li>
930
931 <li><a href="http://people.skolelinux.org/pere/blog/tags/personvern">personvern (42)</a></li>
932
933 <li><a href="http://people.skolelinux.org/pere/blog/tags/reprap">reprap (11)</a></li>
934
935 <li><a href="http://people.skolelinux.org/pere/blog/tags/rfid">rfid (2)</a></li>
936
937 <li><a href="http://people.skolelinux.org/pere/blog/tags/robot">robot (4)</a></li>
938
939 <li><a href="http://people.skolelinux.org/pere/blog/tags/rss">rss (1)</a></li>
940
941 <li><a href="http://people.skolelinux.org/pere/blog/tags/sikkerhet">sikkerhet (23)</a></li>
942
943 <li><a href="http://people.skolelinux.org/pere/blog/tags/sitesummary">sitesummary (3)</a></li>
944
945 <li><a href="http://people.skolelinux.org/pere/blog/tags/standard">standard (24)</a></li>
946
947 <li><a href="http://people.skolelinux.org/pere/blog/tags/stavekontroll">stavekontroll (1)</a></li>
948
949 <li><a href="http://people.skolelinux.org/pere/blog/tags/stortinget">stortinget (2)</a></li>
950
951 <li><a href="http://people.skolelinux.org/pere/blog/tags/surveillance">surveillance (9)</a></li>
952
953 <li><a href="http://people.skolelinux.org/pere/blog/tags/video">video (20)</a></li>
954
955 <li><a href="http://people.skolelinux.org/pere/blog/tags/vitenskap">vitenskap (1)</a></li>
956
957 <li><a href="http://people.skolelinux.org/pere/blog/tags/web">web (16)</a></li>
958
959 </ul>
960
961 </div>
962 </body>
963 </html>