▲ 145 ▼ systemd has been a complete, utter, unmitigated success (blog.tjll.net) submitted 8 months ago by lemmydividebyzero@reddthat.com to c/technology@lemmy.world 84 comments fedilink hide all child comments
[–] avidamoeba@lemmy.ca 4 points 8 months ago (3 children) Network not ready by time the mount is executed? permalink fedilink source parent hideshow 3 child comments replies: [–] Eryn6844@piefed.blahaj.zone 2 points 8 months ago (2 children) yup, permalink fedilink source parent hideshow 2 child comments replies: [–] tinsuke@lemmy.world 4 points 8 months ago (1 child) 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.service And then I make the fstab entry depend on it: x-systemd.requires=ping-smb.service permalink fedilink source parent hideshow 1 child comment replies: [–] avidamoeba@lemmy.ca 3 points 8 months ago I had something similar when I used to mount an NFS share. I had a bash line that would loop ping and then mount once ping succeeds. Having a separate service that pings and making the mount dependent on it is probably the better thing to do. Should also work when put in Requires= in a .mount file. permalink fedilink source parent
[–] Eryn6844@piefed.blahaj.zone 2 points 8 months ago (2 children) yup, permalink fedilink source parent hideshow 2 child comments replies: [–] tinsuke@lemmy.world 4 points 8 months ago (1 child) 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.service And then I make the fstab entry depend on it: x-systemd.requires=ping-smb.service permalink fedilink source parent hideshow 1 child comment replies: [–] avidamoeba@lemmy.ca 3 points 8 months ago I had something similar when I used to mount an NFS share. I had a bash line that would loop ping and then mount once ping succeeds. Having a separate service that pings and making the mount dependent on it is probably the better thing to do. Should also work when put in Requires= in a .mount file. permalink fedilink source parent
[–] tinsuke@lemmy.world 4 points 8 months ago (1 child) 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.service And then I make the fstab entry depend on it: x-systemd.requires=ping-smb.service permalink fedilink source parent hideshow 1 child comment replies: [–] avidamoeba@lemmy.ca 3 points 8 months ago I had something similar when I used to mount an NFS share. I had a bash line that would loop ping and then mount once ping succeeds. Having a separate service that pings and making the mount dependent on it is probably the better thing to do. Should also work when put in Requires= in a .mount file. permalink fedilink source parent
[–] avidamoeba@lemmy.ca 3 points 8 months ago I had something similar when I used to mount an NFS share. I had a bash line that would loop ping and then mount once ping succeeds. Having a separate service that pings and making the mount dependent on it is probably the better thing to do. Should also work when put in Requires= in a .mount file. permalink fedilink source parent