[opensuse] systemd, fstab and nfs mounts
Hi *, I have the following two entries in my /etc/fstab: # nfs mounts video.domain.my:/var/spool/video/video0 /var/spool/video/video0 nfs auto,_netdev 0 0 video.domain.my:/var/spool/video/video0 /upnp-root-remote/VDR_Videos nfs auto,_netdev 0 0 On Leap 42.3 with latest hotfixes I always get an error on boot for the second one, while the first one mounts correctly. In the journal one can see the following entries: ------------------------< snip snip snip >----------------------------- [...] 21:51:20 syslogsrv systemd[1]: Mounting /upnp-root-remote/VDR_Videos... [...] 21:51:23 syslogsrv systemd[1]: upnp\x2droot\x2dremote-VDR_Videos.mount: Mount process exited, code=exited status=32 21:51:21 syslogsrv named[3077]: listening on IPv4 interface lo, 127.0.0.1#53 21:51:23 syslogsrv systemd[1]: Failed to mount /upnp-root-remote/VDR_Videos. 21:51:21 syslogsrv named[3077]: listening on IPv4 interface br0, 192.168.1.8#53 21:51:23 syslogsrv systemd[1]: Dependency failed for Remote File Systems. 21:51:21 syslogsrv named[3077]: listening on IPv4 interface br0:1, 192.168.129.8#53 21:51:24 syslogsrv systemd[1]: remote-fs.target: Job remote-fs.target/start failed with result 'dependency'. 21:51:24 syslogsrv systemd[1]: upnp\x2droot\x2dremote-VDR_Videos.mount: Unit entered failed state. 21:51:30 syslogsrv mount[3010]: mount.nfs: Failed to resolve server video.domain.my: Name or service not known [...] 21:51:37 syslogsrv systemd[1]: Started NFS server and services. 21:51:37 syslogsrv systemd[1]: Mounting /var/spool/video/video0... 21:51:38 syslogsrv systemd[1]: Starting Notify NFS peers of a restart... 21:51:39 syslogsrv systemd[1]: Mounted /var/spool/video/video0. 21:51:40 syslogsrv systemd[1]: Started Notify NFS peers of a restart. [...] ------------------------< snip snip snip >----------------------------- systemd tries to mount the second fstab entry before the network and name resolution are available, while the first one is mounted correctly after the network is available and named has been started. And yes, the entries are shown in that order in the journal, though the time seems to jump back and forth. I can't see any difference between the two entries. Why does systemd treat them different? Thx and bye. Michael. -- Michael Hirmke -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
24.03.2018 21:35, Michael Hirmke пишет:
Hi *,
I have the following two entries in my /etc/fstab:
# nfs mounts video.domain.my:/var/spool/video/video0 /var/spool/video/video0 nfs auto,_netdev 0 0 video.domain.my:/var/spool/video/video0 /upnp-root-remote/VDR_Videos nfs auto,_netdev 0 0
On Leap 42.3 with latest hotfixes I always get an error on boot for the second one, while the first one mounts correctly.
In the journal one can see the following entries:
------------------------< snip snip snip >----------------------------- [...] 21:51:20 syslogsrv systemd[1]: Mounting /upnp-root-remote/VDR_Videos... [...] 21:51:23 syslogsrv systemd[1]: upnp\x2droot\x2dremote-VDR_Videos.mount: Mount process exited, code=exited status=32 21:51:21 syslogsrv named[3077]: listening on IPv4 interface lo, 127.0.0.1#53 21:51:23 syslogsrv systemd[1]: Failed to mount /upnp-root-remote/VDR_Videos. 21:51:21 syslogsrv named[3077]: listening on IPv4 interface br0, 192.168.1.8#53 21:51:23 syslogsrv systemd[1]: Dependency failed for Remote File Systems. 21:51:21 syslogsrv named[3077]: listening on IPv4 interface br0:1, 192.168.129.8#53 21:51:24 syslogsrv systemd[1]: remote-fs.target: Job remote-fs.target/start failed with result 'dependency'. 21:51:24 syslogsrv systemd[1]: upnp\x2droot\x2dremote-VDR_Videos.mount: Unit entered failed state. 21:51:30 syslogsrv mount[3010]: mount.nfs: Failed to resolve server video.domain.my: Name or service not known [...] 21:51:37 syslogsrv systemd[1]: Started NFS server and services. 21:51:37 syslogsrv systemd[1]: Mounting /var/spool/video/video0... 21:51:38 syslogsrv systemd[1]: Starting Notify NFS peers of a restart... 21:51:39 syslogsrv systemd[1]: Mounted /var/spool/video/video0. 21:51:40 syslogsrv systemd[1]: Started Notify NFS peers of a restart. [...] ------------------------< snip snip snip >-----------------------------
systemd tries to mount the second fstab entry before the network and name resolution are available, while the first one is mounted correctly after the network is available and named has been started. And yes, the entries are shown in that order in the journal, though the time seems to jump back and forth.
I can't see any difference between the two entries. Why does systemd treat them different?
systemctl show upnp\x2droot\x2dremote-VDR_Videos.mount var-spool-video-video0.mount would be good start. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Hi, [...]
systemd tries to mount the second fstab entry before the network and name resolution are available, while the first one is mounted correctly after the network is available and named has been started. And yes, the entries are shown in that order in the journal, though the time seems to jump back and forth.
I can't see any difference between the two entries. Why does systemd treat them different?
systemctl show upnp\x2droot\x2dremote-VDR_Videos.mount var-spool-video-video0.mount would be good start.
they differ in a few entries: ------------------------< snip snip snip >----------------------------- [...] < Result=exit-code ---
Result=success [...] < After=network.target remote-fs-pre.target -.mount systemd-journald.socket system.slice network-online.target < RequiresMountsFor=/upnp-root-remote
After=system.slice network-online.target systemd-journald.socket remote-fs-pre.target -.mount nfs-server.service network.target RequiresMountsFor=/var/spool/video [...] < NeedDaemonReload=yes
NeedDaemonReload=no [...] ------------------------< snip snip snip >-----------------------------
The difference for After= can explain the different behaviour on boot. But both entries are created by systemd-fstab-generator. So the question keeps the same: Why is systemd treating both entries different? Thx and bye. Michael. -- Michael Hirmke -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
24.03.2018 22:54, Michael Hirmke пишет:
Hi,
[...]
systemd tries to mount the second fstab entry before the network and name resolution are available, while the first one is mounted correctly after the network is available and named has been started. And yes, the entries are shown in that order in the journal, though the time seems to jump back and forth.
I can't see any difference between the two entries. Why does systemd treat them different?
systemctl show upnp\x2droot\x2dremote-VDR_Videos.mount var-spool-video-video0.mount would be good start.
they differ in a few entries:
------------------------< snip snip snip >----------------------------- [...] < Result=exit-code ---
Result=success [...] < After=network.target remote-fs-pre.target -.mount systemd-journald.socket system.slice network-online.target < RequiresMountsFor=/upnp-root-remote
After=system.slice network-online.target systemd-journald.socket remote-fs-pre.target -.mount nfs-server.service network.target RequiresMountsFor=/var/spool/video [...] < NeedDaemonReload=yes
NeedDaemonReload=no [...] ------------------------< snip snip snip >-----------------------------
The difference for After= can explain the different behaviour on boot.
Actually it does not. nfs-server.service should not have any impact on remote mount (unless you do loopback mount from the same host, but your error is different). Are you using wicked or NetworkManager?
But both entries are created by systemd-fstab-generator.
It is possible to extend generated units as well. Start with "systemctl cat var-spool-video-video0.mount nfs-server.service" to check drop-ins for these units.
So the question keeps the same: Why is systemd treating both entries different?
This is side question (only out of curiosity). The actual question is - what is needed to ensure name resolution is available when NFS are mounted on boot. It depends on your configuration. Normal way to do it is to order remote mounts after nss-lookup.target. Your log entries suggest that you are running local resolver daemon; if it is used for local name resolution you need additionally order nss-lookup.target after it. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Hi, [...]
systemctl show upnp\x2droot\x2dremote-VDR_Videos.mount var-spool-video-video0.mount would be good start.
they differ in a few entries:
------------------------< snip snip snip >----------------------------- [...] < Result=exit-code ---
Result=success [...] < After=network.target remote-fs-pre.target -.mount systemd-journald.socket system.slice network-online.target < RequiresMountsFor=/upnp-root-remote
After=system.slice network-online.target systemd-journald.socket remote-fs-pre.target -.mount nfs-server.service network.target RequiresMountsFor=/var/spool/video [...] < NeedDaemonReload=yes
NeedDaemonReload=no [...] ------------------------< snip snip snip >-----------------------------
The difference for After= can explain the different behaviour on boot.
Actually it does not. nfs-server.service should not have any impact on remote mount (unless you do loopback mount from the same host, but your error is different).
Are you using wicked or NetworkManager?
I'm using wicked. With NetworkManager on my Tumblewed systems I also had problems, but could solve them using dispatcher scripts. For wicked I didn't find such a thing.
But both entries are created by systemd-fstab-generator.
It is possible to extend generated units as well. Start with "systemctl cat var-spool-video-video0.mount nfs-server.service" to check drop-ins for these units.
Ok.
So the question keeps the same: Why is systemd treating both entries different?
This is side question (only out of curiosity). The actual question is -
Can/should I recreate them by deleting them and running generator again?
what is needed to ensure name resolution is available when NFS are mounted on boot. It depends on your configuration. Normal way to do it is to order remote mounts after nss-lookup.target. Your log entries suggest that you are running local resolver daemon; if it is used for local name resolution you need additionally order nss-lookup.target after it.
named is used for local name resolution, too - indeed. named on Leap 42.3 still is an init script 8-< How would I solve this? As far as I know, there is no feature like Before= for init scripts. Do I have to create a systemd service for named instead? Thy and bye. Michael. -- Michael Hirmke -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
25.03.2018 12:18, Michael Hirmke пишет:
Hi,
[...]
systemctl show upnp\x2droot\x2dremote-VDR_Videos.mount var-spool-video-video0.mount would be good start.
they differ in a few entries:
------------------------< snip snip snip >----------------------------- [...] < Result=exit-code ---
Result=success [...] < After=network.target remote-fs-pre.target -.mount systemd-journald.socket system.slice network-online.target < RequiresMountsFor=/upnp-root-remote
After=system.slice network-online.target systemd-journald.socket remote-fs-pre.target -.mount nfs-server.service network.target RequiresMountsFor=/var/spool/video [...] < NeedDaemonReload=yes
NeedDaemonReload=no [...] ------------------------< snip snip snip >-----------------------------
The difference for After= can explain the different behaviour on boot.
Actually it does not. nfs-server.service should not have any impact on remote mount (unless you do loopback mount from the same host, but your error is different).
Are you using wicked or NetworkManager?
I'm using wicked. With NetworkManager on my Tumblewed systems I also had problems, but could solve them using dispatcher scripts. For wicked I didn't find such a thing.
But both entries are created by systemd-fstab-generator.
It is possible to extend generated units as well. Start with "systemctl cat var-spool-video-video0.mount nfs-server.service" to check drop-ins for these units.
Ok.
So the question keeps the same: Why is systemd treating both entries different?
This is side question (only out of curiosity). The actual question is -
Can/should I recreate them by deleting them and running generator again?
As I suggested, first check with "systemctl cat" where configuration comes from. Before and After are not transitive - they must be defined in one of two units.
what is needed to ensure name resolution is available when NFS are mounted on boot. It depends on your configuration. Normal way to do it is to order remote mounts after nss-lookup.target. Your log entries suggest that you are running local resolver daemon; if it is used for local name resolution you need additionally order nss-lookup.target after it.
named is used for local name resolution, too - indeed.
named on Leap 42.3 still is an init script 8-< How would I solve this? As far as I know, there is no feature like Before= for init scripts. Do I have to create a systemd service for named instead?
initscript is still unit (actually, in current systemd generator creates native unit definition out of initscript) so you can use standard ways 1. systemctl edit - it allows you to edit drop-in file for a unit - *any* unit actually. This drop-in is persistent and is merged into unit definition when systemd reads definition. 2. You can add x-systemd.requires=named.service (or whatever is it called) to /etc/fstab options. This is equivalent to both Requires and After in generated mount unit. Note that it is more strong than simple After; it is up to you to decide what is appropriate. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Hi, [...]
It is possible to extend generated units as well. Start with "systemctl cat var-spool-video-video0.mount nfs-server.service" to check drop-ins for these units.
[...]
initscript is still unit (actually, in current systemd generator creates native unit definition out of initscript) so you can use standard ways
1. systemctl edit - it allows you to edit drop-in file for a unit - *any* unit actually. This drop-in is persistent and is merged into unit definition when systemd reads definition.
ic, didn't know that.
2. You can add x-systemd.requires=named.service (or whatever is it called) to /etc/fstab options. This is equivalent to both Requires and After in generated mount unit. Note that it is more strong than simple After; it is up to you to decide what is appropriate.
Thx a lot. I'll test what better serves my needs. Bye. Michael. -- Michael Hirmke -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Hi, [...]
1. systemctl edit - it allows you to edit drop-in file for a unit - *any* unit actually. This drop-in is persistent and is merged into unit definition when systemd reads definition.
ic, didn't know that.
it was sufficient to add the dependency for nss-lookup.target to the named.service file: ------------------------< snip snip snip >----------------------------- systemctl cat named.service # /run/systemd/generator.late/named.service # Automatically generated by systemd-sysv-generator [Unit] Documentation=man:systemd-sysv-generator(8) SourcePath=/etc/init.d/named Description=LSB: Domain Name System (DNS) server, named Before=multi-user.target graphical.target nss-lookup.target stor_agent.service After=network-online.target ldap.service Wants=nss-lookup.target network-online.target [Service] Type=forking Restart=no TimeoutSec=5min IgnoreSIGPIPE=no KillMode=process GuessMainPID=no RemainAfterExit=yes ExecStart=/etc/init.d/named start ExecStop=/etc/init.d/named stop ExecReload=/etc/init.d/named reload # /etc/systemd/system/named.service.d/override.conf [Unit] Before=nss-lookup.target ------------------------< snip snip snip >----------------------------- Thx again. Bye. Michael. -- Michael Hirmke -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Hi again,
Hi,
[...]
1. systemctl edit - it allows you to edit drop-in file for a unit - *any* unit actually. This drop-in is persistent and is merged into unit definition when systemd reads definition.
ic, didn't know that.
it was sufficient to add the dependency for nss-lookup.target to the named.service file:
two reboots later I had to realize, that this solution wasn't sufficient. It only works for every second boot 8-/ So I used the second suggestion and added x-systemd.requires=named.service to my fstab entries. So far this seems to work - for at least 4 reboots. [...] Thx again. Bye. Michael. -- Michael Hirmke -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (2)
-
Andrei Borzenkov
-
mh@mike.franken.de