]> pere.pagekite.me Git - homepage.git/blob - blog/tags/bootsystem/bootsystem.rss
7c4a35ebb3f79fe3a3362076716219fe0fb79e34
[homepage.git] / blog / tags / bootsystem / bootsystem.rss
1 <?xml version="1.0" encoding="utf-8"?>
2 <rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/'>
3 <channel>
4 <title>Petter Reinholdtsen - Entries tagged bootsystem</title>
5 <description>Entries tagged bootsystem</description>
6 <link>http://www.hungry.com/~pere/blog/</link>
7
8
9 <item>
10 <title>The SysVinit upstream project just migrated to git</title>
11 <link>http://www.hungry.com/~pere/blog/The_SysVinit_upstream_project_just_migrated_to_git.html</link>
12 <guid isPermaLink="true">http://www.hungry.com/~pere/blog/The_SysVinit_upstream_project_just_migrated_to_git.html</guid>
13 <pubDate>Sun, 18 Feb 2018 09:20:00 +0100</pubDate>
14 <description>&lt;p&gt;Surprising as it might sound, there are still computers using the
15 traditional Sys V init system, and there probably will be until
16 systemd start working on Hurd and FreeBSD.
17 &lt;a href=&quot;https://savannah.nongnu.org/projects/sysvinit&quot;&gt;The upstream
18 project still exist&lt;/a&gt;, though, and up until today, the upstream
19 source was available from Savannah via subversion. I am happy to
20 report that this just changed.&lt;/p&gt;
21
22 &lt;p&gt;The upstream source is now in Git, and consist of three
23 repositories:&lt;/p&gt;
24
25 &lt;ul&gt;
26
27 &lt;li&gt;&lt;a href=&quot;http://git.savannah.nongnu.org/cgit/sysvinit.git&quot;&gt;sysvinit&lt;/a&gt;&lt;/li&gt;
28 &lt;li&gt;&lt;a href=&quot;http://git.savannah.nongnu.org/cgit/sysvinit/insserv.git&quot;&gt;insserv&lt;/a&gt;&lt;/li&gt;
29 &lt;li&gt;&lt;a href=&quot;http://git.savannah.nongnu.org/cgit/sysvinit/startpar.git&quot;&gt;startpar&lt;/a&gt;&lt;/li&gt;
30
31 &lt;/ul&gt;
32
33 &lt;p&gt;I do not really spend much time on the project these days, and I
34 has mostly retired, but found it best to migrate the source to a good
35 version control system to help those willing to move it forward.&lt;/p&gt;
36
37 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
38 activities, please send Bitcoin donations to my address
39 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
40 </description>
41 </item>
42
43 <item>
44 <title>Unlocking HTC Desire HD on Linux using unruu and fastboot</title>
45 <link>http://www.hungry.com/~pere/blog/Unlocking_HTC_Desire_HD_on_Linux_using_unruu_and_fastboot.html</link>
46 <guid isPermaLink="true">http://www.hungry.com/~pere/blog/Unlocking_HTC_Desire_HD_on_Linux_using_unruu_and_fastboot.html</guid>
47 <pubDate>Thu, 7 Jul 2016 11:30:00 +0200</pubDate>
48 <description>&lt;p&gt;Yesterday, I tried to unlock a HTC Desire HD phone, and it proved
49 to be a slight challenge. Here is the recipe if I ever need to do it
50 again. It all started by me wanting to try the recipe to set up
51 &lt;a href=&quot;https://blog.torproject.org/blog/mission-impossible-hardening-android-security-and-privacy&quot;&gt;an
52 hardened Android installation&lt;/a&gt; from the Tor project blog on a
53 device I had access to. It is a old mobile phone with a broken
54 microphone The initial idea had been to just
55 &lt;a href=&quot;http://wiki.cyanogenmod.org/w/Install_CM_for_ace&quot;&gt;install
56 CyanogenMod on it&lt;/a&gt;, but did not quite find time to start on it
57 until a few days ago.&lt;/p&gt;
58
59 &lt;p&gt;The unlock process is supposed to be simple: (1) Boot into the boot
60 loader (press volume down and power at the same time), (2) select
61 &#39;fastboot&#39; before (3) connecting the device via USB to a Linux
62 machine, (4) request the device identifier token by running &#39;fastboot
63 oem get_identifier_token&#39;, (5) request the device unlocking key using
64 the &lt;a href=&quot;http://www.htcdev.com/bootloader/&quot;&gt;HTC developer web
65 site&lt;/a&gt; and unlock the phone using the key file emailed to you.&lt;/p&gt;
66
67 &lt;p&gt;Unfortunately, this only work fi you have hboot version 2.00.0029
68 or newer, and the device I was working on had 2.00.0027. This
69 apparently can be easily fixed by downloading a Windows program and
70 running it on your Windows machine, if you accept the terms Microsoft
71 require you to accept to use Windows - which I do not. So I had to
72 come up with a different approach. I got a lot of help from AndyCap
73 on #nuug, and would not have been able to get this working without
74 him.&lt;/p&gt;
75
76 &lt;p&gt;First I needed to extract the hboot firmware from
77 &lt;a href=&quot;http://www.htcdev.com/ruu/PD9810000_Ace_Sense30_S_hboot_2.00.0029.exe&quot;&gt;the
78 windows binary for HTC Desire HD&lt;/a&gt; downloaded as &#39;the RUU&#39; from HTC.
79 For this there is is &lt;a href=&quot;https://github.com/kmdm/unruu/&quot;&gt;a github
80 project named unruu&lt;/a&gt; using libunshield. The unshield tool did not
81 recognise the file format, but unruu worked and extracted rom.zip,
82 containing the new hboot firmware and a text file describing which
83 devices it would work for.&lt;/p&gt;
84
85 &lt;p&gt;Next, I needed to get the new firmware into the device. For this I
86 followed some instructions
87 &lt;a href=&quot;http://www.htc1guru.com/2013/09/new-ruu-zips-posted/&quot;&gt;available
88 from HTC1Guru.com&lt;/a&gt;, and ran these commands as root on a Linux
89 machine with Debian testing:&lt;/p&gt;
90
91 &lt;p&gt;&lt;pre&gt;
92 adb reboot-bootloader
93 fastboot oem rebootRUU
94 fastboot flash zip rom.zip
95 fastboot flash zip rom.zip
96 fastboot reboot
97 &lt;/pre&gt;&lt;/p&gt;
98
99 &lt;p&gt;The flash command apparently need to be done twice to take effect,
100 as the first is just preparations and the second one do the flashing.
101 The adb command is just to get to the boot loader menu, so turning the
102 device on while holding volume down and the power button should work
103 too.&lt;/p&gt;
104
105 &lt;p&gt;With the new hboot version in place I could start following the
106 instructions on the HTC developer web site. I got the device token
107 like this:&lt;/p&gt;
108
109 &lt;p&gt;&lt;pre&gt;
110 fastboot oem get_identifier_token 2&gt;&amp;1 | sed &#39;s/(bootloader) //&#39;
111 &lt;/pre&gt;
112
113 &lt;p&gt;And once I got the unlock code via email, I could use it like
114 this:&lt;/p&gt;
115
116 &lt;p&gt;&lt;pre&gt;
117 fastboot flash unlocktoken Unlock_code.bin
118 &lt;/pre&gt;&lt;/p&gt;
119
120 &lt;p&gt;And with that final step in place, the phone was unlocked and I
121 could start stuffing the software of my own choosing into the device.
122 So far I only inserted a replacement recovery image to wipe the phone
123 before I start. We will see what happen next. Perhaps I should
124 install &lt;a href=&quot;https://www.debian.org/&quot;&gt;Debian&lt;/a&gt; on it. :)&lt;/p&gt;
125 </description>
126 </item>
127
128 <item>
129 <title>How to stay with sysvinit in Debian Jessie</title>
130 <link>http://www.hungry.com/~pere/blog/How_to_stay_with_sysvinit_in_Debian_Jessie.html</link>
131 <guid isPermaLink="true">http://www.hungry.com/~pere/blog/How_to_stay_with_sysvinit_in_Debian_Jessie.html</guid>
132 <pubDate>Sat, 22 Nov 2014 01:00:00 +0100</pubDate>
133 <description>&lt;p&gt;By now, it is well known that Debian Jessie will not be using
134 sysvinit as its boot system by default. But how can one keep using
135 sysvinit in Jessie? It is fairly easy, and here are a few recipes,
136 courtesy of
137 &lt;a href=&quot;http://www.vitavonni.de/blog/201410/2014102101-avoiding-systemd.html&quot;&gt;Erich
138 Schubert&lt;/a&gt; and
139 &lt;a href=&quot;http://smcv.pseudorandom.co.uk/2014/still_universal/&quot;&gt;Simon
140 McVittie&lt;/a&gt;.
141
142 &lt;p&gt;If you already are using Wheezy and want to upgrade to Jessie and
143 keep sysvinit as your boot system, create a file
144 &lt;tt&gt;/etc/apt/preferences.d/use-sysvinit&lt;/tt&gt; with this content before
145 you upgrade:&lt;/p&gt;
146
147 &lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
148 Package: systemd-sysv
149 Pin: release o=Debian
150 Pin-Priority: -1
151 &lt;/pre&gt;&lt;/blockquote&gt;&lt;p&gt;
152
153 &lt;p&gt;This file content will tell apt and aptitude to not consider
154 installing systemd-sysv as part of any installation and upgrade
155 solution when resolving dependencies, and thus tell it to avoid
156 systemd as a default boot system. The end result should be that the
157 upgraded system keep using sysvinit.&lt;/p&gt;
158
159 &lt;p&gt;If you are installing Jessie for the first time, there is no way to
160 get sysvinit installed by default (debootstrap used by
161 debian-installer have no option for this), but one can tell the
162 installer to switch to sysvinit before the first boot. Either by
163 using a kernel argument to the installer, or by adding a line to the
164 preseed file used. First, the kernel command line argument:
165
166 &lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
167 preseed/late_command=&quot;in-target apt-get install --purge -y sysvinit-core&quot;
168 &lt;/pre&gt;&lt;/blockquote&gt;&lt;p&gt;
169
170 &lt;p&gt;Next, the line to use in a preseed file:&lt;/p&gt;
171
172 &lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
173 d-i preseed/late_command string in-target apt-get install -y sysvinit-core
174 &lt;/pre&gt;&lt;/blockquote&gt;&lt;p&gt;
175
176 &lt;p&gt;One can of course also do this after the first boot by installing
177 the sysvinit-core package.&lt;/p&gt;
178
179 &lt;p&gt;I recommend only using sysvinit if you really need it, as the
180 sysvinit boot sequence in Debian have several hardware specific bugs
181 on Linux caused by the fact that it is unpredictable when hardware
182 devices show up during boot. But on the other hand, the new default
183 boot system still have a few rough edges I hope will be fixed before
184 Jessie is released.&lt;/p&gt;
185
186 &lt;p&gt;Update 2014-11-26: Inspired by
187 &lt;ahref=&quot;https://www.mirbsd.org/permalinks/wlog-10-tg_e20141125-tg.htm#e20141125-tg_wlog-10-tg&quot;&gt;a
188 blog post by Torsten Glaser&lt;/a&gt;, added --purge to the preseed
189 line.&lt;/p&gt;
190 </description>
191 </item>
192
193 <item>
194 <title>Testing sysvinit from experimental in Debian Hurd</title>
195 <link>http://www.hungry.com/~pere/blog/Testing_sysvinit_from_experimental_in_Debian_Hurd.html</link>
196 <guid isPermaLink="true">http://www.hungry.com/~pere/blog/Testing_sysvinit_from_experimental_in_Debian_Hurd.html</guid>
197 <pubDate>Mon, 3 Feb 2014 13:40:00 +0100</pubDate>
198 <description>&lt;p&gt;A few days ago I decided to try to help the Hurd people to get
199 their changes into sysvinit, to allow them to use the normal sysvinit
200 boot system instead of their old one. This follow up on the
201 &lt;a href=&quot;https://teythoon.cryptobitch.de//categories/gsoc.html&quot;&gt;great
202 Google Summer of Code work&lt;/a&gt; done last summer by Justus Winter to
203 get Debian on Hurd working more like Debian on Linux. To get started,
204 I downloaded a prebuilt hard disk image from
205 &lt;a href=&quot;http://ftp.debian-ports.org/debian-cd/hurd-i386/current/debian-hurd.img.tar.gz&quot;&gt;http://ftp.debian-ports.org/debian-cd/hurd-i386/current/debian-hurd.img.tar.gz&lt;/a&gt;,
206 and started it using virt-manager.&lt;/p&gt;
207
208 &lt;p&gt;The first think I had to do after logging in (root without any
209 password) was to get the network operational. I followed
210 &lt;a href=&quot;https://www.debian.org/ports/hurd/hurd-install&quot;&gt;the
211 instructions on the Debian GNU/Hurd ports page&lt;/a&gt; and ran these
212 commands as root to get the machine to accept a IP address from the
213 kvm internal DHCP server:&lt;/p&gt;
214
215 &lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
216 settrans -fgap /dev/netdde /hurd/netdde
217 kill $(ps -ef|awk &#39;/[p]finet/ { print $2}&#39;)
218 kill $(ps -ef|awk &#39;/[d]evnode/ { print $2}&#39;)
219 dhclient /dev/eth0
220 &lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
221
222 &lt;p&gt;After this, the machine had internet connectivity, and I could
223 upgrade it and install the sysvinit packages from experimental and
224 enable it as the default boot system in Hurd.&lt;/p&gt;
225
226 &lt;p&gt;But before I did that, I set a password on the root user, as ssh is
227 running on the machine it for ssh login to work a password need to be
228 set. Also, note that a bug somewhere in openssh on Hurd block
229 compression from working. Remember to turn that off on the client
230 side.&lt;/p&gt;
231
232 &lt;p&gt;Run these commands as root to upgrade and test the new sysvinit
233 stuff:&lt;/p&gt;
234
235 &lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
236 cat &gt; /etc/apt/sources.list.d/experimental.list &amp;lt;&amp;lt;EOF
237 deb http://http.debian.net/debian/ experimental main
238 EOF
239 apt-get update
240 apt-get dist-upgrade
241 apt-get install -t experimental initscripts sysv-rc sysvinit \
242 sysvinit-core sysvinit-utils
243 update-alternatives --config runsystem
244 &lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
245
246 &lt;p&gt;To reboot after switching boot system, you have to use
247 &lt;tt&gt;reboot-hurd&lt;/tt&gt; instead of just &lt;tt&gt;reboot&lt;/tt&gt;, as there is not
248 yet a sysvinit process able to receive the signals from the normal
249 &#39;reboot&#39; command. After switching to sysvinit as the boot system,
250 upgrading every package and rebooting, the network come up with DHCP
251 after boot as it should, and the settrans/pkill hack mentioned at the
252 start is no longer needed. But for some strange reason, there are no
253 longer any login prompt in the virtual console, so I logged in using
254 ssh instead.
255
256 &lt;p&gt;Note that there are some race conditions in Hurd making the boot
257 fail some times. No idea what the cause is, but hope the Hurd porters
258 figure it out. At least Justus said on IRC (#debian-hurd on
259 irc.debian.org) that they are aware of the problem. A way to reduce
260 the impact is to upgrade to the Hurd packages built by Justus by
261 adding this repository to the machine:&lt;/p&gt;
262
263 &lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
264 cat &gt; /etc/apt/sources.list.d/hurd-ci.list &amp;lt;&amp;lt;EOF
265 deb http://darnassus.sceen.net/~teythoon/hurd-ci/ sid main
266 EOF
267 &lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
268
269 &lt;p&gt;At the moment the prebuilt virtual machine get some packages from
270 http://ftp.debian-ports.org/debian, because some of the packages in
271 unstable do not yet include the required patches that are lingering in
272 BTS. This is the completely list of &quot;unofficial&quot; packages installed:&lt;/p&gt;
273
274 &lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
275 # aptitude search &#39;?narrow(?version(CURRENT),?origin(Debian Ports))&#39;
276 i emacs - GNU Emacs editor (metapackage)
277 i gdb - GNU Debugger
278 i hurd-recommended - Miscellaneous translators
279 i isc-dhcp-client - ISC DHCP client
280 i isc-dhcp-common - common files used by all the isc-dhcp* packages
281 i libc-bin - Embedded GNU C Library: Binaries
282 i libc-dev-bin - Embedded GNU C Library: Development binaries
283 i libc0.3 - Embedded GNU C Library: Shared libraries
284 i A libc0.3-dbg - Embedded GNU C Library: detached debugging symbols
285 i libc0.3-dev - Embedded GNU C Library: Development Libraries and Hea
286 i multiarch-support - Transitional package to ensure multiarch compatibilit
287 i A x11-common - X Window System (X.Org) infrastructure
288 i xorg - X.Org X Window System
289 i A xserver-xorg - X.Org X server
290 i A xserver-xorg-input-all - X.Org X server -- input driver metapackage
291 #
292 &lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
293
294 &lt;p&gt;All in all, testing hurd has been an interesting experience. :)
295 X.org did not work out of the box and I never took the time to follow
296 the porters instructions to fix it. This time I was interested in the
297 command line stuff.&lt;p&gt;
298 </description>
299 </item>
300
301 <item>
302 <title>Debian init.d boot script example for rsyslog</title>
303 <link>http://www.hungry.com/~pere/blog/Debian_init_d_boot_script_example_for_rsyslog.html</link>
304 <guid isPermaLink="true">http://www.hungry.com/~pere/blog/Debian_init_d_boot_script_example_for_rsyslog.html</guid>
305 <pubDate>Sat, 2 Nov 2013 22:40:00 +0100</pubDate>
306 <description>&lt;p&gt;If one of the points of switching to a new init system in Debian is
307 &lt;a href=&quot;http://thomas.goirand.fr/blog/?p=147&quot;&gt;to get rid of huge
308 init.d scripts&lt;/a&gt;, I doubt we need to switch away from sysvinit and
309 init.d scripts at all. Here is an example init.d script, ie a rewrite
310 of /etc/init.d/rsyslog:&lt;/p&gt;
311
312 &lt;p&gt;&lt;pre&gt;
313 #!/lib/init/init-d-script
314 ### BEGIN INIT INFO
315 # Provides: rsyslog
316 # Required-Start: $remote_fs $time
317 # Required-Stop: umountnfs $time
318 # X-Stop-After: sendsigs
319 # Default-Start: 2 3 4 5
320 # Default-Stop: 0 1 6
321 # Short-Description: enhanced syslogd
322 # Description: Rsyslog is an enhanced multi-threaded syslogd.
323 # It is quite compatible to stock sysklogd and can be
324 # used as a drop-in replacement.
325 ### END INIT INFO
326 DESC=&quot;enhanced syslogd&quot;
327 DAEMON=/usr/sbin/rsyslogd
328 &lt;/pre&gt;&lt;/p&gt;
329
330 &lt;p&gt;Pretty minimalistic to me... For the record, the original sysv-rc
331 script was 137 lines, and the above is just 15 lines, most of it meta
332 info/comments.&lt;/p&gt;
333
334 &lt;p&gt;How to do this, you ask? Well, one create a new script
335 /lib/init/init-d-script looking something like this:
336
337 &lt;p&gt;&lt;pre&gt;
338 #!/bin/sh
339
340 # Define LSB log_* functions.
341 # Depend on lsb-base (&gt;= 3.2-14) to ensure that this file is present
342 # and status_of_proc is working.
343 . /lib/lsb/init-functions
344
345 #
346 # Function that starts the daemon/service
347
348 #
349 do_start()
350 {
351 # Return
352 # 0 if daemon has been started
353 # 1 if daemon was already running
354 # 2 if daemon could not be started
355 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test &gt; /dev/null \
356 || return 1
357 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
358 $DAEMON_ARGS \
359 || return 2
360 # Add code here, if necessary, that waits for the process to be ready
361 # to handle requests from services started subsequently which depend
362 # on this one. As a last resort, sleep for some time.
363 }
364
365 #
366 # Function that stops the daemon/service
367 #
368 do_stop()
369 {
370 # Return
371 # 0 if daemon has been stopped
372 # 1 if daemon was already stopped
373 # 2 if daemon could not be stopped
374 # other if a failure occurred
375 start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
376 RETVAL=&quot;$?&quot;
377 [ &quot;$RETVAL&quot; = 2 ] &amp;&amp; return 2
378 # Wait for children to finish too if this is a daemon that forks
379 # and if the daemon is only ever run from this initscript.
380 # If the above conditions are not satisfied then add some other code
381 # that waits for the process to drop all resources that could be
382 # needed by services started subsequently. A last resort is to
383 # sleep for some time.
384 start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
385 [ &quot;$?&quot; = 2 ] &amp;&amp; return 2
386 # Many daemons don&#39;t delete their pidfiles when they exit.
387 rm -f $PIDFILE
388 return &quot;$RETVAL&quot;
389 }
390
391 #
392 # Function that sends a SIGHUP to the daemon/service
393 #
394 do_reload() {
395 #
396 # If the daemon can reload its configuration without
397 # restarting (for example, when it is sent a SIGHUP),
398 # then implement that here.
399 #
400 start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
401 return 0
402 }
403
404 SCRIPTNAME=$1
405 scriptbasename=&quot;$(basename $1)&quot;
406 echo &quot;SN: $scriptbasename&quot;
407 if [ &quot;$scriptbasename&quot; != &quot;init-d-library&quot; ] ; then
408 script=&quot;$1&quot;
409 shift
410 . $script
411 else
412 exit 0
413 fi
414
415 NAME=$(basename $DAEMON)
416 PIDFILE=/var/run/$NAME.pid
417
418 # Exit if the package is not installed
419 #[ -x &quot;$DAEMON&quot; ] || exit 0
420
421 # Read configuration variable file if it is present
422 [ -r /etc/default/$NAME ] &amp;&amp; . /etc/default/$NAME
423
424 # Load the VERBOSE setting and other rcS variables
425 . /lib/init/vars.sh
426
427 case &quot;$1&quot; in
428 start)
429 [ &quot;$VERBOSE&quot; != no ] &amp;&amp; log_daemon_msg &quot;Starting $DESC&quot; &quot;$NAME&quot;
430 do_start
431 case &quot;$?&quot; in
432 0|1) [ &quot;$VERBOSE&quot; != no ] &amp;&amp; log_end_msg 0 ;;
433 2) [ &quot;$VERBOSE&quot; != no ] &amp;&amp; log_end_msg 1 ;;
434 esac
435 ;;
436 stop)
437 [ &quot;$VERBOSE&quot; != no ] &amp;&amp; log_daemon_msg &quot;Stopping $DESC&quot; &quot;$NAME&quot;
438 do_stop
439 case &quot;$?&quot; in
440 0|1) [ &quot;$VERBOSE&quot; != no ] &amp;&amp; log_end_msg 0 ;;
441 2) [ &quot;$VERBOSE&quot; != no ] &amp;&amp; log_end_msg 1 ;;
442 esac
443 ;;
444 status)
445 status_of_proc &quot;$DAEMON&quot; &quot;$NAME&quot; &amp;&amp; exit 0 || exit $?
446 ;;
447 #reload|force-reload)
448 #
449 # If do_reload() is not implemented then leave this commented out
450 # and leave &#39;force-reload&#39; as an alias for &#39;restart&#39;.
451 #
452 #log_daemon_msg &quot;Reloading $DESC&quot; &quot;$NAME&quot;
453 #do_reload
454 #log_end_msg $?
455 #;;
456 restart|force-reload)
457 #
458 # If the &quot;reload&quot; option is implemented then remove the
459 # &#39;force-reload&#39; alias
460 #
461 log_daemon_msg &quot;Restarting $DESC&quot; &quot;$NAME&quot;
462 do_stop
463 case &quot;$?&quot; in
464 0|1)
465 do_start
466 case &quot;$?&quot; in
467 0) log_end_msg 0 ;;
468 1) log_end_msg 1 ;; # Old process is still running
469 *) log_end_msg 1 ;; # Failed to start
470 esac
471 ;;
472 *)
473 # Failed to stop
474 log_end_msg 1
475 ;;
476 esac
477 ;;
478 *)
479 echo &quot;Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}&quot; &gt;&amp;2
480 exit 3
481 ;;
482 esac
483
484 :
485 &lt;/pre&gt;&lt;/p&gt;
486
487 &lt;p&gt;It is based on /etc/init.d/skeleton, and could be improved quite a
488 lot. I did not really polish the approach, so it might not always
489 work out of the box, but you get the idea. I did not try very hard to
490 optimize it nor make it more robust either.&lt;/p&gt;
491
492 &lt;p&gt;A better argument for switching init system in Debian than reducing
493 the size of init scripts (which is a good thing to do anyway), is to
494 get boot system that is able to handle the kernel events sensibly and
495 robustly, and do not depend on the boot to run sequentially. The boot
496 and the kernel have not behaved sequentially in years.&lt;/p&gt;
497 </description>
498 </item>
499
500 <item>
501 <title>How is booting into runlevel 1 different from single user boots?</title>
502 <link>http://www.hungry.com/~pere/blog/How_is_booting_into_runlevel_1_different_from_single_user_boots_.html</link>
503 <guid isPermaLink="true">http://www.hungry.com/~pere/blog/How_is_booting_into_runlevel_1_different_from_single_user_boots_.html</guid>
504 <pubDate>Thu, 4 Aug 2011 12:40:00 +0200</pubDate>
505 <description>&lt;p&gt;Wouter Verhelst have some
506 &lt;a href=&quot;http://grep.be/blog/en/retorts/pere_kubuntu_boot&quot;&gt;interesting
507 comments and opinions&lt;/a&gt; on my blog post on
508 &lt;a href=&quot;https://people.skolelinux.org/pere/blog/What_should_start_from__etc_rcS_d__in_Debian____almost_nothing.html&quot;&gt;the
509 need to clean up /etc/rcS.d/ in Debian&lt;/a&gt; and my blog post about
510 &lt;a href=&quot;https://people.skolelinux.org/pere/blog/What_is_missing_in_the_Debian_desktop__or_why_my_parents_use_Kubuntu.html&quot;&gt;the
511 default KDE desktop in Debian&lt;/a&gt;. I only have time to address one
512 small piece of his comment now, and though it best to address the
513 misunderstanding he bring forward:&lt;/p&gt;
514
515 &lt;p&gt;&lt;blockquote&gt;
516 Currently, a system admin has four options: [...] boot to a
517 single-user system (by adding &#39;single&#39; to the kernel command line;
518 this runs rcS and rc1 scripts)
519 &lt;/blockquote&gt;&lt;/p&gt;
520
521 &lt;p&gt;This make me believe Wouter believe booting into single user mode
522 and booting into runlevel 1 is the same. I am not surprised he
523 believe this, because it would make sense and is a quite sensible
524 thing to believe. But because the boot in Debian is slightly broken,
525 runlevel 1 do not work properly and it isn&#39;t the same as single user
526 mode. I&#39;ll try to explain what is actually happing, but it is a bit
527 hard to explain.&lt;/p&gt;
528
529 &lt;p&gt;Single user mode is defined like this in /etc/inittab:
530 &quot;&lt;tt&gt;~~:S:wait:/sbin/sulogin&lt;/tt&gt;&quot;. This means the only thing that is
531 executed in single user mode is sulogin. Single user mode is a boot
532 state &quot;between&quot; the runlevels, and when booting into single user mode,
533 only the scripts in /etc/rcS.d/ are executed before the init process
534 enters the single user state. When switching to runlevel 1, the state
535 is in fact not ending in runlevel 1, but it passes through runlevel 1
536 and end up in the single user mode (see /etc/rc1.d/S03single, which
537 runs &quot;init -t1 S&quot; to switch to single user mode at the end of runlevel
538 1. It is confusing that the &#39;S&#39; (single user) init mode is not the
539 mode enabled by /etc/rcS.d/ (which is more like the initial boot
540 mode).&lt;/p&gt;
541
542 &lt;p&gt;This summary might make it clearer. When booting for the first
543 time into single user mode, the following commands are executed:
544 &quot;&lt;tt&gt;/etc/init.d/rc S; /sbin/sulogin&lt;/tt&gt;&quot;. When booting into
545 runlevel 1, the following commands are executed: &quot;&lt;tt&gt;/etc/init.d/rc
546 S; /etc/init.d/rc 1; /sbin/sulogin&lt;/tt&gt;&quot;. A problem show up when
547 trying to continue after visiting single user mode. Not all services
548 are started again as they should, causing the machine to end up in an
549 unpredicatble state. This is why Debian admins recommend rebooting
550 after visiting single user mode.&lt;/p&gt;
551
552 &lt;p&gt;A similar problem with runlevel 1 is caused by the amount of
553 scripts executed from /etc/rcS.d/. When switching from say runlevel 2
554 to runlevel 1, the services started from /etc/rcS.d/ are not properly
555 stopped when passing through the scripts in /etc/rc1.d/, and not
556 started again when switching away from runlevel 1 to the runlevels
557 2-5. I believe the problem is best fixed by moving all the scripts
558 out of /etc/rcS.d/ that are not &lt;strong&gt;required&lt;/strong&gt; to get a
559 functioning single user mode during boot.&lt;/p&gt;
560
561 &lt;p&gt;I have spent several years investigating the Debian boot system,
562 and discovered this problem a few years ago. I suspect it originates
563 from when sysvinit was introduced into Debian, a long time ago.&lt;/p&gt;
564 </description>
565 </item>
566
567 <item>
568 <title>What should start from /etc/rcS.d/ in Debian? - almost nothing</title>
569 <link>http://www.hungry.com/~pere/blog/What_should_start_from__etc_rcS_d__in_Debian____almost_nothing.html</link>
570 <guid isPermaLink="true">http://www.hungry.com/~pere/blog/What_should_start_from__etc_rcS_d__in_Debian____almost_nothing.html</guid>
571 <pubDate>Sat, 30 Jul 2011 14:00:00 +0200</pubDate>
572 <description>&lt;p&gt;In the Debian boot system, several packages include scripts that
573 are started from /etc/rcS.d/. In fact, there is a bite more of them
574 than make sense, and this causes a few problems. What kind of
575 problems, you might ask. There are at least two problems. The first
576 is that it is not possible to recover a machine after switching to
577 runlevel 1. One need to actually reboot to get the machine back to
578 the expected state. The other is that single user boot will sometimes
579 run into problems because some of the subsystems are activated before
580 the root login is presented, causing problems when trying to recover a
581 machine from a problem in that subsystem. A minor additional point is
582 that moving more scripts out of rcS.d/ and into the other rc#.d/
583 directories will increase the amount of scripts that can run in
584 parallel during boot, and thus decrease the boot time.&lt;/p&gt;
585
586 &lt;p&gt;So, which scripts should start from rcS.d/. In short, only the
587 scripts that _have_ to execute before the root login prompt is
588 presented during a single user boot should go there. Everything else
589 should go into the numeric runlevels. This means things like
590 lm-sensors, fuse and x11-common should not run from rcS.d, but from
591 the numeric runlevels. Today in Debian, there are around 115 init.d
592 scripts that are started from rcS.d/, and most of them should be moved
593 out. Do your package have one of them? Please help us make single
594 user and runlevel 1 better by moving it.&lt;/p&gt;
595
596 &lt;p&gt;Scripts setting up the screen, keyboard, system partitions
597 etc. should still be started from rcS.d/, but there is for example no
598 need to have the network enabled before the single user login prompt
599 is presented.&lt;/p&gt;
600
601 &lt;p&gt;As always, things are not so easy to fix as they sound. To keep
602 Debian systems working while scripts migrate and during upgrades, the
603 scripts need to be moved from rcS.d/ to rc2.d/ in reverse dependency
604 order, ie the scripts that nothing in rcS.d/ depend on can be moved,
605 and the next ones can only be moved when their dependencies have been
606 moved first. This migration must be done sequentially while we ensure
607 that the package system upgrade packages in the right order to keep
608 the system state correct. This will require some coordination when it
609 comes to network related packages, but most of the packages with
610 scripts that should migrate do not have anything in rcS.d/ depending
611 on them. Some packages have already been updated, like the sudo
612 package, while others are still left to do. I wish I had time to work
613 on this myself, but real live constrains make it unlikely that I will
614 find time to push this forward.&lt;/p&gt;
615 </description>
616 </item>
617
618 <item>
619 <title>Automatic upgrade testing from Lenny to Squeeze</title>
620 <link>http://www.hungry.com/~pere/blog/Automatic_upgrade_testing_from_Lenny_to_Squeeze.html</link>
621 <guid isPermaLink="true">http://www.hungry.com/~pere/blog/Automatic_upgrade_testing_from_Lenny_to_Squeeze.html</guid>
622 <pubDate>Fri, 11 Jun 2010 22:50:00 +0200</pubDate>
623 <description>&lt;p&gt;The last few days I have done some upgrade testing in Debian, to
624 see if the upgrade from Lenny to Squeeze will go smoothly. A few bugs
625 have been discovered and reported in the process
626 (&lt;a href=&quot;http://bugs.debian.org/585410&quot;&gt;#585410&lt;/a&gt; in nagios3-cgi,
627 &lt;a href=&quot;http://bugs.debian.org/584879&quot;&gt;#584879&lt;/a&gt; already fixed in
628 enscript and &lt;a href=&quot;http://bugs.debian.org/584861&quot;&gt;#584861&lt;/a&gt; in
629 kdebase-workspace-data), and to get a more regular testing going on, I
630 am working on a script to automate the test.&lt;/p&gt;
631
632 &lt;p&gt;The idea is to create a Lenny chroot and use tasksel to install a
633 Gnome or KDE desktop installation inside the chroot before upgrading
634 it. To ensure no services are started in the chroot, a policy-rc.d
635 script is inserted. To make sure tasksel believe it is to install a
636 desktop on a laptop, the tasksel tests are replaced in the chroot
637 (only acceptable because this is a throw-away chroot).&lt;/p&gt;
638
639 &lt;p&gt;A naive upgrade from Lenny to Squeeze using aptitude dist-upgrade
640 currently always fail because udev refuses to upgrade with the kernel
641 in Lenny, so to avoid that problem the file /etc/udev/kernel-upgrade
642 is created. The bug report
643 &lt;a href=&quot;http://bugs.debian.org/566000&quot;&gt;#566000&lt;/a&gt; make me suspect
644 this problem do not trigger in a chroot, but I touch the file anyway
645 to make sure the upgrade go well. Testing on virtual and real
646 hardware have failed me because of udev so far, and creating this file
647 do the trick in such settings anyway. This is a
648 &lt;a href=&quot;http://www.linuxquestions.org/questions/debian-26/failed-dist-upgrade-due-to-udev-config_sysfs_deprecated-nonsense-804130/&quot;&gt;known
649 issue&lt;/a&gt; and the current udev behaviour is intended by the udev
650 maintainer because he lack the resources to rewrite udev to keep
651 working with old kernels or something like that. I really wish the
652 udev upstream would keep udev backwards compatible, to avoid such
653 upgrade problem, but given that they fail to do so, I guess
654 documenting the way out of this mess is the best option we got for
655 Debian Squeeze.&lt;/p&gt;
656
657 &lt;p&gt;Anyway, back to the task at hand, testing upgrades. This test
658 script, which I call &lt;tt&gt;upgrade-test&lt;/tt&gt; for now, is doing the
659 trick:&lt;/p&gt;
660
661 &lt;blockquote&gt;&lt;pre&gt;
662 #!/bin/sh
663 set -ex
664
665 if [ &quot;$1&quot; ] ; then
666 desktop=$1
667 else
668 desktop=gnome
669 fi
670
671 from=lenny
672 to=squeeze
673
674 exec &amp;lt; /dev/null
675 unset LANG
676 mirror=http://ftp.skolelinux.org/debian
677 tmpdir=chroot-$from-upgrade-$to-$desktop
678 fuser -mv .
679 debootstrap $from $tmpdir $mirror
680 chroot $tmpdir aptitude update
681 cat &gt; $tmpdir/usr/sbin/policy-rc.d &amp;lt;&amp;lt;EOF
682 #!/bin/sh
683 exit 101
684 EOF
685 chmod a+rx $tmpdir/usr/sbin/policy-rc.d
686 exit_cleanup() {
687 umount $tmpdir/proc
688 }
689 mount -t proc proc $tmpdir/proc
690 # Make sure proc is unmounted also on failure
691 trap exit_cleanup EXIT INT
692
693 chroot $tmpdir aptitude -y install debconf-utils
694
695 # Make sure tasksel autoselection trigger. It need the test scripts
696 # to return the correct answers.
697 echo tasksel tasksel/desktop multiselect $desktop | \
698 chroot $tmpdir debconf-set-selections
699
700 # Include the desktop and laptop task
701 for test in desktop laptop ; do
702 echo &gt; $tmpdir/usr/lib/tasksel/tests/$test &amp;lt;&amp;lt;EOF
703 #!/bin/sh
704 exit 2
705 EOF
706 chmod a+rx $tmpdir/usr/lib/tasksel/tests/$test
707 done
708
709 DEBIAN_FRONTEND=noninteractive
710 DEBIAN_PRIORITY=critical
711 export DEBIAN_FRONTEND DEBIAN_PRIORITY
712 chroot $tmpdir tasksel --new-install
713
714 echo deb $mirror $to main &gt; $tmpdir/etc/apt/sources.list
715 chroot $tmpdir aptitude update
716 touch $tmpdir/etc/udev/kernel-upgrade
717 chroot $tmpdir aptitude -y dist-upgrade
718 fuser -mv
719 &lt;/pre&gt;&lt;/blockquote&gt;
720
721 &lt;p&gt;I suspect it would be useful to test upgrades with both apt-get and
722 with aptitude, but I have not had time to look at how they behave
723 differently so far. I hope to get a cron job running to do the test
724 regularly and post the result on the web. The Gnome upgrade currently
725 work, while the KDE upgrade fail because of the bug in
726 kdebase-workspace-data&lt;/p&gt;
727
728 &lt;p&gt;I am not quite sure what kind of extract from the huge upgrade logs
729 (KDE 167 KiB, Gnome 516 KiB) it make sense to include in this blog
730 post, so I will refrain from trying. I can report that for Gnome,
731 aptitude report 760 packages upgraded, 448 newly installed, 129 to
732 remove and 1 not upgraded and 1024MB need to be downloaded while for
733 KDE the same numbers are 702 packages upgraded, 507 newly installed,
734 193 to remove and 0 not upgraded and 1117MB need to be downloaded&lt;/p&gt;
735
736 &lt;p&gt;I am very happy to notice that the Gnome desktop + laptop upgrade
737 is able to migrate to dependency based boot sequencing and parallel
738 booting without a hitch. Was unsure if there were still bugs with
739 packages failing to clean up their obsolete init.d script during
740 upgrades, and no such problem seem to affect the Gnome desktop+laptop
741 packages.&lt;/p&gt;
742 </description>
743 </item>
744
745 <item>
746 <title>Upstart or sysvinit - as init.d scripts see it</title>
747 <link>http://www.hungry.com/~pere/blog/Upstart_or_sysvinit___as_init_d_scripts_see_it.html</link>
748 <guid isPermaLink="true">http://www.hungry.com/~pere/blog/Upstart_or_sysvinit___as_init_d_scripts_see_it.html</guid>
749 <pubDate>Sun, 6 Jun 2010 23:55:00 +0200</pubDate>
750 <description>&lt;p&gt;If Debian is to migrate to upstart on Linux, I expect some init.d
751 scripts to migrate (some of) their operations to upstart job while
752 keeping the init.d for hurd and kfreebsd. The packages with such
753 needs will need a way to get their init.d scripts to behave
754 differently when used with sysvinit and with upstart. Because of
755 this, I had a look at the environment variables set when a init.d
756 script is running under upstart, and when it is not.&lt;/p&gt;
757
758 &lt;p&gt;With upstart, I notice these environment variables are set when a
759 script is started from rcS.d/ (ignoring some irrelevant ones like
760 COLUMNS):&lt;/p&gt;
761
762 &lt;blockquote&gt;&lt;pre&gt;
763 DEFAULT_RUNLEVEL=2
764 previous=N
765 PREVLEVEL=
766 RUNLEVEL=
767 runlevel=S
768 UPSTART_EVENTS=startup
769 UPSTART_INSTANCE=
770 UPSTART_JOB=rc-sysinit
771 &lt;/pre&gt;&lt;/blockquote&gt;
772
773 &lt;p&gt;With sysvinit, these environment variables are set for the same
774 script.&lt;/p&gt;
775
776 &lt;blockquote&gt;&lt;pre&gt;
777 INIT_VERSION=sysvinit-2.88
778 previous=N
779 PREVLEVEL=N
780 RUNLEVEL=S
781 runlevel=S
782 &lt;/pre&gt;&lt;/blockquote&gt;
783
784 &lt;p&gt;The RUNLEVEL and PREVLEVEL environment variables passed on from
785 sysvinit are not set by upstart. Not sure if it is intentional or not
786 to not be compatible with sysvinit in this regard.&lt;/p&gt;
787
788 &lt;p&gt;For scripts needing to behave differently when upstart is used,
789 looking for the UPSTART_JOB environment variable seem to be a good
790 choice.&lt;/p&gt;
791 </description>
792 </item>
793
794 <item>
795 <title>KDM fail at boot with NVidia cards - and no one try to fix it?</title>
796 <link>http://www.hungry.com/~pere/blog/KDM_fail_at_boot_with_NVidia_cards___and_no_one_try_to_fix_it_.html</link>
797 <guid isPermaLink="true">http://www.hungry.com/~pere/blog/KDM_fail_at_boot_with_NVidia_cards___and_no_one_try_to_fix_it_.html</guid>
798 <pubDate>Tue, 1 Jun 2010 17:05:00 +0200</pubDate>
799 <description>&lt;p&gt;It is strange to watch how a bug in Debian causing KDM to fail to
800 start at boot when an NVidia video card is used is handled. The
801 problem seem to be that the nvidia X.org driver uses a long time to
802 initialize, and this duration is longer than kdm is configured to
803 wait.&lt;/p&gt;
804
805 &lt;p&gt;I came across two bugs related to this issue,
806 &lt;a href=&quot;http://bugs.debian.org/583312&quot;&gt;#583312&lt;/a&gt; initially filed
807 against initscripts and passed on to nvidia-glx when it became obvious
808 that the nvidia drivers were involved, and
809 &lt;a href=&quot;http://bugs.debian.org/524751&quot;&gt;#524751&lt;/a&gt; initially filed against
810 kdm and passed on to src:nvidia-graphics-drivers for unknown reasons.&lt;/p&gt;
811
812 &lt;p&gt;To me, it seem that no-one is interested in actually solving the
813 problem nvidia video card owners experience and make sure the Debian
814 distribution work out of the box for these users. The nvidia driver
815 maintainers expect kdm to be set up to wait longer, while kdm expect
816 the nvidia driver maintainers to fix the driver to start faster, and
817 while they wait for each other I guess the users end up switching to a
818 distribution that work for them. I have no idea what the solution is,
819 but I am pretty sure that waiting for each other is not it.&lt;/p&gt;
820
821 &lt;p&gt;I wonder why we end up handling bugs this way.&lt;/p&gt;
822 </description>
823 </item>
824
825 <item>
826 <title>Parallellized boot seem to hold up well in Debian/testing</title>
827 <link>http://www.hungry.com/~pere/blog/Parallellized_boot_seem_to_hold_up_well_in_Debian_testing.html</link>
828 <guid isPermaLink="true">http://www.hungry.com/~pere/blog/Parallellized_boot_seem_to_hold_up_well_in_Debian_testing.html</guid>
829 <pubDate>Thu, 27 May 2010 23:55:00 +0200</pubDate>
830 <description>&lt;p&gt;A few days ago, parallel booting was enabled in Debian/testing.
831 The feature seem to hold up pretty well, but three fairly serious
832 issues are known and should be solved:
833
834 &lt;p&gt;&lt;ul&gt;
835
836 &lt;li&gt;The wicd package seen to
837 &lt;a href=&quot;http://bugs.debian.org/508289&quot;&gt;break NFS mounting&lt;/a&gt; and
838 &lt;a href=&quot;http://bugs.debian.org/581586&quot;&gt;network setup&lt;/a&gt; when
839 parallel booting is enabled. No idea why, but the wicd maintainer
840 seem to be on the case.&lt;/li&gt;
841
842 &lt;li&gt;The nvidia X driver seem to
843 &lt;a href=&quot;http://bugs.debian.org/583312&quot;&gt;have a race condition&lt;/a&gt;
844 triggered more easily when parallel booting is in effect. The
845 maintainer is on the case.&lt;/li&gt;
846
847 &lt;li&gt;The sysv-rc package fail to properly enable dependency based boot
848 sequencing (the shutdown is broken) when old file-rc users
849 &lt;a href=&quot;http://bugs.debian.org/575080&quot;&gt;try to switch back&lt;/a&gt; to
850 sysv-rc. One way to solve it would be for file-rc to create
851 /etc/init.d/.legacy-bootordering, and another is to try to make
852 sysv-rc more robust. Will investigate some more and probably upload a
853 workaround in sysv-rc to help those trying to move from file-rc to
854 sysv-rc get a working shutdown.&lt;/li&gt;
855
856 &lt;/ul&gt;&lt;/p&gt;
857
858 &lt;p&gt;All in all not many surprising issues, and all of them seem
859 solvable before Squeeze is released. In addition to these there are
860 some packages with bugs in their dependencies and run level settings,
861 which I expect will be fixed in a reasonable time span.&lt;/p&gt;
862
863 &lt;p&gt;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 &lt;a href=&quot;http://bugs.debian.org/cgi-bin/pkgreport.cgi?users=initscripts-ng-devel@lists.alioth.debian.org&quot;&gt;the
866 list of usertagged bugs related to this&lt;/a&gt;.&lt;/p&gt;
867
868 &lt;p&gt;Update: Correct bug number to file-rc issue.&lt;/p&gt;
869 </description>
870 </item>
871
872 <item>
873 <title>Parallellized boot is now the default in Debian/unstable</title>
874 <link>http://www.hungry.com/~pere/blog/Parallellized_boot_is_now_the_default_in_Debian_unstable.html</link>
875 <guid isPermaLink="true">http://www.hungry.com/~pere/blog/Parallellized_boot_is_now_the_default_in_Debian_unstable.html</guid>
876 <pubDate>Fri, 14 May 2010 22:40:00 +0200</pubDate>
877 <description>&lt;p&gt;Since this evening, parallel booting is the default in
878 Debian/unstable for machines using dependency based boot sequencing.
879 Apparently the testing of concurrent booting has been wider than
880 expected, if I am to believe the
881 &lt;a href=&quot;http://lists.debian.org/debian-devel/2010/05/msg00122.html&quot;&gt;input
882 on debian-devel@&lt;/a&gt;, and I concluded a few days ago to move forward
883 with the feature this weekend, to give us some time to detect any
884 remaining problems before Squeeze is frozen. If serious problems are
885 detected, it is simple to change the default back to sequential boot.
886 The upload of the new sysvinit package also activate a new upstream
887 version.&lt;/p&gt;
888
889 More information about
890 &lt;a href=&quot;http://wiki.debian.org/LSBInitScripts/DependencyBasedBoot&quot;&gt;dependency
891 based boot sequencing&lt;/a&gt; is available from the Debian wiki. It is
892 currently possible to disable parallel booting when one run into
893 problems caused by it, by adding this line to /etc/default/rcS:&lt;/p&gt;
894
895 &lt;blockquote&gt;&lt;pre&gt;
896 CONCURRENCY=none
897 &lt;/pre&gt;&lt;/blockquote&gt;
898
899 &lt;p&gt;If you report any problems with dependencies in init.d scripts to
900 the BTS, please usertag the report to get it to show up at
901 &lt;a href=&quot;http://bugs.debian.org/cgi-bin/pkgreport.cgi?users=initscripts-ng-devel@lists.alioth.debian.org&quot;&gt;the
902 list of usertagged bugs related to this&lt;/a&gt;.&lt;/p&gt;
903 </description>
904 </item>
905
906 <item>
907 <title>systemd, an interesting alternative to upstart</title>
908 <link>http://www.hungry.com/~pere/blog/systemd__an_interesting_alternative_to_upstart.html</link>
909 <guid isPermaLink="true">http://www.hungry.com/~pere/blog/systemd__an_interesting_alternative_to_upstart.html</guid>
910 <pubDate>Thu, 13 May 2010 22:20:00 +0200</pubDate>
911 <description>&lt;p&gt;The last few days a new boot system called
912 &lt;a href=&quot;http://www.freedesktop.org/wiki/Software/systemd&quot;&gt;systemd&lt;/a&gt;
913 has been
914 &lt;a href=&quot;http://0pointer.de/blog/projects/systemd.html&quot;&gt;introduced&lt;/a&gt;
915
916 to the free software world. I have not yet had time to play around
917 with it, but it seem to be a very interesting alternative to
918 &lt;a href=&quot;http://upstart.ubuntu.com/&quot;&gt;upstart&lt;/a&gt;, and might prove to be
919 a good alternative for Debian when we are able to switch to an event
920 based boot system. Tollef is
921 &lt;a href=&quot;http://bugs.debian.org/580814&quot;&gt;in the process&lt;/a&gt; of getting
922 systemd into Debian, and I look forward to seeing how well it work. I
923 like the fact that systemd handles init.d scripts with dependency
924 information natively, allowing them to run in parallel where upstart
925 at the moment do not.&lt;/p&gt;
926
927 &lt;p&gt;Unfortunately do systemd have the same problem as upstart regarding
928 platform support. It only work on recent Linux kernels, and also need
929 some new kernel features enabled to function properly. This means
930 kFreeBSD and Hurd ports of Debian will need a port or a different boot
931 system. Not sure how that will be handled if systemd proves to be the
932 way forward.&lt;/p&gt;
933
934 &lt;p&gt;In the mean time, based on the
935 &lt;a href=&quot;http://lists.debian.org/debian-devel/2010/05/msg00122.html&quot;&gt;input
936 on debian-devel@&lt;/a&gt; regarding parallel booting in Debian, I have
937 decided to enable full parallel booting as the default in Debian as
938 soon as possible (probably this weekend or early next week), to see if
939 there are any remaining serious bugs in the init.d dependencies. A
940 new version of the sysvinit package implementing this change is
941 already in experimental. If all go well, Squeeze will be released
942 with parallel booting enabled by default.&lt;/p&gt;
943 </description>
944 </item>
945
946 <item>
947 <title>Parallellizing the boot in Debian Squeeze - ready for wider testing</title>
948 <link>http://www.hungry.com/~pere/blog/Parallellizing_the_boot_in_Debian_Squeeze___ready_for_wider_testing.html</link>
949 <guid isPermaLink="true">http://www.hungry.com/~pere/blog/Parallellizing_the_boot_in_Debian_Squeeze___ready_for_wider_testing.html</guid>
950 <pubDate>Thu, 6 May 2010 23:25:00 +0200</pubDate>
951 <description>&lt;p&gt;These days, the init.d script dependencies in Squeeze are quite
952 complete, so complete that it is actually possible to run all the
953 init.d scripts in parallell based on these dependencies. If you want
954 to test your Squeeze system, make sure
955 &lt;a href=&quot;http://wiki.debian.org/LSBInitScripts/DependencyBasedBoot&quot;&gt;dependency
956 based boot sequencing&lt;/a&gt; is enabled, and add this line to
957 /etc/default/rcS:&lt;/p&gt;
958
959 &lt;blockquote&gt;&lt;pre&gt;
960 CONCURRENCY=makefile
961 &lt;/pre&gt;&lt;/blockquote&gt;
962
963 &lt;p&gt;That is it. It will cause sysv-rc to use the startpar tool to run
964 scripts in parallel using the dependency information stored in
965 /etc/init.d/.depend.boot, /etc/init.d/.depend.start and
966 /etc/init.d/.depend.stop to order the scripts. Startpar is configured
967 to try to start the kdm and gdm scripts as early as possible, and will
968 start the facilities required by kdm or gdm as early as possible to
969 make this happen.&lt;/p&gt;
970
971 &lt;p&gt;Give it a try, and see if you like the result. If some services
972 fail to start properly, it is most likely because they have incomplete
973 init.d script dependencies in their startup script (or some of their
974 dependent scripts have incomplete dependencies). Report bugs and get
975 the package maintainers to fix it. :)&lt;/p&gt;
976
977 &lt;p&gt;Running scripts in parallel could be the default in Debian when we
978 manage to get the init.d script dependencies complete and correct. I
979 expect we will get there in Squeeze+1, if we get manage to test and
980 fix the remaining issues.&lt;/p&gt;
981
982 &lt;p&gt;If you report any problems with dependencies in init.d scripts to
983 the BTS, please usertag the report to get it to show up at
984 &lt;a href=&quot;http://bugs.debian.org/cgi-bin/pkgreport.cgi?users=initscripts-ng-devel@lists.alioth.debian.org&quot;&gt;the
985 list of usertagged bugs related to this&lt;/a&gt;.&lt;/p&gt;
986 </description>
987 </item>
988
989 <item>
990 <title>Debian has switched to dependency based boot sequencing</title>
991 <link>http://www.hungry.com/~pere/blog/Debian_has_switched_to_dependency_based_boot_sequencing.html</link>
992 <guid isPermaLink="true">http://www.hungry.com/~pere/blog/Debian_has_switched_to_dependency_based_boot_sequencing.html</guid>
993 <pubDate>Mon, 27 Jul 2009 23:50:00 +0200</pubDate>
994 <description>&lt;p&gt;Since this evening, with the upload of sysvinit version 2.87dsf-2,
995 and the upload of insserv version 1.12.0-10 yesterday, Debian unstable
996 have been migrated to using dependency based boot sequencing. This
997 conclude work me and others have been doing for the last three days.
998 It feels great to see this finally part of the default Debian
999 installation. Now we just need to weed out the last few problems that
1000 are bound to show up, to get everything ready for Squeeze.&lt;/p&gt;
1001
1002 &lt;p&gt;The next step is migrating /sbin/init from sysvinit to upstart, and
1003 fixing the more fundamental problem of handing the event based
1004 non-predictable kernel in the early boot.&lt;/p&gt;
1005 </description>
1006 </item>
1007
1008 <item>
1009 <title>Taking over sysvinit development</title>
1010 <link>http://www.hungry.com/~pere/blog/Taking_over_sysvinit_development.html</link>
1011 <guid isPermaLink="true">http://www.hungry.com/~pere/blog/Taking_over_sysvinit_development.html</guid>
1012 <pubDate>Wed, 22 Jul 2009 23:00:00 +0200</pubDate>
1013 <description>&lt;p&gt;After several years of frustration with the lack of activity from
1014 the existing sysvinit upstream developer, I decided a few weeks ago to
1015 take over the package and become the new upstream. The number of
1016 patches to track for the Debian package was becoming a burden, and the
1017 lack of synchronization between the distribution made it hard to keep
1018 the package up to date.&lt;/p&gt;
1019
1020 &lt;p&gt;On the new sysvinit team is the SuSe maintainer Dr. Werner Fink,
1021 and my Debian co-maintainer Kel Modderman. About 10 days ago, I made
1022 a new upstream tarball with version number 2.87dsf (for Debian, SuSe
1023 and Fedora), based on the patches currently in use in these
1024 distributions. We Debian maintainers plan to move to this tarball as
1025 the new upstream as soon as we find time to do the merge. Since the
1026 new tarball was created, we agreed with Werner at SuSe to make a new
1027 upstream project at &lt;a href=&quot;http://savannah.nongnu.org/&quot;&gt;Savannah&lt;/a&gt;, and continue
1028 development there. The project is registered and currently waiting
1029 for approval by the Savannah administrators, and as soon as it is
1030 approved, we will import the old versions from svn and continue
1031 working on the future release.&lt;/p&gt;
1032
1033 &lt;p&gt;It is a bit ironic that this is done now, when some of the involved
1034 distributions are moving to upstart as a syvinit replacement.&lt;/p&gt;
1035 </description>
1036 </item>
1037
1038 <item>
1039 <title>Debian boots quicker and quicker</title>
1040 <link>http://www.hungry.com/~pere/blog/Debian_boots_quicker_and_quicker.html</link>
1041 <guid isPermaLink="true">http://www.hungry.com/~pere/blog/Debian_boots_quicker_and_quicker.html</guid>
1042 <pubDate>Wed, 24 Jun 2009 21:40:00 +0200</pubDate>
1043 <description>&lt;p&gt;I spent Monday and tuesday this week in London with a lot of the
1044 people involved in the boot system on Debian and Ubuntu, to see if we
1045 could find more ways to speed up the boot system. This was an Ubuntu
1046 funded
1047 &lt;a href=&quot;https://wiki.ubuntu.com/FoundationsTeam/BootPerformance/DebianUbuntuSprint&quot;&gt;developer
1048 gathering&lt;/a&gt;. It was quite productive. We also discussed the future
1049 of boot systems, and ways to handle the increasing number of boot
1050 issues introduced by the Linux kernel becoming more and more
1051 asynchronous and event base. The Ubuntu approach using udev and
1052 upstart might be a good way forward. Time will show.&lt;/p&gt;
1053
1054 &lt;p&gt;Anyway, there are a few ways at the moment to speed up the boot
1055 process in Debian. All of these should be applied to get a quick
1056 boot:&lt;/p&gt;
1057
1058 &lt;ul&gt;
1059
1060 &lt;li&gt;Use dash as /bin/sh.&lt;/li&gt;
1061
1062 &lt;li&gt;Disable the init.d/hwclock*.sh scripts and make sure the hardware
1063 clock is in UTC.&lt;/li&gt;
1064
1065 &lt;li&gt;Install and activate the insserv package to enable
1066 &lt;a href=&quot;http://wiki.debian.org/LSBInitScripts/DependencyBasedBoot&quot;&gt;dependency
1067 based boot sequencing&lt;/a&gt;, and enable concurrent booting.&lt;/li&gt;
1068
1069 &lt;/ul&gt;
1070
1071 These points are based on the Google summer of code work done by
1072 &lt;a href=&quot;http://initscripts-ng.alioth.debian.org/soc2006-bootsystem/&quot;&gt;Carlos
1073 Villegas&lt;/a&gt;.
1074
1075 &lt;p&gt;Support for makefile-style concurrency during boot was uploaded to
1076 unstable yesterday. When we tested it, we were able to cut 6 seconds
1077 from the boot sequence. It depend on very correct dependency
1078 declaration in all init.d scripts, so I expect us to find edge cases
1079 where the dependences in some scripts are slightly wrong when we start
1080 using this.&lt;/p&gt;
1081
1082 &lt;p&gt;On our IRC channel for this effort, #pkg-sysvinit, a new idea was
1083 introduced by Raphael Geissert today, one that could affect the
1084 startup speed as well. Instead of starting some scripts concurrently
1085 from rcS.d/ and another set of scripts from rc2.d/, it would be
1086 possible to run a of them in the same process. A quick way to test
1087 this would be to enable insserv and run &#39;mv /etc/rc2.d/S* /etc/rcS.d/;
1088 insserv&#39;. Will need to test if that work. :)&lt;/p&gt;
1089 </description>
1090 </item>
1091
1092 </channel>
1093 </rss>