systemd has been a complete, utter, unmitigated success
systemd has been a complete, utter, unmitigated success
wiki.archlinux.org/title/Samba#As_systemd_unit
Thatâs the guide I followed on my desktop and laptop.
I have a service that pings the server:
cat <<EOF | sudo tee /etc/systemd/system/ping-smb.service [Unit] Description=Blocks until pinging 192.168.1.10 succeeds After=network-online.target StartLimitIntervalSec=0 [Service] Type=oneshot ExecStart=ping -c1 192.168.1.10 Restart=on-failure RestartSec=1 [Install] WantedBy=multi-user.target EOF sudo systemctl enable ping-smb.serviceAnd then I make the fstab entry depend on it:
x-systemd.requires=ping-smb.serviceRequires= in a .mount file.
Use
_netdev,nofail,x-systemd.device-timeout=10snofail doesnât interrupt the boot and 10 seconds is a more sane timeout. You can also use
x-systemd.automountAnd it will automatically mount the directory the first time it is accessed.