You are not logged in.
I am using Devuan Excalibur and I have mounted various CIFS shares in fstab at startup.
Now I want to unmount these shares before shutdown.
I created the folders Data and Storage in my home directory as mountpoint for theses shares.
I tried this with the following simple script:
#!/bin/sh
umount -l /home/user/Data
umount -l /home/user/Storage
exitI saved this script in the folder /etc/NetworkManager/dispatcher.d/pre-down.d and then made it executable with the command
sudo chmod +x /etc/NetworkManager/dispatcher.d/pre-down.d/umount.shNevertheless, it takes about 3 minutes for the system to shut down.
Thank you in advance for your help an tips.
Regards
Roberto
Last edited by Roberto (Yesterday 12:46:13)
Offline
Do you really want that script to exit before the unmounting has completed?
If not, then don't use "-l" as umount option.
Offline
Rename the script cifsdown.sh, copy to /etc/init.d, give it executable rights like you already did then create a symlink in /etc/rc0.d Make sure the sym-link in /etc/rc0.d is named K01cfisdown.sh DO NOT deviate from that name, as the order of shutting down services is important.
Alternatively, execute the following line by line:
sudo su #only if you use sudo, otherwise just use su instead
mv /etc/NetworkManager/dispatcher.d/pre-down.d/umount.sh /etc/init.d/cifsdown.sh
chmod +x /etc/init.d/cifsdown.sh
ln -s /etc/init.d/cifsdown.sh /etc/rc0.d/K01cifsdown.shYou can use cp instead of mv to keep a copy in the original location. That's the difference between cp and mv: cp leaves a copy, mv (move) doesn't. Make sure you disable the script left there before rebooting:
chmod -x /etc/NetworkManager/dispatcher.d/pre-down.d/umount.shHTH!
Offline