New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
community/lxcfs: Modprobe modules instead of failing when absent #4991
Conversation
Ping @itoffshore |
needs tabs instead of spaces in the patch to fix the alignment of running |
Branch updated. |
I don' think this will work. modprobe will return an error when the filesystem is compiled in to kernel instead of module: We need to check if the filessystem is available in kernel and try modprobe if it isnt. Something like: diff --git a/community/lxcfs/lxcfs.initd b/community/lxcfs/lxcfs.initd
index 1a6e9c9759..496d6156fb 100644
--- a/community/lxcfs/lxcfs.initd
+++ b/community/lxcfs/lxcfs.initd
@@ -19,14 +19,11 @@ depend() {
}
start_pre() {
- local module=
+ local filesystem=
checkpath --directory ${VARDIR}
- for module in fuse autofs4; do
- if ! $(lsmod | grep -q ^$module); then
- eerror "Enable module: $module"
- eerror "modprobe $module"
- eerror "echo $module >> /etc/modules"
- eend 1
+ for filesystem in fuse autofs4; do
+ if ! grep -q -w $filesystem /proc/filesystems; then
+ modprobe $filesystem || return 1
fi
done
} modprobe will print error message so I don't think we need print any error message with |
@ncopa There is See second headline here:
You can confirm this behavior by modprobing
|
Previously, lxcfs failed when the kernel modules were not listed the lsmod output. Built-in kernel modules never show up in lsmod, thus the service could not be properly started on such systems. Fixes #9214.
❤️ |
Merged in c0513a0 by @ncopa. Thanks for your contribution! (This pull request has been closed automatically by GitHub PR Closer. If you think that it’s not resolved yet, please add a comment.) |
You guys ares awesome! Thanks @ncopa, I'm a big fan! |
'modprobe fuse autofs4' will pass autofs4 as an argument to fuse module loading, which is not what was intended here. Using modprobe with -a properly loads both modules, or skips if they were built-in, and fails if one of those was neither built-in nor a module. Not actually using lxc so not tested, found by manually looking at the PR looking at autofs or fuse: both actually should be loaded automatically by the kernel when a pre-created device is opened, but alpine does not seem to have a way of pre-creating such devices, so keeping the modprobe here. Link: #4991
Previously, lxcfs failed when the kernel modules were not listed the lsmod
output. Built-in kernel modules never show up in lsmod, thus the service
could not be properly started on such systems.
Fixes #9214.