Gentoo Archives: gentoo-dev

From: Wouter van Kleunen <kleunen@××××××××××.nl>
To: "leon j. breedt" <ljb@×××××××××.ORG>
Cc: gentoo-dev@g.o
Subject: Re: [gentoo-dev] Init replacement
Date: Sat, 03 May 2003 09:08:06
Message-Id: Pine.SOL.4.33.0305031058340.2984-100000@taurus
In Reply to: Re: [gentoo-dev] Init replacement by "leon j. breedt"
1 On Sat, 3 May 2003, leon j. breedt wrote:
2
3 > hi,
4 >
5 > i as well looked into doing this, and came to the conclusion that the
6 > following are desirable attributes for a replacement init:
7 >
8 > 1. secure daemon startup (i.e. as different user, in chroot, etc).
9 > basically,
10 > incorporating the functionality of start-stop-daemon into init.
11 this is definitly a good option, i'll definitly add this
12
13 > 2. daemon monitoring/controlling at an init level. i.e. you have a
14 > guaranteed
15 > working way of checking service status, sending signals, etc.
16 > very useful
17 > would be the ability to execute configurable commands/scripts on
18 > status
19 > change. basically, incorporating similar functionality to djb's
20 > daemontools.
21 Yes, that is already in there
22
23 > 3. standardized, controllable output to TTY. i.e. be able to
24 > suppress anything
25 > that a daemon/service tries to output, but log it somewhere. it
26 > should be
27 > possible to flag something that could be interactive though, like
28 > fsck.
29 > abstracting this would make it trivial to support different
30 > startup displays,
31 > like a progress bar, or graphical/icon based startup.
32 Yup, that is also supported.
33
34 > 4. deep dependency checking when determining what to start up/stop.
35 > and when restarting,
36 > only start up dependant things which were running when stopped.
37 >
38 Yes. Well, for the moment, you can only stop services that do not have
39 dependent services running. I plan to make that stronger
40
41 > it seems like you've thought of most of these cases. don't throw away
42 > the wisdom
43 > incorporated in sysvinit though. i'd recommend trying to make your init
44 > have the same
45 > semantics from an external point of view where possible so that
46 > userspace utilities
47 > such as wall, shutdown, etc, keep on working.
48 That is definitly possible. sysvinit uses a fifo to communicate. I could
49 write an IO part in pinit that could handle these commands. But i could
50 also write a pinit alternative.
51
52 >
53 > i'm not entirely sure i'd want to use XML for everything though. i think
54 > a nice
55 > approach would be to put the *metadata* about a service in XML, but the
56 > actual
57 > mechanics of starting/stopping the service in a seperate script. of this
58 > script,
59 > you expect things like that if it starts a daemon, its pid will be the
60 > pid you get
61 > when you exec it. have a well-defined interface you expect from the
62 > scripts,
63 > either return codes or text they output on success/failure, but scripts
64 > are
65 > very useful for executing a collection of commands. have the script
66 > start with
67 > #!/sbin/your-interpreter so that executing the script on its own still
68 > executes
69 > it in its managed environment.
70 >
71 Yes. I have thought of adding a script-service. But i removed it, because
72 i do not like scripts. I agree that they are convenient for executing a
73 collection of commands, but bash is a very weak programming language.
74
75 I will think about adding scripts. Maybe just to lower the difference
76 between my init and sysvinit. But rather not bash, bash is ugly :-(
77
78 it would be nice if people wrote more scripts using functional languages.
79 (haskell, miranda, etc...)
80
81 > i'm extremely interested in development of this, don't stop development
82 > :)
83 >
84 > regards,
85 > leon.
86 >
87
88
89 --
90 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] Init replacement Martin Schlemmer <azarah@g.o>
Re: [gentoo-dev] Init replacement "leon j. breedt" <ljb@×××××××××.org>