1 <?xml version=
"1.0" encoding=
"utf-8"?>
2 <rss version='
2.0' xmlns:lj='http://www.livejournal.org/rss/lj/
1.0/'
>
4 <title>Petter Reinholdtsen - Entries tagged bootsystem
</title>
5 <description>Entries tagged bootsystem
</description>
6 <link>http://people.skolelinux.org/pere/blog/
</link>
10 <title>How to stay with sysvinit in Debian Jessie
</title>
11 <link>http://people.skolelinux.org/pere/blog/How_to_stay_with_sysvinit_in_Debian_Jessie.html
</link>
12 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/How_to_stay_with_sysvinit_in_Debian_Jessie.html
</guid>
13 <pubDate>Sat,
22 Nov
2014 01:
00:
00 +
0100</pubDate>
14 <description><p
>By now, it is well known that Debian Jessie will not be using
15 sysvinit as its boot system by default. But how can one keep using
16 sysvinit in Jessie? It is fairly easy, and here are a few recipes,
18 <a href=
"http://www.vitavonni.de/blog/
201410/
2014102101-avoiding-systemd.html
">Erich
19 Schubert
</a
> and
20 <a href=
"http://smcv.pseudorandom.co.uk/
2014/still_universal/
">Simon
23 <p
>If you already are using Wheezy and want to upgrade to Jessie and
24 keep sysvinit as your boot system, create a file
25 <tt
>/etc/apt/preferences.d/use-sysvinit
</tt
> with this content before
26 you upgrade:
</p
>
28 <p
><blockquote
><pre
>
32 </pre
></blockquote
><p
>
34 <p
>This file content will tell apt and aptitude to not consider
35 installing systemd-sysv as part of any installation and upgrade
36 solution when resolving dependencies, and thus tell it to avoid
37 systemd as a default boot system. The end result should be that the
38 upgraded system keep using sysvinit.
</p
>
40 <p
>If you are installing Jessie for the first time, there is no way to
41 get sysvinit installed by default (debootstrap used by
42 debian-installer have no option for this), but one can tell the
43 installer to switch to sysvinit before the first boot. Either by
44 using a kernel argument to the installer, or by adding a line to the
45 preseed file used. First, the kernel command line argument:
47 <p
><blockquote
><pre
>
48 preseed/late_command=
"in-target apt-get install --purge -y sysvinit-core
"
49 </pre
></blockquote
><p
>
51 <p
>Next, the line to use in a preseed file:
</p
>
53 <p
><blockquote
><pre
>
54 d-i preseed/late_command string in-target apt-get install -y sysvinit-core
55 </pre
></blockquote
><p
>
57 <p
>One can of course also do this after the first boot by installing
58 the sysvinit-core package.
</p
>
60 <p
>I recommend only using sysvinit if you really need it, as the
61 sysvinit boot sequence in Debian have several hardware specific bugs
62 on Linux caused by the fact that it is unpredictable when hardware
63 devices show up during boot. But on the other hand, the new default
64 boot system still have a few rough edges I hope will be fixed before
65 Jessie is released.
</p
>
67 <p
>Update
2014-
11-
26: Inspired by
68 <ahref=
"https://www.mirbsd.org/permalinks/wlog-
10-tg_e20141125-tg.htm#e20141125-tg_wlog-
10-tg
">a
69 blog post by Torsten Glaser
</a
>, added --purge to the preseed
75 <title>Testing sysvinit from experimental in Debian Hurd
</title>
76 <link>http://people.skolelinux.org/pere/blog/Testing_sysvinit_from_experimental_in_Debian_Hurd.html
</link>
77 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Testing_sysvinit_from_experimental_in_Debian_Hurd.html
</guid>
78 <pubDate>Mon,
3 Feb
2014 13:
40:
00 +
0100</pubDate>
79 <description><p
>A few days ago I decided to try to help the Hurd people to get
80 their changes into sysvinit, to allow them to use the normal sysvinit
81 boot system instead of their old one. This follow up on the
82 <a href=
"https://teythoon.cryptobitch.de//categories/gsoc.html
">great
83 Google Summer of Code work
</a
> done last summer by Justus Winter to
84 get Debian on Hurd working more like Debian on Linux. To get started,
85 I downloaded a prebuilt hard disk image from
86 <a href=
"http://ftp.debian-ports.org/debian-cd/hurd-i386/current/debian-hurd.img.tar.gz
">http://ftp.debian-ports.org/debian-cd/hurd-i386/current/debian-hurd.img.tar.gz
</a
>,
87 and started it using virt-manager.
</p
>
89 <p
>The first think I had to do after logging in (root without any
90 password) was to get the network operational. I followed
91 <a href=
"https://www.debian.org/ports/hurd/hurd-install
">the
92 instructions on the Debian GNU/Hurd ports page
</a
> and ran these
93 commands as root to get the machine to accept a IP address from the
94 kvm internal DHCP server:
</p
>
96 <p
><blockquote
><pre
>
97 settrans -fgap /dev/netdde /hurd/netdde
98 kill $(ps -ef|awk
'/[p]finet/ { print $
2}
')
99 kill $(ps -ef|awk
'/[d]evnode/ { print $
2}
')
101 </pre
></blockquote
></p
>
103 <p
>After this, the machine had internet connectivity, and I could
104 upgrade it and install the sysvinit packages from experimental and
105 enable it as the default boot system in Hurd.
</p
>
107 <p
>But before I did that, I set a password on the root user, as ssh is
108 running on the machine it for ssh login to work a password need to be
109 set. Also, note that a bug somewhere in openssh on Hurd block
110 compression from working. Remember to turn that off on the client
113 <p
>Run these commands as root to upgrade and test the new sysvinit
116 <p
><blockquote
><pre
>
117 cat
> /etc/apt/sources.list.d/experimental.list
&lt;
&lt;EOF
118 deb http://http.debian.net/debian/ experimental main
122 apt-get install -t experimental initscripts sysv-rc sysvinit \
123 sysvinit-core sysvinit-utils
124 update-alternatives --config runsystem
125 </pre
></blockquote
></p
>
127 <p
>To reboot after switching boot system, you have to use
128 <tt
>reboot-hurd
</tt
> instead of just
<tt
>reboot
</tt
>, as there is not
129 yet a sysvinit process able to receive the signals from the normal
130 'reboot
' command. After switching to sysvinit as the boot system,
131 upgrading every package and rebooting, the network come up with DHCP
132 after boot as it should, and the settrans/pkill hack mentioned at the
133 start is no longer needed. But for some strange reason, there are no
134 longer any login prompt in the virtual console, so I logged in using
137 <p
>Note that there are some race conditions in Hurd making the boot
138 fail some times. No idea what the cause is, but hope the Hurd porters
139 figure it out. At least Justus said on IRC (#debian-hurd on
140 irc.debian.org) that they are aware of the problem. A way to reduce
141 the impact is to upgrade to the Hurd packages built by Justus by
142 adding this repository to the machine:
</p
>
144 <p
><blockquote
><pre
>
145 cat
> /etc/apt/sources.list.d/hurd-ci.list
&lt;
&lt;EOF
146 deb http://darnassus.sceen.net/~teythoon/hurd-ci/ sid main
148 </pre
></blockquote
></p
>
150 <p
>At the moment the prebuilt virtual machine get some packages from
151 http://ftp.debian-ports.org/debian, because some of the packages in
152 unstable do not yet include the required patches that are lingering in
153 BTS. This is the completely list of
"unofficial
" packages installed:
</p
>
155 <p
><blockquote
><pre
>
156 # aptitude search
'?narrow(?version(CURRENT),?origin(Debian Ports))
'
157 i emacs - GNU Emacs editor (metapackage)
159 i hurd-recommended - Miscellaneous translators
160 i isc-dhcp-client - ISC DHCP client
161 i isc-dhcp-common - common files used by all the isc-dhcp* packages
162 i libc-bin - Embedded GNU C Library: Binaries
163 i libc-dev-bin - Embedded GNU C Library: Development binaries
164 i libc0.3 - Embedded GNU C Library: Shared libraries
165 i A libc0.3-dbg - Embedded GNU C Library: detached debugging symbols
166 i libc0.3-dev - Embedded GNU C Library: Development Libraries and Hea
167 i multiarch-support - Transitional package to ensure multiarch compatibilit
168 i A x11-common - X Window System (X.Org) infrastructure
169 i xorg - X.Org X Window System
170 i A xserver-xorg - X.Org X server
171 i A xserver-xorg-input-all - X.Org X server -- input driver metapackage
173 </pre
></blockquote
></p
>
175 <p
>All in all, testing hurd has been an interesting experience. :)
176 X.org did not work out of the box and I never took the time to follow
177 the porters instructions to fix it. This time I was interested in the
178 command line stuff.
<p
>
183 <title>Debian init.d boot script example for rsyslog
</title>
184 <link>http://people.skolelinux.org/pere/blog/Debian_init_d_boot_script_example_for_rsyslog.html
</link>
185 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Debian_init_d_boot_script_example_for_rsyslog.html
</guid>
186 <pubDate>Sat,
2 Nov
2013 22:
40:
00 +
0100</pubDate>
187 <description><p
>If one of the points of switching to a new init system in Debian is
188 <a href=
"http://thomas.goirand.fr/blog/?p=
147">to get rid of huge
189 init.d scripts
</a
>, I doubt we need to switch away from sysvinit and
190 init.d scripts at all. Here is an example init.d script, ie a rewrite
191 of /etc/init.d/rsyslog:
</p
>
194 #!/lib/init/init-d-script
197 # Required-Start: $remote_fs $time
198 # Required-Stop: umountnfs $time
199 # X-Stop-After: sendsigs
200 # Default-Start:
2 3 4 5
201 # Default-Stop:
0 1 6
202 # Short-Description: enhanced syslogd
203 # Description: Rsyslog is an enhanced multi-threaded syslogd.
204 # It is quite compatible to stock sysklogd and can be
205 # used as a drop-in replacement.
207 DESC=
"enhanced syslogd
"
208 DAEMON=/usr/sbin/rsyslogd
209 </pre
></p
>
211 <p
>Pretty minimalistic to me... For the record, the original sysv-rc
212 script was
137 lines, and the above is just
15 lines, most of it meta
213 info/comments.
</p
>
215 <p
>How to do this, you ask? Well, one create a new script
216 /lib/init/init-d-script looking something like this:
221 # Define LSB log_* functions.
222 # Depend on lsb-base (
>=
3.2-
14) to ensure that this file is present
223 # and status_of_proc is working.
224 . /lib/lsb/init-functions
227 # Function that starts the daemon/service
233 #
0 if daemon has been started
234 #
1 if daemon was already running
235 #
2 if daemon could not be started
236 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test
> /dev/null \
238 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
241 # Add code here, if necessary, that waits for the process to be ready
242 # to handle requests from services started subsequently which depend
243 # on this one. As a last resort, sleep for some time.
247 # Function that stops the daemon/service
252 #
0 if daemon has been stopped
253 #
1 if daemon was already stopped
254 #
2 if daemon could not be stopped
255 # other if a failure occurred
256 start-stop-daemon --stop --quiet --retry=TERM/
30/KILL/
5 --pidfile $PIDFILE --name $NAME
257 RETVAL=
"$?
"
258 [
"$RETVAL
" =
2 ]
&& return
2
259 # Wait for children to finish too if this is a daemon that forks
260 # and if the daemon is only ever run from this initscript.
261 # If the above conditions are not satisfied then add some other code
262 # that waits for the process to drop all resources that could be
263 # needed by services started subsequently. A last resort is to
264 # sleep for some time.
265 start-stop-daemon --stop --quiet --oknodo --retry=
0/
30/KILL/
5 --exec $DAEMON
266 [
"$?
" =
2 ]
&& return
2
267 # Many daemons don
't delete their pidfiles when they exit.
269 return
"$RETVAL
"
273 # Function that sends a SIGHUP to the daemon/service
277 # If the daemon can reload its configuration without
278 # restarting (for example, when it is sent a SIGHUP),
279 # then implement that here.
281 start-stop-daemon --stop --signal
1 --quiet --pidfile $PIDFILE --name $NAME
286 scriptbasename=
"$(basename $
1)
"
287 echo
"SN: $scriptbasename
"
288 if [
"$scriptbasename
" !=
"init-d-library
" ] ; then
289 script=
"$
1"
296 NAME=$(basename $DAEMON)
297 PIDFILE=/var/run/$NAME.pid
299 # Exit if the package is not installed
300 #[ -x
"$DAEMON
" ] || exit
0
302 # Read configuration variable file if it is present
303 [ -r /etc/default/$NAME ]
&& . /etc/default/$NAME
305 # Load the VERBOSE setting and other rcS variables
308 case
"$
1" in
310 [
"$VERBOSE
" != no ]
&& log_daemon_msg
"Starting $DESC
" "$NAME
"
312 case
"$?
" in
313 0|
1) [
"$VERBOSE
" != no ]
&& log_end_msg
0 ;;
314 2) [
"$VERBOSE
" != no ]
&& log_end_msg
1 ;;
318 [
"$VERBOSE
" != no ]
&& log_daemon_msg
"Stopping $DESC
" "$NAME
"
320 case
"$?
" in
321 0|
1) [
"$VERBOSE
" != no ]
&& log_end_msg
0 ;;
322 2) [
"$VERBOSE
" != no ]
&& log_end_msg
1 ;;
326 status_of_proc
"$DAEMON
" "$NAME
" && exit
0 || exit $?
328 #reload|force-reload)
330 # If do_reload() is not implemented then leave this commented out
331 # and leave
'force-reload
' as an alias for
'restart
'.
333 #log_daemon_msg
"Reloading $DESC
" "$NAME
"
337 restart|force-reload)
339 # If the
"reload
" option is implemented then remove the
340 #
'force-reload
' alias
342 log_daemon_msg
"Restarting $DESC
" "$NAME
"
344 case
"$?
" in
347 case
"$?
" in
349 1) log_end_msg
1 ;; # Old process is still running
350 *) log_end_msg
1 ;; # Failed to start
360 echo
"Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}
" >&2
366 </pre
></p
>
368 <p
>It is based on /etc/init.d/skeleton, and could be improved quite a
369 lot. I did not really polish the approach, so it might not always
370 work out of the box, but you get the idea. I did not try very hard to
371 optimize it nor make it more robust either.
</p
>
373 <p
>A better argument for switching init system in Debian than reducing
374 the size of init scripts (which is a good thing to do anyway), is to
375 get boot system that is able to handle the kernel events sensibly and
376 robustly, and do not depend on the boot to run sequentially. The boot
377 and the kernel have not behaved sequentially in years.
</p
>
382 <title>How is booting into runlevel
1 different from single user boots?
</title>
383 <link>http://people.skolelinux.org/pere/blog/How_is_booting_into_runlevel_1_different_from_single_user_boots_.html
</link>
384 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/How_is_booting_into_runlevel_1_different_from_single_user_boots_.html
</guid>
385 <pubDate>Thu,
4 Aug
2011 12:
40:
00 +
0200</pubDate>
386 <description><p
>Wouter Verhelst have some
387 <a href=
"http://grep.be/blog/en/retorts/pere_kubuntu_boot
">interesting
388 comments and opinions
</a
> on my blog post on
389 <a href=
"http://people.skolelinux.org/pere/blog/What_should_start_from__etc_rcS_d__in_Debian____almost_nothing.html
">the
390 need to clean up /etc/rcS.d/ in Debian
</a
> and my blog post about
391 <a href=
"http://people.skolelinux.org/pere/blog/What_is_missing_in_the_Debian_desktop__or_why_my_parents_use_Kubuntu.html
">the
392 default KDE desktop in Debian
</a
>. I only have time to address one
393 small piece of his comment now, and though it best to address the
394 misunderstanding he bring forward:
</p
>
396 <p
><blockquote
>
397 Currently, a system admin has four options: [...] boot to a
398 single-user system (by adding
'single
' to the kernel command line;
399 this runs rcS and rc1 scripts)
400 </blockquote
></p
>
402 <p
>This make me believe Wouter believe booting into single user mode
403 and booting into runlevel
1 is the same. I am not surprised he
404 believe this, because it would make sense and is a quite sensible
405 thing to believe. But because the boot in Debian is slightly broken,
406 runlevel
1 do not work properly and it isn
't the same as single user
407 mode. I
'll try to explain what is actually happing, but it is a bit
408 hard to explain.
</p
>
410 <p
>Single user mode is defined like this in /etc/inittab:
411 "<tt
>~~:S:wait:/sbin/sulogin
</tt
>". This means the only thing that is
412 executed in single user mode is sulogin. Single user mode is a boot
413 state
"between
" the runlevels, and when booting into single user mode,
414 only the scripts in /etc/rcS.d/ are executed before the init process
415 enters the single user state. When switching to runlevel
1, the state
416 is in fact not ending in runlevel
1, but it passes through runlevel
1
417 and end up in the single user mode (see /etc/rc1.d/S03single, which
418 runs
"init -t1 S
" to switch to single user mode at the end of runlevel
419 1. It is confusing that the
'S
' (single user) init mode is not the
420 mode enabled by /etc/rcS.d/ (which is more like the initial boot
423 <p
>This summary might make it clearer. When booting for the first
424 time into single user mode, the following commands are executed:
425 "<tt
>/etc/init.d/rc S; /sbin/sulogin
</tt
>". When booting into
426 runlevel
1, the following commands are executed:
"<tt
>/etc/init.d/rc
427 S; /etc/init.d/rc
1; /sbin/sulogin
</tt
>". A problem show up when
428 trying to continue after visiting single user mode. Not all services
429 are started again as they should, causing the machine to end up in an
430 unpredicatble state. This is why Debian admins recommend rebooting
431 after visiting single user mode.
</p
>
433 <p
>A similar problem with runlevel
1 is caused by the amount of
434 scripts executed from /etc/rcS.d/. When switching from say runlevel
2
435 to runlevel
1, the services started from /etc/rcS.d/ are not properly
436 stopped when passing through the scripts in /etc/rc1.d/, and not
437 started again when switching away from runlevel
1 to the runlevels
438 2-
5. I believe the problem is best fixed by moving all the scripts
439 out of /etc/rcS.d/ that are not
<strong
>required
</strong
> to get a
440 functioning single user mode during boot.
</p
>
442 <p
>I have spent several years investigating the Debian boot system,
443 and discovered this problem a few years ago. I suspect it originates
444 from when sysvinit was introduced into Debian, a long time ago.
</p
>
449 <title>What should start from /etc/rcS.d/ in Debian? - almost nothing
</title>
450 <link>http://people.skolelinux.org/pere/blog/What_should_start_from__etc_rcS_d__in_Debian____almost_nothing.html
</link>
451 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/What_should_start_from__etc_rcS_d__in_Debian____almost_nothing.html
</guid>
452 <pubDate>Sat,
30 Jul
2011 14:
00:
00 +
0200</pubDate>
453 <description><p
>In the Debian boot system, several packages include scripts that
454 are started from /etc/rcS.d/. In fact, there is a bite more of them
455 than make sense, and this causes a few problems. What kind of
456 problems, you might ask. There are at least two problems. The first
457 is that it is not possible to recover a machine after switching to
458 runlevel
1. One need to actually reboot to get the machine back to
459 the expected state. The other is that single user boot will sometimes
460 run into problems because some of the subsystems are activated before
461 the root login is presented, causing problems when trying to recover a
462 machine from a problem in that subsystem. A minor additional point is
463 that moving more scripts out of rcS.d/ and into the other rc#.d/
464 directories will increase the amount of scripts that can run in
465 parallel during boot, and thus decrease the boot time.
</p
>
467 <p
>So, which scripts should start from rcS.d/. In short, only the
468 scripts that _have_ to execute before the root login prompt is
469 presented during a single user boot should go there. Everything else
470 should go into the numeric runlevels. This means things like
471 lm-sensors, fuse and x11-common should not run from rcS.d, but from
472 the numeric runlevels. Today in Debian, there are around
115 init.d
473 scripts that are started from rcS.d/, and most of them should be moved
474 out. Do your package have one of them? Please help us make single
475 user and runlevel
1 better by moving it.
</p
>
477 <p
>Scripts setting up the screen, keyboard, system partitions
478 etc. should still be started from rcS.d/, but there is for example no
479 need to have the network enabled before the single user login prompt
480 is presented.
</p
>
482 <p
>As always, things are not so easy to fix as they sound. To keep
483 Debian systems working while scripts migrate and during upgrades, the
484 scripts need to be moved from rcS.d/ to rc2.d/ in reverse dependency
485 order, ie the scripts that nothing in rcS.d/ depend on can be moved,
486 and the next ones can only be moved when their dependencies have been
487 moved first. This migration must be done sequentially while we ensure
488 that the package system upgrade packages in the right order to keep
489 the system state correct. This will require some coordination when it
490 comes to network related packages, but most of the packages with
491 scripts that should migrate do not have anything in rcS.d/ depending
492 on them. Some packages have already been updated, like the sudo
493 package, while others are still left to do. I wish I had time to work
494 on this myself, but real live constrains make it unlikely that I will
495 find time to push this forward.
</p
>
500 <title>Automatic upgrade testing from Lenny to Squeeze
</title>
501 <link>http://people.skolelinux.org/pere/blog/Automatic_upgrade_testing_from_Lenny_to_Squeeze.html
</link>
502 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Automatic_upgrade_testing_from_Lenny_to_Squeeze.html
</guid>
503 <pubDate>Fri,
11 Jun
2010 22:
50:
00 +
0200</pubDate>
504 <description><p
>The last few days I have done some upgrade testing in Debian, to
505 see if the upgrade from Lenny to Squeeze will go smoothly. A few bugs
506 have been discovered and reported in the process
507 (
<a href=
"http://bugs.debian.org/
585410">#
585410</a
> in nagios3-cgi,
508 <a href=
"http://bugs.debian.org/
584879">#
584879</a
> already fixed in
509 enscript and
<a href=
"http://bugs.debian.org/
584861">#
584861</a
> in
510 kdebase-workspace-data), and to get a more regular testing going on, I
511 am working on a script to automate the test.
</p
>
513 <p
>The idea is to create a Lenny chroot and use tasksel to install a
514 Gnome or KDE desktop installation inside the chroot before upgrading
515 it. To ensure no services are started in the chroot, a policy-rc.d
516 script is inserted. To make sure tasksel believe it is to install a
517 desktop on a laptop, the tasksel tests are replaced in the chroot
518 (only acceptable because this is a throw-away chroot).
</p
>
520 <p
>A naive upgrade from Lenny to Squeeze using aptitude dist-upgrade
521 currently always fail because udev refuses to upgrade with the kernel
522 in Lenny, so to avoid that problem the file /etc/udev/kernel-upgrade
523 is created. The bug report
524 <a href=
"http://bugs.debian.org/
566000">#
566000</a
> make me suspect
525 this problem do not trigger in a chroot, but I touch the file anyway
526 to make sure the upgrade go well. Testing on virtual and real
527 hardware have failed me because of udev so far, and creating this file
528 do the trick in such settings anyway. This is a
529 <a href=
"http://www.linuxquestions.org/questions/debian-
26/failed-dist-upgrade-due-to-udev-config_sysfs_deprecated-nonsense-
804130/
">known
530 issue
</a
> and the current udev behaviour is intended by the udev
531 maintainer because he lack the resources to rewrite udev to keep
532 working with old kernels or something like that. I really wish the
533 udev upstream would keep udev backwards compatible, to avoid such
534 upgrade problem, but given that they fail to do so, I guess
535 documenting the way out of this mess is the best option we got for
536 Debian Squeeze.
</p
>
538 <p
>Anyway, back to the task at hand, testing upgrades. This test
539 script, which I call
<tt
>upgrade-test
</tt
> for now, is doing the
542 <blockquote
><pre
>
546 if [
"$
1" ] ; then
555 exec
&lt; /dev/null
557 mirror=http://ftp.skolelinux.org/debian
558 tmpdir=chroot-$from-upgrade-$to-$desktop
560 debootstrap $from $tmpdir $mirror
561 chroot $tmpdir aptitude update
562 cat
> $tmpdir/usr/sbin/policy-rc.d
&lt;
&lt;EOF
566 chmod a+rx $tmpdir/usr/sbin/policy-rc.d
570 mount -t proc proc $tmpdir/proc
571 # Make sure proc is unmounted also on failure
572 trap exit_cleanup EXIT INT
574 chroot $tmpdir aptitude -y install debconf-utils
576 # Make sure tasksel autoselection trigger. It need the test scripts
577 # to return the correct answers.
578 echo tasksel tasksel/desktop multiselect $desktop | \
579 chroot $tmpdir debconf-set-selections
581 # Include the desktop and laptop task
582 for test in desktop laptop ; do
583 echo
> $tmpdir/usr/lib/tasksel/tests/$test
&lt;
&lt;EOF
587 chmod a+rx $tmpdir/usr/lib/tasksel/tests/$test
590 DEBIAN_FRONTEND=noninteractive
591 DEBIAN_PRIORITY=critical
592 export DEBIAN_FRONTEND DEBIAN_PRIORITY
593 chroot $tmpdir tasksel --new-install
595 echo deb $mirror $to main
> $tmpdir/etc/apt/sources.list
596 chroot $tmpdir aptitude update
597 touch $tmpdir/etc/udev/kernel-upgrade
598 chroot $tmpdir aptitude -y dist-upgrade
600 </pre
></blockquote
>
602 <p
>I suspect it would be useful to test upgrades with both apt-get and
603 with aptitude, but I have not had time to look at how they behave
604 differently so far. I hope to get a cron job running to do the test
605 regularly and post the result on the web. The Gnome upgrade currently
606 work, while the KDE upgrade fail because of the bug in
607 kdebase-workspace-data
</p
>
609 <p
>I am not quite sure what kind of extract from the huge upgrade logs
610 (KDE
167 KiB, Gnome
516 KiB) it make sense to include in this blog
611 post, so I will refrain from trying. I can report that for Gnome,
612 aptitude report
760 packages upgraded,
448 newly installed,
129 to
613 remove and
1 not upgraded and
1024MB need to be downloaded while for
614 KDE the same numbers are
702 packages upgraded,
507 newly installed,
615 193 to remove and
0 not upgraded and
1117MB need to be downloaded
</p
>
617 <p
>I am very happy to notice that the Gnome desktop + laptop upgrade
618 is able to migrate to dependency based boot sequencing and parallel
619 booting without a hitch. Was unsure if there were still bugs with
620 packages failing to clean up their obsolete init.d script during
621 upgrades, and no such problem seem to affect the Gnome desktop+laptop
627 <title>Upstart or sysvinit - as init.d scripts see it
</title>
628 <link>http://people.skolelinux.org/pere/blog/Upstart_or_sysvinit___as_init_d_scripts_see_it.html
</link>
629 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Upstart_or_sysvinit___as_init_d_scripts_see_it.html
</guid>
630 <pubDate>Sun,
6 Jun
2010 23:
55:
00 +
0200</pubDate>
631 <description><p
>If Debian is to migrate to upstart on Linux, I expect some init.d
632 scripts to migrate (some of) their operations to upstart job while
633 keeping the init.d for hurd and kfreebsd. The packages with such
634 needs will need a way to get their init.d scripts to behave
635 differently when used with sysvinit and with upstart. Because of
636 this, I had a look at the environment variables set when a init.d
637 script is running under upstart, and when it is not.
</p
>
639 <p
>With upstart, I notice these environment variables are set when a
640 script is started from rcS.d/ (ignoring some irrelevant ones like
643 <blockquote
><pre
>
649 UPSTART_EVENTS=startup
651 UPSTART_JOB=rc-sysinit
652 </pre
></blockquote
>
654 <p
>With sysvinit, these environment variables are set for the same
657 <blockquote
><pre
>
658 INIT_VERSION=sysvinit-
2.88
663 </pre
></blockquote
>
665 <p
>The RUNLEVEL and PREVLEVEL environment variables passed on from
666 sysvinit are not set by upstart. Not sure if it is intentional or not
667 to not be compatible with sysvinit in this regard.
</p
>
669 <p
>For scripts needing to behave differently when upstart is used,
670 looking for the UPSTART_JOB environment variable seem to be a good
676 <title>KDM fail at boot with NVidia cards - and no one try to fix it?
</title>
677 <link>http://people.skolelinux.org/pere/blog/KDM_fail_at_boot_with_NVidia_cards___and_no_one_try_to_fix_it_.html
</link>
678 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/KDM_fail_at_boot_with_NVidia_cards___and_no_one_try_to_fix_it_.html
</guid>
679 <pubDate>Tue,
1 Jun
2010 17:
05:
00 +
0200</pubDate>
680 <description><p
>It is strange to watch how a bug in Debian causing KDM to fail to
681 start at boot when an NVidia video card is used is handled. The
682 problem seem to be that the nvidia X.org driver uses a long time to
683 initialize, and this duration is longer than kdm is configured to
686 <p
>I came across two bugs related to this issue,
687 <a href=
"http://bugs.debian.org/
583312">#
583312</a
> initially filed
688 against initscripts and passed on to nvidia-glx when it became obvious
689 that the nvidia drivers were involved, and
690 <a href=
"http://bugs.debian.org/
524751">#
524751</a
> initially filed against
691 kdm and passed on to src:nvidia-graphics-drivers for unknown reasons.
</p
>
693 <p
>To me, it seem that no-one is interested in actually solving the
694 problem nvidia video card owners experience and make sure the Debian
695 distribution work out of the box for these users. The nvidia driver
696 maintainers expect kdm to be set up to wait longer, while kdm expect
697 the nvidia driver maintainers to fix the driver to start faster, and
698 while they wait for each other I guess the users end up switching to a
699 distribution that work for them. I have no idea what the solution is,
700 but I am pretty sure that waiting for each other is not it.
</p
>
702 <p
>I wonder why we end up handling bugs this way.
</p
>
707 <title>Parallellized boot seem to hold up well in Debian/testing
</title>
708 <link>http://people.skolelinux.org/pere/blog/Parallellized_boot_seem_to_hold_up_well_in_Debian_testing.html
</link>
709 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Parallellized_boot_seem_to_hold_up_well_in_Debian_testing.html
</guid>
710 <pubDate>Thu,
27 May
2010 23:
55:
00 +
0200</pubDate>
711 <description><p
>A few days ago, parallel booting was enabled in Debian/testing.
712 The feature seem to hold up pretty well, but three fairly serious
713 issues are known and should be solved:
717 <li
>The wicd package seen to
718 <a href=
"http://bugs.debian.org/
508289">break NFS mounting
</a
> and
719 <a href=
"http://bugs.debian.org/
581586">network setup
</a
> when
720 parallel booting is enabled. No idea why, but the wicd maintainer
721 seem to be on the case.
</li
>
723 <li
>The nvidia X driver seem to
724 <a href=
"http://bugs.debian.org/
583312">have a race condition
</a
>
725 triggered more easily when parallel booting is in effect. The
726 maintainer is on the case.
</li
>
728 <li
>The sysv-rc package fail to properly enable dependency based boot
729 sequencing (the shutdown is broken) when old file-rc users
730 <a href=
"http://bugs.debian.org/
575080">try to switch back
</a
> to
731 sysv-rc. One way to solve it would be for file-rc to create
732 /etc/init.d/.legacy-bootordering, and another is to try to make
733 sysv-rc more robust. Will investigate some more and probably upload a
734 workaround in sysv-rc to help those trying to move from file-rc to
735 sysv-rc get a working shutdown.
</li
>
737 </ul
></p
>
739 <p
>All in all not many surprising issues, and all of them seem
740 solvable before Squeeze is released. In addition to these there are
741 some packages with bugs in their dependencies and run level settings,
742 which I expect will be fixed in a reasonable time span.
</p
>
744 <p
>If you report any problems with dependencies in init.d scripts to
745 the BTS, please usertag the report to get it to show up at
746 <a href=
"http://bugs.debian.org/cgi-bin/pkgreport.cgi?users=initscripts-ng-devel@lists.alioth.debian.org
">the
747 list of usertagged bugs related to this
</a
>.
</p
>
749 <p
>Update: Correct bug number to file-rc issue.
</p
>
754 <title>Parallellized boot is now the default in Debian/unstable
</title>
755 <link>http://people.skolelinux.org/pere/blog/Parallellized_boot_is_now_the_default_in_Debian_unstable.html
</link>
756 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Parallellized_boot_is_now_the_default_in_Debian_unstable.html
</guid>
757 <pubDate>Fri,
14 May
2010 22:
40:
00 +
0200</pubDate>
758 <description><p
>Since this evening, parallel booting is the default in
759 Debian/unstable for machines using dependency based boot sequencing.
760 Apparently the testing of concurrent booting has been wider than
761 expected, if I am to believe the
762 <a href=
"http://lists.debian.org/debian-devel/
2010/
05/msg00122.html
">input
763 on debian-devel@
</a
>, and I concluded a few days ago to move forward
764 with the feature this weekend, to give us some time to detect any
765 remaining problems before Squeeze is frozen. If serious problems are
766 detected, it is simple to change the default back to sequential boot.
767 The upload of the new sysvinit package also activate a new upstream
770 More information about
771 <a href=
"http://wiki.debian.org/LSBInitScripts/DependencyBasedBoot
">dependency
772 based boot sequencing
</a
> is available from the Debian wiki. It is
773 currently possible to disable parallel booting when one run into
774 problems caused by it, by adding this line to /etc/default/rcS:
</p
>
776 <blockquote
><pre
>
778 </pre
></blockquote
>
780 <p
>If you report any problems with dependencies in init.d scripts to
781 the BTS, please usertag the report to get it to show up at
782 <a href=
"http://bugs.debian.org/cgi-bin/pkgreport.cgi?users=initscripts-ng-devel@lists.alioth.debian.org
">the
783 list of usertagged bugs related to this
</a
>.
</p
>
788 <title>systemd, an interesting alternative to upstart
</title>
789 <link>http://people.skolelinux.org/pere/blog/systemd__an_interesting_alternative_to_upstart.html
</link>
790 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/systemd__an_interesting_alternative_to_upstart.html
</guid>
791 <pubDate>Thu,
13 May
2010 22:
20:
00 +
0200</pubDate>
792 <description><p
>The last few days a new boot system called
793 <a href=
"http://www.freedesktop.org/wiki/Software/systemd
">systemd
</a
>
795 <a href=
"http://
0pointer.de/blog/projects/systemd.html
">introduced
</a
>
797 to the free software world. I have not yet had time to play around
798 with it, but it seem to be a very interesting alternative to
799 <a href=
"http://upstart.ubuntu.com/
">upstart
</a
>, and might prove to be
800 a good alternative for Debian when we are able to switch to an event
801 based boot system. Tollef is
802 <a href=
"http://bugs.debian.org/
580814">in the process
</a
> of getting
803 systemd into Debian, and I look forward to seeing how well it work. I
804 like the fact that systemd handles init.d scripts with dependency
805 information natively, allowing them to run in parallel where upstart
806 at the moment do not.
</p
>
808 <p
>Unfortunately do systemd have the same problem as upstart regarding
809 platform support. It only work on recent Linux kernels, and also need
810 some new kernel features enabled to function properly. This means
811 kFreeBSD and Hurd ports of Debian will need a port or a different boot
812 system. Not sure how that will be handled if systemd proves to be the
813 way forward.
</p
>
815 <p
>In the mean time, based on the
816 <a href=
"http://lists.debian.org/debian-devel/
2010/
05/msg00122.html
">input
817 on debian-devel@
</a
> regarding parallel booting in Debian, I have
818 decided to enable full parallel booting as the default in Debian as
819 soon as possible (probably this weekend or early next week), to see if
820 there are any remaining serious bugs in the init.d dependencies. A
821 new version of the sysvinit package implementing this change is
822 already in experimental. If all go well, Squeeze will be released
823 with parallel booting enabled by default.
</p
>
828 <title>Parallellizing the boot in Debian Squeeze - ready for wider testing
</title>
829 <link>http://people.skolelinux.org/pere/blog/Parallellizing_the_boot_in_Debian_Squeeze___ready_for_wider_testing.html
</link>
830 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Parallellizing_the_boot_in_Debian_Squeeze___ready_for_wider_testing.html
</guid>
831 <pubDate>Thu,
6 May
2010 23:
25:
00 +
0200</pubDate>
832 <description><p
>These days, the init.d script dependencies in Squeeze are quite
833 complete, so complete that it is actually possible to run all the
834 init.d scripts in parallell based on these dependencies. If you want
835 to test your Squeeze system, make sure
836 <a href=
"http://wiki.debian.org/LSBInitScripts/DependencyBasedBoot
">dependency
837 based boot sequencing
</a
> is enabled, and add this line to
838 /etc/default/rcS:
</p
>
840 <blockquote
><pre
>
842 </pre
></blockquote
>
844 <p
>That is it. It will cause sysv-rc to use the startpar tool to run
845 scripts in parallel using the dependency information stored in
846 /etc/init.d/.depend.boot, /etc/init.d/.depend.start and
847 /etc/init.d/.depend.stop to order the scripts. Startpar is configured
848 to try to start the kdm and gdm scripts as early as possible, and will
849 start the facilities required by kdm or gdm as early as possible to
850 make this happen.
</p
>
852 <p
>Give it a try, and see if you like the result. If some services
853 fail to start properly, it is most likely because they have incomplete
854 init.d script dependencies in their startup script (or some of their
855 dependent scripts have incomplete dependencies). Report bugs and get
856 the package maintainers to fix it. :)
</p
>
858 <p
>Running scripts in parallel could be the default in Debian when we
859 manage to get the init.d script dependencies complete and correct. I
860 expect we will get there in Squeeze+
1, if we get manage to test and
861 fix the remaining issues.
</p
>
863 <p
>If you report any problems with dependencies in init.d scripts to
864 the BTS, please usertag the report to get it to show up at
865 <a href=
"http://bugs.debian.org/cgi-bin/pkgreport.cgi?users=initscripts-ng-devel@lists.alioth.debian.org
">the
866 list of usertagged bugs related to this
</a
>.
</p
>
871 <title>Debian has switched to dependency based boot sequencing
</title>
872 <link>http://people.skolelinux.org/pere/blog/Debian_has_switched_to_dependency_based_boot_sequencing.html
</link>
873 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Debian_has_switched_to_dependency_based_boot_sequencing.html
</guid>
874 <pubDate>Mon,
27 Jul
2009 23:
50:
00 +
0200</pubDate>
875 <description><p
>Since this evening, with the upload of sysvinit version
2.87dsf-
2,
876 and the upload of insserv version
1.12.0-
10 yesterday, Debian unstable
877 have been migrated to using dependency based boot sequencing. This
878 conclude work me and others have been doing for the last three days.
879 It feels great to see this finally part of the default Debian
880 installation. Now we just need to weed out the last few problems that
881 are bound to show up, to get everything ready for Squeeze.
</p
>
883 <p
>The next step is migrating /sbin/init from sysvinit to upstart, and
884 fixing the more fundamental problem of handing the event based
885 non-predictable kernel in the early boot.
</p
>
890 <title>Taking over sysvinit development
</title>
891 <link>http://people.skolelinux.org/pere/blog/Taking_over_sysvinit_development.html
</link>
892 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Taking_over_sysvinit_development.html
</guid>
893 <pubDate>Wed,
22 Jul
2009 23:
00:
00 +
0200</pubDate>
894 <description><p
>After several years of frustration with the lack of activity from
895 the existing sysvinit upstream developer, I decided a few weeks ago to
896 take over the package and become the new upstream. The number of
897 patches to track for the Debian package was becoming a burden, and the
898 lack of synchronization between the distribution made it hard to keep
899 the package up to date.
</p
>
901 <p
>On the new sysvinit team is the SuSe maintainer Dr. Werner Fink,
902 and my Debian co-maintainer Kel Modderman. About
10 days ago, I made
903 a new upstream tarball with version number
2.87dsf (for Debian, SuSe
904 and Fedora), based on the patches currently in use in these
905 distributions. We Debian maintainers plan to move to this tarball as
906 the new upstream as soon as we find time to do the merge. Since the
907 new tarball was created, we agreed with Werner at SuSe to make a new
908 upstream project at
<a href=
"http://savannah.nongnu.org/
">Savannah
</a
>, and continue
909 development there. The project is registered and currently waiting
910 for approval by the Savannah administrators, and as soon as it is
911 approved, we will import the old versions from svn and continue
912 working on the future release.
</p
>
914 <p
>It is a bit ironic that this is done now, when some of the involved
915 distributions are moving to upstart as a syvinit replacement.
</p
>
920 <title>Debian boots quicker and quicker
</title>
921 <link>http://people.skolelinux.org/pere/blog/Debian_boots_quicker_and_quicker.html
</link>
922 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Debian_boots_quicker_and_quicker.html
</guid>
923 <pubDate>Wed,
24 Jun
2009 21:
40:
00 +
0200</pubDate>
924 <description><p
>I spent Monday and tuesday this week in London with a lot of the
925 people involved in the boot system on Debian and Ubuntu, to see if we
926 could find more ways to speed up the boot system. This was an Ubuntu
928 <a href=
"https://wiki.ubuntu.com/FoundationsTeam/BootPerformance/DebianUbuntuSprint
">developer
929 gathering
</a
>. It was quite productive. We also discussed the future
930 of boot systems, and ways to handle the increasing number of boot
931 issues introduced by the Linux kernel becoming more and more
932 asynchronous and event base. The Ubuntu approach using udev and
933 upstart might be a good way forward. Time will show.
</p
>
935 <p
>Anyway, there are a few ways at the moment to speed up the boot
936 process in Debian. All of these should be applied to get a quick
941 <li
>Use dash as /bin/sh.
</li
>
943 <li
>Disable the init.d/hwclock*.sh scripts and make sure the hardware
944 clock is in UTC.
</li
>
946 <li
>Install and activate the insserv package to enable
947 <a href=
"http://wiki.debian.org/LSBInitScripts/DependencyBasedBoot
">dependency
948 based boot sequencing
</a
>, and enable concurrent booting.
</li
>
952 These points are based on the Google summer of code work done by
953 <a href=
"http://initscripts-ng.alioth.debian.org/soc2006-bootsystem/
">Carlos
956 <p
>Support for makefile-style concurrency during boot was uploaded to
957 unstable yesterday. When we tested it, we were able to cut
6 seconds
958 from the boot sequence. It depend on very correct dependency
959 declaration in all init.d scripts, so I expect us to find edge cases
960 where the dependences in some scripts are slightly wrong when we start
961 using this.
</p
>
963 <p
>On our IRC channel for this effort, #pkg-sysvinit, a new idea was
964 introduced by Raphael Geissert today, one that could affect the
965 startup speed as well. Instead of starting some scripts concurrently
966 from rcS.d/ and another set of scripts from rc2.d/, it would be
967 possible to run a of them in the same process. A quick way to test
968 this would be to enable insserv and run
'mv /etc/rc2.d/S* /etc/rcS.d/;
969 insserv
'. Will need to test if that work. :)
</p
>