-   Linux - Newbie (
-   -   Run some commands on system shutdown (

luizrolla 07-12-2004 07:04 PM

Run some commands on system shutdown
Hi, does anyone know how can I configure my Fedora Core 2 distribution to run some commands when it is shutting down?

More specifically, I need to run "/sbin/dhclient -r" for it to release the IP from the DHCP server, before it turns my eth0 interface down. I actually can't remember if this has to be as root user, but I think it does... so I'd need to run it as root.

It would be great if it was possible on shutdown, but I think that on logout it would solve my problem too.

Finlay 07-12-2004 07:42 PM

I'm a slacker myself so not sure if fedora has a special script or not. but i would think the simplist approach would be to make a simple script that would release your IP then either logout or shutdown.

#shutdown script
/sbin/dhclient -r
shutdown -h now

All times are GMT -5. The time now is 05:50 AM.