Gentoo Archives: gentoo-user

From: Florian Philipp <lists@×××××××××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Can no longer use symlinks in /etc/init.d with openrc-0.9.8.4 ?
Date: Thu, 16 Feb 2012 11:13:27
Message-Id: 4F3CE471.6070606@binarywings.net
In Reply to: Re: [gentoo-user] Can no longer use symlinks in /etc/init.d with openrc-0.9.8.4 ? by Pandu Poluan
1 Am 16.02.2012 11:12, schrieb Pandu Poluan:
2 >
3 > On Feb 16, 2012 3:33 PM, "J. Roeleveld" <joost@××××××××.org
4 > <mailto:joost@××××××××.org>> wrote:
5 >>
6 >>
7 >> On Thu, February 16, 2012 6:24 am, Pandu Poluan wrote:
8 >> > I am wondering if any of you had experienced the same difficulty as me:
9 >> >
10 >> > A couple of days ago, I upgraded openrc from (whatever version it was
11 >> > previously) to 0.9.8.4.
12 >> >
13 >> > One of the scripts in /etc/init.d was a symlink to
14 > /opt/some/package/path
15 >> >
16 >> > (To be precise, /etc/init.d/gatewall ->
17 >> > /opt/wallmator/initscripts/gentoo/gatewall.init)
18 >> >
19 >> > ((wallmator is a "Firewall Automator" script I'm developing))
20 >> >
21 >> > This morning, I rebooted. Upon time to execute the "gatewall" script,
22 >> > it complained that some settings (set through /etc/conf.d/gatewall are
23 >> > not set). I double-checked the settings it complained; yep, they are
24 >> > there in /etc/conf.d/gatewall.
25 >> >
26 >> > I tried `/etc/init.d/gatewall start`, no luck. It still complains of
27 >> > some vital non-optional settings not being set.
28 >> >
29 >> > So, I replaced the symlink:
30 >> >
31 >> > cd /etc/init.d
32 >> > mv gatewall gatewall.old
33 >> > cp /opt/wallmator/initscripts/gentoo/gatewall.init gatewall
34 >> >
35 >> > And tried again `/etc/init.d/gatewall start` ... it worked!!
36 >> >
37 >> > So I tried `shutdown -r now` ... there's joy in Mudville! The
38 >> > "gatewall" initscript now properly reads the settings in
39 >> > /etc/conf.d/gatewall.
40 >> >
41 >> > My question is: Is there a change of behavior in how openrc executes a
42 >> > script in /etc/init.d/ when said script is a symlink instead of a
43 >> > 'normal' file?
44 >> >
45 >> > PS: For this particular system, everything under / except /boot
46 >> > resides in the same filesystem.
47 >> >
48 >> > PPS: For the contents of the "gatewall" initscript, see
49 >> >
50 > https://bitbucket.org/pepoluan/wallmator/src/edae2e294d07/initscript/gentoo/gatewall.init
51 >> >
52 >> > Rgds,
53 >> > --
54 >> > FdS Pandu E Poluan
55 >> > ~ IT Optimizer ~
56 >> >
57 >> >  • LOPSA Member #15248
58 >> >  • Blog : http://pepoluan.tumblr.com
59 >> >  • Linked-In : http://id.linkedin.com/in/pepoluan
60 >> >
61 >>
62 >> Pandu,
63 >>
64 >> I haven't checked the source yet, but I'm wondering if the scripts are
65 >> looking for the "conf.d" file in the location:
66 >> " ../conf.d " (based from the actual location of the init-script)
67 >>
68 >> Can you try the following:
69 >> # mkdir -p /opt/wallmator/initscripts/conf.d
70 >> # ln -s /etc/init.d/gatewall /opt/wallmator/initscripts/conf.d/gatewall
71 >>
72 >> and then recreate the original link for the init-script.
73 >>
74 >
75 > IIRC, it's the responsibility of runscript to source the relevant config
76 > file in /etc/conf.d, and not the initscript's.
77 >
78 > If you peruse the code, you can see that I relied on that feature; there
79 > is no source-ing of any file in /etc/conf.d
80 >
81 > Rgds,
82 >
83
84 Yes, but maybe runscript resolves the real file location and then
85 sources the conf file relative to that location.
86
87 Regards,
88 Florian Philipp

Attachments

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

Replies

Subject Author
Re: [gentoo-user] Can no longer use symlinks in /etc/init.d with openrc-0.9.8.4 ? Pandu Poluan <pandu@××××××.info>