I want to mount a NFS-Share after the login, since mounting it via fstab will prolong my boot process if the NAS isn't reachable.
So I thought about a systemd --user service.
[Unit]
Description=Mounting the GuendoNAS
After=network.target
[Service]
User=root
Type=oneshot
ExecStart=/usr/bin/mount -t nfs 10.0.0.64:/disk1 /storage/guendonas/disk1
ExecStart=/usr/bin/mount -t nfs 10.0.0.64:/disk2 /storage/guendonas/disk2
[Install]
WantedBy=default.target
Which results in not GROUP spawninng /usr/bin/mount/: Operatio not permitted
Active: failed (Result: exit-code) since Fri 2016-01-22 19:06:02 CET; 25s ago
Main PID: 1968 (code=exited, status=216/GROUP)
Jan 22 19:06:02 Asgard systemd[604]: Starting Mounting the GuendoNAS...
Jan 22 19:06:02 Asgard systemd[1968]: guendomount.service: Failed at step GROUP spawning /usr/bin/mount: Operation not permitted
Jan 22 19:06:02 Asgard systemd[604]: guendomount.service: Main process exited, code=exited, status=216/GROUP
Jan 22 19:06:02 Asgard systemd[604]: Failed to start Mounting the GuendoNAS.
Jan 22 19:06:02 Asgard systemd[604]: guendomount.service: Unit entered failed state.
Jan 22 19:06:02 Asgard systemd[604]: guendomount.service: Failed with result 'exit-code'.
I am not sure why this happens, because the service should run as user root or is this permitted with a systemd --user service? What would be the alternative? I could make an autostart script however I want to use the service as dependency for other services