O.K., I booted GNOME and searched for some way to accomplish this, but couldn't find any. (The closest I got was the gnome-session-properties
command that lets you change the startup
scripts, and save your session when you log out so any program(s) you had running will be restarted.
Have you tried writing a shutdown
script that replaces the /sbin/shutdown
command? Something like this:
$ cat /usr/local/bin/shutdown
sudo umount --all --force --type cifs
exec sudo /sbin/shutdown $*
which I wrote when my system was hanging during shutdown waiting for the Window$ system to respond to an umount
command. (I had originally changed the symlink of shutdown
to point to that script, but often when systemd
gets updated, the symlink is reset.)
Note that I have "Unbuntized" my sudo
so I don't need to enter a password. (Not recommended for any system needing security.
I haven't actually tried that script under GNOME, but it, or something like it, might work for you.