-
Notifications
You must be signed in to change notification settings - Fork 119
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
Need better tracking of nbd-client status under systemd #91
Comments
This is complicated to do right in the face of the new netlink configuration interface. Why do you need to track this, though? I might be missing something, but I don't see the need...? |
Fair question. This is an XY problem, and I should explain the root. Sorry this is a bit long. To the best of my knowledge, this is a minimal example of a genuine issue. I have the following situation: a service depends on having a partition mounted, and the partition is located on a network block device. I hope you would agree that this is a reasonable use case for NBD, and that it would be nice for systemd to handle the dependencies. Here are the files:
Having run
However this is not the observed behavior. Instead:
As you can see, the service fails to start due to a failed dependency (the mount), which fails to start due to a failed dependency (the partition device). Checking dependencies of
So, from systemd's perspective, Analysis (my best guess)The cause is that Eventually, it seems, systemd attempts to start
Everything runs just fine. There is no issue of functionality, only communicating the state of the device properly to systemd. My idea of the root issue is that
(emphasis mine) Clearly, systemd expects to be reponsible for managing the main process of the service (or at least being able to keep track of it), and since it cannot, that causes merry hell going down the dependency chain. Proposed solutionsMy initial thought (and the issue I opened) was to just add a Another option is to use the Versions
|
Ah, yes.
However, recent versions of You can work around the issue by adding |
This seemed to work for me:
For some reason I also had to make my mount unit depend explicitly on
|
Hey guys, I'm trying to make My system is Ubuntu 20.04.1 with Linux 5.4. I tried both suggestions, the As a workaround, changed the
So, now, it works on boot! Cheers! |
It turns out that the
The |
I wrote up my working instructions here: https://libguestfs.org/nbdkit-client.1.html#Easy-mounting-at-boot-time |
Tracking the status of an nbd-client process from systemd is annoying.
nbd-client -check
allows interactive determination of the PID, but life would be a easier with that information in a pidfile.The text was updated successfully, but these errors were encountered: