LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 07-12-2004, 07:04 PM   #1
luizrolla
LQ Newbie
 
Registered: Sep 2003
Location: Belo Horizonte, Brazil
Distribution: Fedora Core 2
Posts: 3

Rep: Reputation: 0
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.
 
Old 07-12-2004, 07:42 PM   #2
Finlay
Senior Member
 
Registered: Mar 2003
Location: Seattle
Distribution: Slackware ?-14.1
Posts: 1,029

Rep: Reputation: 47
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.


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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
giving user access to 'shutdown -r now' or -h commands Lleb_KCir Linux - General 2 03-16-2005 11:50 AM
no commands run astroboiii Linux - General 2 01-08-2005 07:40 PM
How do I add start and stop commands to systems startup and shutdown processes? mlsbraves Slackware 1 11-25-2004 07:04 AM
run sndconfig and locks system on shutdown help!!!! superm1782 Linux - Software 0 05-26-2004 09:26 AM
Run commands at logout/shutdown sbaguz Linux - General 2 08-21-2003 11:55 AM


All times are GMT -5. The time now is 11:07 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration