With fedora 15 or 16, I don't find the directory for execute a shell script automaticaly at shutdown...
Fedora 16 has replaced the legacy "System V" style init scripts -- which let you run scripts at startup and shutdown via scripts in
/etc/rc.d -- with systemd. You can create a systemd service file that runs a shell script when it starts and stops, much like a traditional init script. Put something like the following in
[Service] Type=forking ExecStart=/path/to/myscript start ExecStop=/path/to/myscript stop TimeoutSec=0 RemainAfterExit=yes [Install] WantedBy=multi-user.target
With this in place, you can then run:
# chkconfig runonshutdown on ln -s '/lib/systemd/system/runonshutdown.service' '/etc/systemd/system/multi-user.target.wants/runonshutdown.service'
When your system boots, it will run
/path/to/myscript start, and
when your system shuts down, it will run
For more information, read the
systemd.service(5) man page.