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