Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 401059 - sys-apps/openrc should migrate /lib/rc/init.d to /run
Summary: sys-apps/openrc should migrate /lib/rc/init.d to /run
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: openrc-0.10
  Show dependency tree
 
Reported: 2012-01-27 17:40 UTC by Maxim Kammerer
Modified: 2012-05-16 23:21 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maxim Kammerer 2012-01-27 17:40:13 UTC
Following suggestion in bug #361349, I am opening a this bug about possibly migrating /lib/rc/init.d (mounted as tmpfs at boot) and /dev/shm to /run.
Comment 1 William Hubbs gentoo-dev 2012-01-27 17:47:20 UTC
This bug will follow migrating /lib/rc/init.d.

WRT /dev/shm, I could create the directory, /run/shm, easily enough,
but I believe /dev/shm is a glibc requirement, so before I do that I
would need to know that glibc would use it.
Comment 2 Maxim Kammerer 2012-01-27 17:58:28 UTC
Maybe I am missing something about /dev/shm (should this be a separate bug?), but /dev/shm should remain a link to /run/shm, no? Being the original tmpfs, other programs would expect to be able to use it, even if glibc doesn't (I know I wrote scripts that used /dev/shm).
Comment 3 William Hubbs gentoo-dev 2012-02-25 06:57:43 UTC
I am working on a patch to migrate /lib/rc/init.d to /run. The comment
about /dev/shm isn't related to OpenRC, so that will need to be
another bug, but I don't see it moving to /run.
Comment 4 William Hubbs gentoo-dev 2012-05-07 18:05:42 UTC
I have a commit now that switches /lib/rc/init.d to /run/openrc, and I
am successfully running with it switched here.
This makes /run mandatory for openrc.

My question is, what  you think we should do about the state data that
still exists in /lib/rc/init.d after the upgrade, so I would rather not
go there.

Reading state data from both locations would add much code complexity
for something that only exists until the next reboot, and the only time
I could attempt to migrate would be if a tmpfs is already mounted on
/run.

Ideas are welcome, but I'm thinking that the best option is going to be
to require a reboot.
Comment 5 Maxim Kammerer 2012-05-07 18:31:18 UTC
(In reply to comment #4)
> Reading state data from both locations would add much code complexity
> for something that only exists until the next reboot, and the only time
> I could attempt to migrate would be if a tmpfs is already mounted on
> /run.

Is adding a /run/openrc symlink to /lib/rc/init.d if /run is non-tmpfs a too ugly hack?
Comment 6 William Hubbs gentoo-dev 2012-05-08 18:46:31 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > Reading state data from both locations would add much code complexity
> > for something that only exists until the next reboot, and the only time
> > I could attempt to migrate would be if a tmpfs is already mounted on
> > /run.
> 
> Is adding a /run/openrc symlink to /lib/rc/init.d if /run is non-tmpfs a too
> ugly hack?

Thinking from upstream for a moment, /run may not exist, and in that case, openrc can't create it; it is up to the distro to make sure that it exists.

It is true that I can (and probably will for now) have the openrc ebuild create /run, but for non-gentoo openrc users that doesn't solve the issue.

Also, if we put a link in /run/openrc->/lib/rc/init.d, we have to add code when we boot that checks for and removes the link before we mount the tmpfs on /run. I would rather not leave an orphaned symlink in the /run directory.
Comment 7 Maxim Kammerer 2012-05-08 22:13:24 UTC
(In reply to comment #6)
> Thinking from upstream for a moment, /run may not exist, and in that case,
> openrc can't create it; it is up to the distro to make sure that it exists.

Can you really emerge openrc in that situation? There will be no mountpoint on boot for tmpfs /run. I thought that you intended to depend on the relevant baselayout version (does it exist yet?) if /run is mandatory.

> Also, if we put a link in /run/openrc->/lib/rc/init.d, we have to add code
> when we boot that checks for and removes the link before we mount the tmpfs
> on /run. I would rather not leave an orphaned symlink in the /run directory.

True, that's why I called it an ugly hack...
Comment 8 William Hubbs gentoo-dev 2012-05-09 02:15:41 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > Thinking from upstream for a moment, /run may not exist, and in that case,
> > openrc can't create it; it is up to the distro to make sure that it exists.
> 
> Can you really emerge openrc in that situation? There will be no mountpoint
> on boot for tmpfs /run. I thought that you intended to depend on the
> relevant baselayout version (does it exist yet?) if /run is mandatory.

Eventually I will depend on a version of baselayout that makes /run, but it doesn't exist yet. So what I'll have to do is, make the /run directory in the OpenRC ebuild to make the directory. I'm already doing that in the udev ebuild for the same reason, and it is being done at least in the systemd ebuild as well. I don't know of any others.

The bug requesting this in baselayout, for reference, is bug #361349.
Comment 9 William Hubbs gentoo-dev 2012-05-16 23:21:20 UTC
This is fixed in commit 82d3918.
Thanks for the report.