Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 425656

Summary: openrc is not using absolute path to /etc/conf.d
Product: Gentoo Hosted Projects Reporter: Petr Bahula <petr.bahula>
Component: OpenRCAssignee: OpenRC Team <openrc>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Petr Bahula 2012-07-10 12:29:17 UTC
On my diskless systems, which are run from ramdisk, I have read-only mounted nfs filesystem at /mnt. On ramdisk I have /etc/init.d as symlink to /mnt/etc/init.d, but /etc/conf.d/* are on ramdisk or individual synlinks to /mnt/etc/conf.d/* files. The previous rc system was working OK, but openrc is using /mnt/etc/conf.d directory instead of /etc/conf.d. It looks for the ../conf.d directory from the init script directory.
Actualy I use openrc-0.9.8.4.

Reproducible: Always
Comment 1 William Hubbs gentoo-dev 2012-07-10 14:23:07 UTC
(In reply to comment #0)
> On my diskless systems, which are run from ramdisk, I have read-only mounted
> nfs filesystem at /mnt. On ramdisk I have /etc/init.d as symlink to
> /mnt/etc/init.d, but /etc/conf.d/* are on ramdisk or individual synlinks to
> /mnt/etc/conf.d/* files. The previous rc system was working OK, but openrc
> is using /mnt/etc/conf.d directory instead of /etc/conf.d. It looks for the
> ../conf.d directory from the init script directory.

That is correct; this is not a bug.

Because of *BSD integration, OpenRC supports two locations for init.d/conf.d directories. /etc and /usr/local/etc. This requires us to use a relative path for the conf.d directory so we can read the appropriate conf.d file.

This is why init.d and conf.d need to be in the same directory.
Comment 2 Petr Bahula 2012-07-10 15:56:39 UTC
(In reply to comment #1)
> 
> That is correct; this is not a bug.
> 
> Because of *BSD integration, OpenRC supports two locations for init.d/conf.d
> directories. /etc and /usr/local/etc. This requires us to use a relative
> path for the conf.d directory so we can read the appropriate conf.d file.
> 
> This is why init.d and conf.d need to be in the same directory.

From my view it is a bug.

Ramdisk:
/etc/init.d -> /mnt/etc/init.d
/etc/runlevels -> /mnt/etc/runlevels
/etc/conf.d/service1 -> /mnt/etc/conf.d/service1
/etc/conf.d/service2 (regural file)
/mnt

On /mnt is mounted read-only filesystem:
(/mnt)/etc/init.d/service1
(/mnt)/etc/init.d/service2
(/mnt)/etc/runlevels/default/service1 -> /etc/init.d/service1
(/mnt)/etc/runlevels/default/service2 -> /etc/init.d/service2
(/mnt)/etc/conf.d/service1
(/mnt)/etc/conf.d/service2 ("bad file")

I call /etc/init.d/service (ok, I call /etc/runlevels/default/service simlink to /etc/init.d/service), but the openrc not use /etc/conf.d/service but mnt/etc/conf.d/service.
The problem is not the relative path to conf.d, the problem is "unsymlink", "absolutize" path to init.d  before using the relative path to conf.d.

Sorry, I made bad name for the bug.
Comment 3 William Hubbs gentoo-dev 2012-07-10 16:22:11 UTC
(In reply to comment #2)
> (In reply to comment #1)
> Ramdisk:
> /etc/init.d -> /mnt/etc/init.d
> /etc/runlevels -> /mnt/etc/runlevels
> /etc/conf.d/service1 -> /mnt/etc/conf.d/service1
> /etc/conf.d/service2 (regural file)
> /mnt
> 
> On /mnt is mounted read-only filesystem:
> (/mnt)/etc/init.d/service1
> (/mnt)/etc/init.d/service2
> (/mnt)/etc/runlevels/default/service1 -> /etc/init.d/service1
> (/mnt)/etc/runlevels/default/service2 -> /etc/init.d/service2
> (/mnt)/etc/conf.d/service1
> (/mnt)/etc/conf.d/service2 ("bad file")

I'm not following this, so I'll ask another question below.

> I call /etc/init.d/service (ok, I call /etc/runlevels/default/service
> simlink to /etc/init.d/service), but the openrc not use /etc/conf.d/service
> but mnt/etc/conf.d/service.

What is /etc/init.d/service in this example?
Comment 4 Petr Bahula 2012-07-11 06:50:12 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > (In reply to comment #1)
> > Ramdisk:
> > /etc/init.d -> /mnt/etc/init.d
> > /etc/runlevels -> /mnt/etc/runlevels
> > /etc/conf.d/service1 -> /mnt/etc/conf.d/service1
> > /etc/conf.d/service2 (regural file)
> > /mnt
> > 
> > On /mnt is mounted read-only filesystem:
> > (/mnt)/etc/init.d/service1
> > (/mnt)/etc/init.d/service2
> > (/mnt)/etc/runlevels/default/service1 -> /etc/init.d/service1
> > (/mnt)/etc/runlevels/default/service2 -> /etc/init.d/service2
> > (/mnt)/etc/conf.d/service1
> > (/mnt)/etc/conf.d/service2 ("bad file")
> 
> I'm not following this, so I'll ask another question below.
> 
> > I call /etc/init.d/service (ok, I call /etc/runlevels/default/service
> > simlink to /etc/init.d/service), but the openrc not use /etc/conf.d/service
> > but mnt/etc/conf.d/service.
> 
> What is /etc/init.d/service in this example?

Korrection:
I call /etc/init.d/service2 (ok, I call /etc/runlevels/default/service2
simlink to /etc/init.d/service2), but the openrc not use /etc/conf.d/service2
but /mnt/etc/conf.d/service2.
Comment 5 William Hubbs gentoo-dev 2012-07-16 16:12:47 UTC

*** This bug has been marked as a duplicate of bug 350910 ***
Comment 6 William Hubbs gentoo-dev 2012-07-16 16:17:07 UTC
I am closing this as a duplicate, see the bug I referred to  for more
information about this.

The rule is that /etc/init.d and /etc/conf.d must actually be
directories in /etc, and if there are symlinks in /etc/init.d, they must
point to files in the same directory. If these rules are not followed,
OpenRC currently doesn't have a way to determine the name of the conf.d
file to use or where the conf.d directory is located.