After upgrading to Proxmox v8, I noticed that powering off / rebooting the host stops the nfs-server immediately, while VM are still running and connected to the NFS server.
I compared the systemd unit and this is what changed, but I'm not sure if the problem is here:
Thx
I compared the systemd unit and this is what changed, but I'm not sure if the problem is here:
Diff:
--- /tmp/pve1/lib/systemd/system/nfs-server.service 2021-06-28 09:15:06.000000000 +0200
+++ new-nfs-server.conf 2023-07-03 22:09:54.490884616 +0200
@@ -3,36 +3,31 @@
DefaultDependencies=no
Requires=network.target proc-fs-nfsd.mount
Requires=nfs-mountd.service
-Wants=rpcbind.socket
-Wants=nfs-idmapd.service
+Wants=rpcbind.socket network-online.target
+Wants=rpc-statd.service nfs-idmapd.service
+Wants=rpc-statd-notify.service
+Wants=nfsdcld.service
-After=local-fs.target
-After=network.target proc-fs-nfsd.mount rpcbind.socket nfs-mountd.service
+After=network-online.target local-fs.target
+After=proc-fs-nfsd.mount rpcbind.socket nfs-mountd.service
After=nfs-idmapd.service rpc-statd.service
+After=nfsdcld.service
Before=rpc-statd-notify.service
# GSS services dependencies and ordering
-Wants=auth-rpcgss-module.service
+Wants=auth-rpcgss-module.service rpc-svcgssd.service
After=rpc-gssd.service gssproxy.service rpc-svcgssd.service
-# start/stop server before/after client
-Before=remote-fs-pre.target
-
-Wants=nfs-config.service
-After=nfs-config.service
-
[Service]
-EnvironmentFile=-/run/sysconfig/nfs-utils
-
Type=oneshot
RemainAfterExit=yes
-ExecStartPre=/usr/sbin/exportfs -r
-ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS
+ExecStartPre=-/usr/sbin/exportfs -r
+ExecStart=/usr/sbin/rpc.nfsd
ExecStop=/usr/sbin/rpc.nfsd 0
ExecStopPost=/usr/sbin/exportfs -au
ExecStopPost=/usr/sbin/exportfs -f
-ExecReload=/usr/sbin/exportfs -r
+ExecReload=-/usr/sbin/exportfs -r
[Install]
WantedBy=multi-user.target
Thx