LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 05-08-2010, 10:09 AM   #1
trey85stang
Senior Member
 
Registered: Sep 2003
Posts: 1,090

Rep: Reputation: 41
how to tell if system is rebooting from a crash/power failure?


I'm trying to come up with a startup init script that will check to see if the system was shut down gracefully, or if it is rebooting from a poweroff or something similar?

Anyone know of a way to check for this condition with the least amount of room for false positives or vice versa?

My intial thought is just a startup script that will will check for a file on startup, and on a proper reboot/shutdown just touch the file. But id like to avoid that type of script if possible, Im sure there is some other way to test for this correctly.

Btw... this is a sles10sp2 system.
 
Old 05-08-2010, 12:01 PM   #2
marafa
LQ Newbie
 
Registered: Sep 2008
Posts: 26

Rep: Reputation: 1
Quote:
Originally Posted by trey85stang View Post
I'm trying to come up with a startup init script that will check to see if the system was shut down gracefully, or if it is rebooting from a poweroff or something similar?

Anyone know of a way to check for this condition with the least amount of room for false positives or vice versa?

My intial thought is just a startup script that will will check for a file on startup, and on a proper reboot/shutdown just touch the file. But id like to avoid that type of script if possible, Im sure there is some other way to test for this correctly.

Btw... this is a sles10sp2 system.

see what happened last
 
Old 05-09-2010, 07:16 PM   #3
trey85stang
Senior Member
 
Registered: Sep 2003
Posts: 1,090

Original Poster
Rep: Reputation: 41
dohh.. i totally forgot about that command. Thanks marafa!
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Spontaneous System Power Failure Louis_Carole Linux - Hardware 1 04-27-2010 06:49 AM
[SOLVED] System won't startup properly after power failure MBA Whore Linux - Software 14 08-27-2006 10:14 PM
Power Failure recovery system under UFS Jzarecta Mandriva 1 06-30-2006 01:40 PM
Power Failure recovery system under UFS Jzarecta Linux - Software 1 06-30-2006 12:49 PM
Crash after power failure deesto *BSD 8 07-29-2003 01:11 PM


All times are GMT -5. The time now is 10:16 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