Run a script on shutdown before network goes off
Hi. Using K/X/Ubuntu 14.04, but it doesn't really matter as it should be the same in Debian as well.
It doesn't matter how simple script is, it can be: echo "put it" > /media/network/there echo "put it" > /home/user/there If i will put it a link to script to /etc/rc0.d with K04script name it will create file only on local machine, even if i put it in rc3.d and rc5.d with S04script it still doesn't work. Can someone help me? |
Maybe symbolic link? http://unix.stackexchange.com/questi...down-in-debain
|
Thats exactly what i did. The script runs but not before network goes down or network disks are unmount.
|
Ok, i've found a solution. Though i believe there should be a better way to do it as creating services just for that sounds strange.
Workaround using Upstart(i guess i'd have to write units if systemd will be used for this case as well). create a file /etc/init/your_name.conf if you want bash autocompletion to work put a link to /etc/init.d without ".conf" (/etc/init.d/your_name). Though i didn't try with it maybe it'll work too. In my case not needed anyway but if you'll write a script directly in *.conf and want to test it maybe useful. Put quoted inside of /etc/init/your_name.conf Quote:
|
All times are GMT -5. The time now is 08:20 PM. |