Quote Originally Posted by gjaltemba
I have tried putting a script in /usr/lib/systemd/system-shutdown folder but it does not run at shutdown. I can run the script manually and then shutdown will complete.

How do I run umount before shutdown?
That approach (in /usr/lib/systemd/system-shutdown DIRECTORY) looks like the right thing. Did you set the permissions and SELinux context ?

(on F23)
Code:
[stevea@hypoxylon system-shutdown]$ ls -lZ /usr/lib/systemd/system-shutdown
total 4
-rwxr-xr-x. 1 root root system_u:object_r:lib_t:s0 164 Jun  3 10:18 mdadm.shutdown
systemd binary documentation is dodgey, but I'd name the file something.shutdown just to avoid questions that only a source code review can resolve.