Gentoo Archives: gentoo-embedded

From: Matthijs Kooijman <matthijs@×××××.nl>
To: gentoo-embedded@l.g.o
Subject: [gentoo-embedded] [baselayout2] Who should create /lib/rc/init.d/* ?
Date: Wed, 07 Nov 2007 21:45:15
Message-Id: 20071107214324.GI14830@katherina.student.utwente.nl
1 Hi,
2
3 this might not really be the place to ask this question, but I'll go ahead
4 anyway. If this really belongs somewhere else, don't hesitate to point that
5 out.
6
7 I'm building a small gentoo rootfs based on uclibc. After trying once with
8 baselayout-lite (which kinda worked, but without any real init / rc support
9 except for manually writing new rc scripts), I'm trying baselayout2
10 (2.0.0_rc6).
11
12 The first problem I found was the absence of an inittab, but that makes sense
13 since only busybox is providing init (so I should just write one myself...).
14
15 The second problem, and that is the actual subject of this mail, is that the
16 rc scripts (or more specifically the runscript binary) won't work. It will run
17 and responds nicely to --help, but once I try to start something I get the
18 following (and yes, I am root):
19
20 / $ /etc/init.d/local start
21 * ERROR: local has been started by something else
22
23 Which is a rather cryptic message. After investigating the source, this
24 message really means "Couldn't set state to `starting'". This is caused by the
25 absence of a /lib/rc/init.d/starting directory. After creating this directory
26 (and a /lib/rc/init.d/exclusive directory to solve the next error) everything
27 works as expected.
28
29 Even more, after a first succesful run, all the other directories in
30 /lib/rc/init.d/ (started, stopping, etc.) are also created.
31
32 Another look at the source is that as as side effect of dependency
33 calculation, these directories are created if needed. But dependency checking
34 is only done after marking the service as started, so this breaks on an empty
35 system.
36
37 Now, my real question: Who is supposed to create these directories? The most
38 sensible thing IMHO would be having runscript create them on startup (which
39 would require some code changes). If not, then the baselayout ebuild should
40 provide them?
41
42 Now, looking a bit closer, I might have found a solution. An easy way to solve
43 the problem is simply forcing dependencies to be calculated, for example by
44 running
45
46 / $ /etc/init.d/local ineed
47
48 This creates the needed directories without crashing.
49
50 Now, if I would create a normal inittab, instead of trying to start single
51 services without going through rc startup properly it might actually be that
52 it starts with dependency calculation and the problem magically dissappears...
53 I'll try that, and see what happens (though that would not fully invalidate
54 this email if it works).
55
56 Gr.
57
58 Matthijs

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
[gentoo-embedded] Re: [baselayout2] Who should create /lib/rc/init.d/* ? Marc Blumentritt <marc.blumentritt@×××××.de>