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