2
1
we create the following service on redhat version 7.2
more nfsshare.mount
[Unit]
Description=nfs mount script
Requires=network-online.target
After=network-online.service
[Mount]
What=master1:/nfs
Where=/nfsshare
Options=noauto,user,rw,group
Type=nfs
TimeoutIdleSec=10
[Install]
WantedBy=multi-user.target
after restart the service the mount point is mounted as should be
master1:/nfs 41932800 6559744 35373056 16% /nfsshare
now we umount the /nfsshare folder
umount /nfsshare
now we expecting /nfsshare folder will be mounted again and service will automatically mout the folder
but nothing is happens and folder not mounted
where I am wrong here?
I also try
more nfsshare.automount
[Unit]
Description=nfs mount script
Requires=network-online.target
After=network-online.service
[Automount]
What=master1:/nfs
Where=/nfsshare
Options=noauto,user,rw,group
Type=nfs
TimeoutIdleSec=10
[Install]
WantedBy=multi-user.target
but this service even not mount the folder after restart