Gentoo Archives: gentoo-dev

From: Wouter van Kleunen <kleunen@××××××××××.nl>
To: Terje Kvernes <terjekv@××××××××.no>
Cc: gentoo-dev@g.o
Subject: Re: [gentoo-dev] Init replacement
Date: Fri, 02 May 2003 16:34:52
Message-Id: Pine.SOL.4.33.0305021834090.7275-100000@taurus
In Reply to: Re: [gentoo-dev] Init replacement by Terje Kvernes
1 I updated the "About" page on the website. I hope that will explain why i
2 prefer a compiled language over a shell script.
3
4 Wouter
5
6 On 2 May 2003, Terje Kvernes wrote:
7
8 > Wouter van Kleunen <kleunen@××××××××××.nl> writes:
9 >
10 > > On 2 May 2003, Terje Kvernes wrote:
11 > >
12 > > > converting init-scripts to XML is a scary process. init-scripts
13 > > > should IMHO be human readable, as atomic as possible, and testable
14 > > > without depending on much more than having a generic shell. in
15 > > > addition to verboseness and lack of readability, XML makes it
16 > > > "interesting" to integrate more complex scripts, like autofs.
17 > > >
18 > > > yes, XML is easier to generate for a machine, but you generally
19 > > > don't generate init-scripts, if you do you probably build them
20 > > > from templates, which aren't XML friendly either.
21 > >
22 > > local res="$(cat /proc/modules | egrep 'serial' | cut -f1 -d" ")"
23 > >
24 > > remaining="$(cat /proc/mounts | awk `( print $3 " " $2 )'| \
25 > > grep -E ^'code|nfs|ncpfs|smbfs' | awk '( print $2 | '| sort -r)"
26 > >
27 > > human readable, i see... hmmmm
28 >
29 > it's readable, yes.
30 >
31 > > how can you test something like this?
32 >
33 > by running it bit by bit on the command line, and testing each
34 > command. of course, you can clean up stuff like the above as well
35 > to make it more readable. then again, how would you achieve the
36 > same as what the script does without doing just the same thing?
37 >
38 > > it will break very easily.
39 >
40 > not really. there are reasons why one doesn't change the format of
41 > proc mounts. it looks complex, and it is, but it's also very much
42 > tried and true. one could argue about the lack of 'trap' or
43 > something similar tools in the scripts though.
44 >
45 > > and writing a init script for a daemon is very simple with my
46 > > system. Not all daemons have an ready to run gentoo init script you
47 > > know.
48 >
49 > and a lot of scripts require a great deal of "magic" before they
50 > run. why do you think the initscript for autofs looks the way it
51 > does? because start-stop-daemon automount works? :-)
52 >
53 > --
54 > Terje
55 >
56 > --
57 > gentoo-dev@g.o mailing list
58 >
59
60
61 --
62 gentoo-dev@g.o mailing list