I have the following nfd share folder on my linux client ( redhat 7.2 )
master1:/nfs 41932800 6601728 35331072 16% /nfsshare
we decided to use the service auto fs in case this share folder is unmounted
we created the following service ( according to link - https://michlstechblog.info/blog/systemd-automount-nfs-export/ )
ls -ltr auto-mnt.service
-rw-r--r-- 1 root root 212 May 10 12:38 auto-mnt.service
the conf
more auto-mnt.service
[Unit]
Description=nfs mount script
Requires=network-online.target
After=network-online.service
[Mount]
What=master1:/nfs
Where=/nfsshare
Options=
Type=nfs
[Install]
WantedBy=multi-user.target
and
systemctl daemon-reload
and
systemctl start auto-mnt.service
Failed to start auto-mnt.service: Unit auto-mnt.service failed to load: Invalid argument. See system logs and 'systemctl status auto-mnt.service' for details.
[root@ system]# systemctl status auto-mnt.service
● auto-mnt.service - nfs mount script
Loaded: error (Reason: Invalid argument)
Active: inactive (dead)
we not understand why service complain about -
[/etc/systemd/system/auto-mnt.service:6] Unknown section 'Mount'. Ignoring.
auto-mnt.service lacks both ExecStart= and ExecStop= setting. Refusing.
Unknown section 'Mount'. Ignoring
what is wrong in service syntax ?