Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 898904 - sys-apps/openrc: OpenRC shouldn't filter init.d{localmount,netmount} on lxc containers
Summary: sys-apps/openrc: OpenRC shouldn't filter init.d{localmount,netmount} on lxc c...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: OpenRC Team
URL: https://discuss.linuxcontainers.org/t...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-02 12:08 UTC by Ed Wildgoose
Modified: 2025-01-02 00:36 UTC (History)
2 users (show)

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 Ed Wildgoose 2023-03-02 12:08:58 UTC
OpenRC filters /etc/init.d/{localmount,netmount} to not run on most containerised systems, including lxc (and others)

However, this doesn't necessarily seem correct. At least on LXD, we can't easily force mounts at boot and the recommended solution by upstream is to rely on fstab

Indeed, manually running localmount, correctly parses fstab and mounts local mounts, but we cannot force this at boot time

https://discuss.linuxcontainers.org/t/how-to-mount-tmp-as-tmpfs-in-alpine-linux/5070/9


I propose that we should drop at least "-lxc" from the init.d/{localmount,netmount} scripts. However, there might be an argument for dropping this for other jails/containers (docker, systemd-nspawn, vserver perhaps?) also?

Such a change has already been implemented in alpine (patch referenced in the thread above)
Comment 1 kiwi93872 2024-12-28 11:59:52 UTC
(In reply to Ed Wildgoose from comment #0)
> OpenRC filters /etc/init.d/{localmount,netmount} to not run on most
> containerised systems, including lxc (and others)

I have pathched my init.d/netmount so it does not ignore LXC. But as a result, I need to re-patch on every openrc upgrade.
I think that this behavior should be configurable via /etc/conf.d/{localmount,netmount}
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-12-28 15:00:11 UTC
(In reply to kiwi93872 from comment #1)
> (In reply to Ed Wildgoose from comment #0)
> > OpenRC filters /etc/init.d/{localmount,netmount} to not run on most
> > containerised systems, including lxc (and others)
> 
> I have pathched my init.d/netmount so it does not ignore LXC. But as a
> result, I need to re-patch on every openrc upgrade.

https://wiki.gentoo.org/wiki//etc/portage/patches
Comment 3 kiwi93872 2025-01-02 00:36:06 UTC
(In reply to Sam James from comment #2)
> (In reply to kiwi93872 from comment #1)

Thanks for pointing out. 
That is why I like Gentoo - it has a built-in customizer for almost everything.