LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Search this Thread
Old 06-06-2012, 12:28 AM   #1
paldebojyoti
Member
 
Registered: Aug 2009
Posts: 32

Rep: Reputation: 15
How to detect unclean shutdown?


Hello All,
I would like to know if is there any way to detect whether the last shutdown was graceful or not.
Regards,
Deb
 
Old 06-06-2012, 12:48 AM   #2
414N
Member
 
Registered: Sep 2011
Location: Italy
Distribution: Slackware
Posts: 609

Rep: Reputation: 180Reputation: 180
I don't know the distro you're using at the moment (maybe Ubuntu?), but for Slackware there's a straight way to detect a graceful shutdown.
If you add this line:
Code:
touch /etc/fastboot
to the /etc/rc.d/rc.local_shutdown script, every time you shutdown your computer right that file is created and, on next reboot, Slackware boot scripts search for it and, if found, fsck checks are skipped and that file is removed.
I guess you can adopt this approach on every distribution, given you tailor it to your boot process mechanics.
 
Old 06-06-2012, 02:01 AM   #3
paldebojyoti
Member
 
Registered: Aug 2009
Posts: 32

Original Poster
Rep: Reputation: 15
Hello,
Thanks a lot for your answer. It gives me the option for detecting the unclean shutdown.
But at the same time, I would like to know how does ubuntu system detects the unclean shutdown.
Regards,
Deb
 
Old 06-06-2012, 02:22 AM   #4
414N
Member
 
Registered: Sep 2011
Location: Italy
Distribution: Slackware
Posts: 609

Rep: Reputation: 180Reputation: 180
If you're referring to the automatically performed fsck runs after an unclean shutdown, those are caused by the mount program detecting a dirty filesystem while mounting /etc/fstab contents. They're not distro specific.
 
  


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
[SOLVED] Unclean shutdown? Check forced on start-up. DJRcomputing Linux - General 8 05-25-2011 05:56 AM
'shutdown' command causing unclean shutdown silentwol Linux - Software 3 07-01-2009 02:01 AM
Unclean shutdown...now...... S...L....O....W LarryFrigginWachs Linux - Newbie 4 12-29-2006 02:28 PM
Guaranteed filesystem corruption on unclean shutdown? pigsa Linux - Software 7 12-10-2006 06:41 AM
Fedora Core 2 logout causes unclean shutdown Ethan Linux - General 0 10-12-2004 01:57 PM


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