-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
mount: use libmount to monitor mountinfo & utab #986
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
Conversation
|
I guess we should need to wait for v2.27 final before merging this. @martinpitt, could you provide a PPA for 14.04? That would be needed for Sempahore to work. |
|
Ok, v2.27 is now final, thanks @karelzak! |
|
@zonque: Working on a PPA. The package needs some adjustments to work on 14.04; in particular I need to disable the systemd support to avoid circular build deps, and backport some build tools. But I should have it working today. |
|
I prepared a PPA with that: https://launchpad.net/~pitti/+archive/ubuntu/systemd-semaphore . This is a new one which will only get backports for these upstream semaphore builds, nothing else. (I have different PPAs for packages of systemd itself). So doing on these boxes should work now. I tested the upgrade and a reboot on a current 14.04 cloud image (which I suppose is very close to what semaphore uses), and it works well enough. @zonque , can you please give this a spin? |
|
@martinpitt for this to work, we need to have a newer version of libmount as well. Could you include that package in the PPA? |
|
@zonque : it's all there -- can you please post |
|
@zonque, ah, I see it: I. e. you already have the 14.04 version installed. You did the |
|
@martinpitt yes, sorry, my bad. That was a Semaphore command ordering issue. That's also related to a bug in their UI which I just reported :) |
|
Oh wait -- could it be that this just checks out the proposed branch, instead of pulling the proposed commits on top of trunk and building that? That might also explain why it can build the package (ish) but there are conflicts when merging. |
|
Sure, there is no 'trunk' in git ;) Semaphore checks out the branch in question, and builds it, no matter what it is based on. And this branch is based on a patch that is /way/ older than the unified cgroups rework, so that's most definitely unrelated. I'm digging. |
Sorry, I meant "master" of course :-) I did a manual run of the commands in https://semaphoreci.com/systemd/systemd/branches/pull-request-986/builds/1 in a 14.04 cloud image, and build/tests succeed. Can you do a run on master, to compare? |
|
The problem is that However, I'm not sure if we can make a non-existing @karelzak could you shed some light on the rationale here? |
|
@zonque we have not supported systems with /etc/mtab as real file since a long long time. We even taint the system if you have one there and warn loudly at boot. Yes, /etc/mtab as symlink or non-existant is a hard requirement of systemd and has been since a long long time. |
|
@poettering ok, makes sense. However, we currently just warn about the fact. With this PR merged, PID1 simply hits an assertion and dies. So we need some better way to catch that. Anyway, this branch needs rebasing. @karelzak do you wanna to do that? |
|
FTR, I did add the |
|
Rebased. Notes:
The /etc/mtab file is mess on all systems with or without systemd. It provides non-senses about bind mounts, NFS ro/rw flags, it's incompatible with namespaces, etc. /run/mount/utab is not perfect (for example it's also not compatible with namespaces), but we use it only for very small subset of mounpoints where userspace mount options are specified and on many system it's empty file. (And it's private file, no API like mtab.) |
|
Ok, understood. We should not, however, confront the user with a cryptic error message ( |
|
Looks good otherwise. Might need rebase due to #1218 having been merged. |
|
I'll cleanup & rebase later today. Thanks for review. |
|
Rebased & improved (based on @poettering feedback). Note I have removed mtab detection from mnt_monitor_enable_userspace() libmount upstream code (the change will be in 2.27.1). It seems better to rely on mtab check during systemd startup bcce718 than try to detect broken system setting in libmount. |
|
2015-09-11 12:06 GMT+02:00 Karel Zak notifications@github.com:
I think it's fine to bump the log message from warning to error, but given Why is it that all of the instruments seeking intelligent life in the |
Seconded -- at least you should get a rescue shell. We've seen all kinds of weird scripts that try to carelessly sed |
|
As an alternative, we might just as well let systemd turn /etc/mtab into a symlink if it isn't one yet. We sort of do that already in Debian where we've been shipping a .service unit running really early during boot which converted /etc/mtab into a symlink to /proc/mounts. We've been shipping that for the last two releases and we didn't have any complaints because of that. Freezing is really user unfriendly. As Martin mentioned, there are enough buggy scripts or old backups out there. And if this renders your server which is 5000km away unbootable without OOB access, then this is not the best user experience. |
|
@mbiebl downstream that still needs this ( I think Arch,Fedora,Mageia,Opensuse and probably more all stop doing that in 2011 ) should be able to carry downstream patch that reverts this and the use case Martin points out should not be applicable since you would not be shipping these changes in core/baseOS components for your stable version ( unless for some reason you suddenly decided shipping updated core/baseOS component in stable and or LTS releases ). |
|
@johannbg you missed the point where I mentioned that in Debian we converted /etc/mtab to a symlink two releases ago, so your complaint is unfounded. |
|
We want error on regular mtab, if you have regular mtab, then your system is no compatible with systemd. That's all the sorry. |
The current implementation directly monitor /proc/self/mountinfo and /run/mount/utab files. It's really not optimal because utab file is private libmount stuff without any official guaranteed semantic. The libmount since v2.26 provides API to monitor mount kernel & userspace changes and since v2.27 the monitor is usable for non-root users too. This patch replaces the current implementation with libmount based solution. Signed-off-by: Karel Zak <kzak@redhat.com>
|
Rebased & improved (based on @poettering feedback). |
mount: use libmount to monitor mountinfo & utab
The src flavor with systemd from git master requires the last version of libmount. Symptoms: > configure: error: *** libmount support required but libraries not found Semaphore does not have the correct version. This patch installs the last version as explained on systemd/systemd#986
The src flavor with systemd from git master requires the last version of libmount. Symptoms: > configure: error: *** libmount support required but libraries not found Semaphore does not have the correct version. This patch installs the last version as explained on systemd/systemd#986
The src flavor with systemd from git master requires the last version of libmount. Symptoms: > configure: error: *** libmount support required but libraries not found Semaphore does not have the correct version. This patch installs the last version as explained on systemd/systemd#986
This pull request is replacement of the obsolete #194.
_Note that after merge systemd will depend on util-linux v2.27 (now -rc1), the package is available in f23 and fedora rawhide._
dnf --enablerepo rawhide update util-linux
is your friend if you use f22 (it's safe to upgrade). Not sure about another distros. The final v2.27 release is planned at the end of the August.