void-linux/void-runit

Nfs share doesn't mount on boot

kanyck opened this issue · 9 comments

Tried diffrerent options in /etc/fstab with no success.
Remote directory doesn't mount on boot while mount -a works just fine.
I suppose it's due to parallel nature of runit.
Of course I can add something like sleep 2 ; mount -a to /etc/rc.local as an ugly workaround but I wander if there's more graceful way to solve this issue.

Don't need to do a sleep (which is a race condition), just make sure it happens after network comes up.

just make sure it happens after network comes up

That is an actual question: how to make it if runit doesn't provide any mechanisms for that (at least I don'n know about them).

Network typically comes up as a service, so you'd make it a service.

you'd make it a service

What? mount -a? And runit will restart it infinitely?
BTW /etc/rc.local won't help, for it is executed before stage 2 services, and I need to start it after.

The service would mount a specific mount point, you would check the mount /share return code end exit non-zero if mount returns non-zero. If it returns 0 you would exec into pause.

This works, but is really not a nice solution, because if the connection is lost, you have no way to make the service restart automatically.

I think I would use autofs with a high timeout instead to mount it on demand and make it reconnect automatically.

I see. Thank you! Autofs seems to be able to make the job, indeed. Apparently runit has major restrictions in comparison to OpenRC I used to. Isn't there anything like net post-up in Void?

There are no real dependencies, this can be worked around with services like the NetworkManager servoce, running sv check dbus || exit 1 in combination with the dbus services check script.
So the service will restart until sv check dbus returns 0.

Another limitation is, that there are no "oneshot" services, so some services like the alsa service work around it by executing into pause.

So the main idea of the supervision suites is, that they are simple and services are long running processes that fail if possible dependency is missing so that the supervision suite can just restart the failing services until the whole thing resolved itself.

@kanyck have you checked out the sv-netmount package?

No, I just abandoned void linux when update has broke my system badly as a consequence of the dev's conflict.
Anyway, I find runit to be an improper init system from technical POV, for it doesn't have mechanisms to implement simple and obviously needed things (like one-time runs -- consolefont, firewall, etc. and -- yes! -- the dependencies) as well as it's obviously can't process situations like described in this issue without bringing in ugly kludges. Over-simplification is sometimes not much better than over-complication. OpenRC and (maybe) s6 rule:-) Closing.