Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 17th April 2005, 05:49 PM
tejas's Avatar
tejas Offline
Registered User
 
Join Date: Feb 2005
Location: Bangalore
Age: 25
Posts: 1,574
Running Script on Shutdown

I need a script to be run as root everytime I shut down the computer, regardless of who calls this shutdown. How would I go about doing this?

And, while we are on the topic, how do I run a script on starting up the computer?
__________________
I Was Counted! Registered Linux User #384707

BASH && Beer && Bass! Now THAT makes sense!!
Reply With Quote
  #2  
Old 17th April 2005, 05:54 PM
tejas's Avatar
tejas Offline
Registered User
 
Join Date: Feb 2005
Location: Bangalore
Age: 25
Posts: 1,574
I'm very sorry, I meant to add this thread to the 'general' category. Please excuse me. I would be obliged if anyone could move it for me.
__________________
I Was Counted! Registered Linux User #384707

BASH && Beer && Bass! Now THAT makes sense!!
Reply With Quote
  #3  
Old 17th April 2005, 11:20 PM
Taft's Avatar
Taft Offline
Registered User
 
Join Date: Mar 2005
Location: Thornhill, ON
Posts: 30
I'm not sure about #1 but for #2, you need to write an initscript. There is oodles of information out there on that topic.
Reply With Quote
  #4  
Old 18th April 2005, 05:06 AM
tejas's Avatar
tejas Offline
Registered User
 
Join Date: Feb 2005
Location: Bangalore
Age: 25
Posts: 1,574
OK, I found a solution to #2 as well.

Add your scripts or commands to the file /etc/rc.d/rc.local

Still looking for solutions for shutdown
__________________
I Was Counted! Registered Linux User #384707

BASH && Beer && Bass! Now THAT makes sense!!
Reply With Quote
  #5  
Old 18th April 2005, 06:17 AM
james_in_denver Offline
Registered User
 
Join Date: Oct 2004
Posts: 1,227
write a script, make it executable, put it in "/etc/init.d" directory......

Create a link in "/etc/init.d/rc0.d" to the file you created in "/etc/init.d".......Make sure that the "link" filename starts with the letter "K" (that's for "kill")......

The script should then be executed as part of the system shutdown process, irregardless of who shuts the computer down...
__________________
Only dead fish go with the flow....

Hmmm, what did I miss?
Reply With Quote
  #6  
Old 18th April 2005, 06:59 PM
linuxdream's Avatar
linuxdream Offline
Registered User
 
Join Date: Apr 2005
Location: San Diego, CA
Posts: 3
Be careful about what number you assign the kill script in rc0. If your script makes use of any services that have already been killed, it will obviously fail. It just depends on what your script is doing.
__________________
That's one way to do it. :cool:
Reply With Quote
  #7  
Old 19th April 2005, 03:47 AM
tejas's Avatar
tejas Offline
Registered User
 
Join Date: Feb 2005
Location: Bangalore
Age: 25
Posts: 1,574
Number? What number is this? I just named the file Kscript and stuck it in the appropriate folder. The script is fairly simple, consisting of mostly cat and rm statements.
__________________
I Was Counted! Registered Linux User #384707

BASH && Beer && Bass! Now THAT makes sense!!
Reply With Quote
  #8  
Old 19th April 2005, 11:51 PM
linuxdream's Avatar
linuxdream Offline
Registered User
 
Join Date: Apr 2005
Location: San Diego, CA
Posts: 3
The number after the K or S tells the system what order to start or kill the processes. But you should be fine
__________________
That's one way to do it. :cool:
Reply With Quote
Reply

Tags
running, script, shutdown

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Shutdown Script huangja Using Fedora 3 5th August 2008 08:02 PM
Shutdown script? elver Using Fedora 1 4th July 2006 01:39 PM
shutdown script cweng Using Fedora 0 23rd March 2005 06:34 AM


Current GMT-time: 18:28 (Saturday, 25-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat