I am trying to set up a systemd service on Debian 8 to run a program from the network on startup but it does not work - the service starts before mounting NFS disks have completed. I have the following setup:
# cat /etc/auto.master | grep -v "#"
+dir:/etc/auto.master.d
+auto.master
/fs-1 /etc/auto.fs-1
# cat /etc/auto.fs-1
shared -nosuid,nodev fs-1:/shared
ls -l / | grep shared
lrwxrwxrwx 1 root root 12 Oct 19 14:33 build -> /fs-1/shared
# cat /usr/lib/systemd/system/psr_25.service
[Unit]
Description=PSR 2.5 Server
Wants=network.target network-online.target autofs.target
After=network.target network-online.target autofs.target
RequiresMountsFor=/shared/psr/25/bin
[Service]
Type=forking
User=testuser
ExecStart=/shared/psr/25/bin/server
TimeoutSec=300
[Install]
WantedBy=multi-user.target
How to make the service start after /shared has mounted?
/etc/fstab
entries and letsystemd
mount those at boot.