1 |
On Fri, 2012-01-06 at 08:44 +0800, Patrick Lauer wrote: |
2 |
> On 01/06/12 05:26, Olivier Crête wrote: |
3 |
> [snip] |
4 |
> > The only thing I see them sacrificing is loose coupling, they provide |
5 |
> > more functionality than any other init system, more correctness |
6 |
> > (seriously, did you ever read most init scripts out there?), more well |
7 |
> > defined behavior (all systemd systems boot exactly the same), more |
8 |
> > stability (I'll claim that Lennart's C is better than any of the |
9 |
> > boot-time shell scripts I've seen) and well understandability depends |
10 |
> > who much you can understand C. Probably a bit less understandable for |
11 |
> > sysadmins, but since they can just play with config files, it's |
12 |
> > probably easier to understand in the end (and much less prone to |
13 |
> > breaking than mucking around shell scripts). |
14 |
> As you apparently have no idea what a sysadmin does I'd appreciate it if |
15 |
> people like you didn't try to guess what would make things better and |
16 |
> instead listened to people that have more than their desktop to run. |
17 |
> (Hint: It's not pressing reset buttons) |
18 |
|
19 |
I know what they do.. play in random scripts until whatever they're |
20 |
trying to hack together it seems to work, because oh well, its just a |
21 |
one time thing.. and then when stuff breaks they call Red Hat's support |
22 |
line. |
23 |
|
24 |
> Given the choice between a single line of shell ( cat "$urandom_seed" > |
25 |
> /dev/urandom ) or 145 lines of undocumented C (which, if naively |
26 |
> modified by me, might just make systemd segfault) ... there is no choice. |
27 |
|
28 |
Actually, you don't have to do that, systemd does it for you and takes |
29 |
care of all the annoying details [1]. |
30 |
|
31 |
That said, you can trivially disable systemd-random-seed-save.service |
32 |
and systemd-random-seed-load.service and instead write a unit file that |
33 |
runs whatever you want. You don't HAVE to do any C to run stuff from |
34 |
systemd, but it does provide many things written in C that are much more |
35 |
solid than the shell equivalents. |
36 |
|
37 |
> I do agree with you on one point - most init scripts are really bad |
38 |
> code, but that doesn't mean shell is bad, it means that you need to |
39 |
> educate people and file bugs. I've laughed at SLES' /etc/bashrc, I read |
40 |
> most of upstart and wondered how ... why ... is it can be drunk tiem? |
41 |
> Still that doesn't mean that rewriting it in bad C is in any way more |
42 |
> agreeable, and you just made debugging exquisitely painful. Yey. |
43 |
|
44 |
The big reason for C vs shell scripts is that the type of people who |
45 |
write them are not the same.. The type of people who write shell scripts |
46 |
tend to hack together stuff until it works. The people who write C tend |
47 |
to think about the problem for a long time and then write a complete |
48 |
solution that tries to take into account all of the possible error |
49 |
scenarios. |
50 |
|
51 |
[1] http://cgit.freedesktop.org/systemd/tree/src/random-seed.c |
52 |
|
53 |
-- |
54 |
Olivier Crête |
55 |
tester@g.o |
56 |
Gentoo Developer |