Gentoo Archives: gentoo-dev

From: Alec Warner <antarus@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] rfc: locations of binaries and separate /usr
Date: Fri, 06 Jan 2012 08:17:37
Message-Id: CAAr7Pr9DFVJZ4WO1h8x=U-F9N-GrOEp8Qavy1=fW_fE-1mmcow@mail.gmail.com
In Reply to: Re: [gentoo-dev] rfc: locations of binaries and separate /usr by "Olivier Crête"
1 2012/1/5 Olivier Crête <tester@g.o>:
2 > On Fri, 2012-01-06 at 08:44 +0800, Patrick Lauer wrote:
3 >> On 01/06/12 05:26, Olivier Crête wrote:
4 >> [snip]
5 >> > The only thing I see them sacrificing is loose coupling, they provide
6 >> > more functionality than any other init system, more correctness
7 >> > (seriously, did you ever read most init scripts out there?), more well
8 >> > defined behavior (all systemd systems boot exactly the same), more
9 >> > stability (I'll claim that Lennart's C is better than any of the
10 >> > boot-time shell scripts I've seen) and well understandability depends
11 >> > who much you can understand C. Probably a bit less understandable for
12 >> > sysadmins, but since they can just play with config files, it's
13 >> > probably easier to understand in the end (and much less prone to
14 >> > breaking than mucking around shell scripts).
15 >> As you apparently have no idea what a sysadmin does I'd appreciate it if
16 >> people like you didn't try to guess what would make things better and
17 >> instead listened to people that have more than their desktop to run.
18 >> (Hint: It's not pressing reset buttons)
19 >
20 > I know what they do.. play in random scripts until whatever they're
21 > trying to hack together it seems to work, because oh well, its just a
22 > one time thing..  and then when stuff breaks they call Red Hat's support
23 > line.
24
25 Way to insult a large number of list members.
26
27 >
28 >> Given the choice between a single line of shell ( cat "$urandom_seed" >
29 >> /dev/urandom ) or 145 lines of undocumented C (which, if naively
30 >> modified by me, might just make systemd segfault) ... there is no choice.
31 >
32 > Actually, you don't have to do that, systemd does it for you and takes
33 > care of all the annoying details [1].
34 >
35 > That said, you can trivially disable systemd-random-seed-save.service
36 > and systemd-random-seed-load.service and instead write a unit file that
37 > runs whatever you want. You don't HAVE to do any C to run stuff from
38 > systemd, but it does provide many things written in C that are much more
39 > solid than the shell equivalents.
40 >
41 >> I do agree with you on one point - most init scripts are really bad
42 >> code, but that doesn't mean shell is bad, it means that you need to
43 >> educate people and file bugs. I've laughed at SLES' /etc/bashrc, I read
44 >> most of upstart and wondered how ... why ... is it can be drunk tiem?
45 >> Still that doesn't mean that rewriting it in bad C is in any way more
46 >> agreeable, and you just made debugging exquisitely painful. Yey.
47 >
48 > The big reason for C vs shell scripts is that the type of people who
49 > write them are not the same.. The type of people who write shell scripts
50 > tend to hack together stuff until it works. The people who write C tend
51 > to think about the problem for a long time and then write a complete
52 > solution that tries to take into account all of the possible error
53 > scenarios.
54
55 There are plenty of situations where shell scripts are entirely
56 appropriate. I am in agreement that most of the time initscripts are
57 not one of them. That being said I am not a fan of the tight coupling
58 here. Init is not supposed to segfault. A bug in one of the modules
59 may cause this to happen, so us old codger-y sysadmins (who apparently
60 love writing shell scripts and can't write real code to save our
61 lives) would much prefer some kind of separation. Perhaps keep 'init'
62 as a fairly simple codebase and run 'systemd' as pid 2 and they can
63 chat with each other (over dbus?)
64
65 -A
66
67 >
68 > [1] http://cgit.freedesktop.org/systemd/tree/src/random-seed.c
69 >
70 > --
71 > Olivier Crête
72 > tester@g.o
73 > Gentoo Developer

Replies

Subject Author
Re: [gentoo-dev] rfc: locations of binaries and separate /usr Ian Stakenvicius <axs@g.o>