LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 09-06-2004, 02:51 AM   #1
linylion
LQ Newbie
 
Registered: Jul 2003
Location: Lahore (Pakistan)
Distribution: Red Hat Linux
Posts: 9

Rep: Reputation: 0
Unhappy where to find improper shutdown logs


Is there any message sent to a log file for improper system shutdown?
if yes then where should i be looking for it??
PLZ tell me


Regards
 
Old 09-06-2004, 04:53 AM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
Most startup and shutdown messages (as well as runtime kernel messages) are logged in the file /var/log/messages
 
Old 09-06-2004, 06:38 AM   #3
linylion
LQ Newbie
 
Registered: Jul 2003
Location: Lahore (Pakistan)
Distribution: Red Hat Linux
Posts: 9

Original Poster
Rep: Reputation: 0
Red face

I thought it 1st but i m unable to find it there... any suggestion if i should be looking for any special expression?
currently i did

grep -R improper /var/log

grep -R shutdown /var/log

grep -R 'runlevel 0' /var/log

but i m unable to find any info abt power failure shutdown..

help

regardzzzzzz
 
Old 09-06-2004, 08:04 AM   #4
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
Power failure messages may only be successfully logged if you have some form of UPS, as they will be logged only after the power has failed.

In the /etc/inittab file, there are some lines line this (this is how they appear on SuSE):
Quote:
# what to do when power fails/returns
pf:owerwait:/etc/init.d/powerfail start
pn:owerfailnow:/etc/init.d/powerfail now
#pn:owerfail:/etc/init.d/powerfail now
po:owerokwait:/etc/init.d/powerfail stop
Looking at my /etc/init.d/powerfail script, I see these lines:
Quote:
POWERFAIL='THE POWER IS FAILED! SYSTEM GOING DOWN! PLEASE LOG OFF NOW!'
POWERFAILNOW='THE POWER IS FAILED! LOW BATTERY - EMERGENCY SYSTEM SHUTDOWN!'
POWERISBACK='THE POWER IS BACK'
So I'd imaging that these are the strings to look for. They may vary completely on Red Hat.

You could also check if /var is mounted as a synchronous filesystem (sync option in /etc/fstab). If it's not then the message, if logged at all, is unlikely to make it out of the write-cache for the disk.

Another suggestion: try passing the -i option to grep for case-insensitive matches.
 
Old 09-08-2004, 12:59 AM   #5
linylion
LQ Newbie
 
Registered: Jul 2003
Location: Lahore (Pakistan)
Distribution: Red Hat Linux
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks rjlee, i m having this problem on suse 9.1. I m trying to find a way to know when my ups after light was gone went off bcz the day it happend was sunday so no body was there to poweroff the system and it went straight away as somebody would have pulled the plug out :-( .... so no logs generated i guess ??? or is it the way "whenever light goes off nd pc switched over to ups they get a log entry of this switch over"
i dont think so... i can be wrong plz correct me if so..


regardzz
 
  


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
Force filesystem check after improper shutdown? Phaethar Linux - General 6 04-23-2011 09:12 PM
system stuck in loop after improper shutdown dr_zayus69 Linux - General 8 08-21-2005 03:30 PM
system recovery after improper shutdown - mandrake 10.0 offical infinity432 Linux - General 3 11-25-2004 03:29 AM
recovering from improper shutdown: ext3 kngharv Linux - Newbie 2 06-11-2003 10:29 PM
HDD problem after improper shutdown... Azazel Linux - Newbie 2 01-19-2003 11:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:47 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration