View previous topic :: View next topic |
Author |
Message |
tobimat80 Apprentice
Joined: 27 May 2003 Posts: 272 Location: Trier - Germany
|
Posted: Tue Sep 04, 2007 5:35 pm Post subject: System shutdown |
|
|
Hi!
Is there a way to figure out whether the system was shut down cleanly or whether it was hard reseted? I have the following problem: From time to time a hard drive crash occurs (never mind the reasons therefore) and thereafter I'd like to run fsck and wipe out the hard drive (but keep the directory structure). That should be done by a script that is only invoke after a hard drive crash. It would be nice to differ a clean shutdown from an hard reset. THX _________________ Wer Rechtschreibfehler findet, darf sie behalten und auf DVD brennen! |
|
Back to top |
|
|
nixnut Bodhisattva
Joined: 09 Apr 2004 Posts: 10974 Location: the dutch mountains
|
Posted: Tue Sep 04, 2007 5:48 pm Post subject: |
|
|
look at /var/log/messages. A normal shutdown would leave messages that the system will be shut down.
tail -n 500 /var/log/messages | grep shut _________________ Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered
talk is cheap. supply exceeds demand |
|
Back to top |
|
|
tobimat80 Apprentice
Joined: 27 May 2003 Posts: 272 Location: Trier - Germany
|
Posted: Wed Sep 05, 2007 12:36 pm Post subject: |
|
|
I'm afraid this isn't the case. No messages about shutdown... _________________ Wer Rechtschreibfehler findet, darf sie behalten und auf DVD brennen! |
|
Back to top |
|
|
John R. Graham Administrator
Joined: 08 Mar 2005 Posts: 10590 Location: Somewhere over Atlanta, Georgia
|
Posted: Wed Sep 05, 2007 12:57 pm Post subject: |
|
|
Then look further back, in messages.1.gz, messages.2.gz, etc. They're there. (You do have app-admin/logrotate installed, don't you?) For example: Code: | Aug 25 12:30:58 ceres shutdown[14354]: shutting down for system reboot
Aug 25 12:30:58 ceres init: Switching to runlevel: 6
Aug 25 12:32:14 ceres rsyncd[5526]: rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rs
ync.c(276) [receiver=2.6.9]
Aug 25 12:32:27 ceres postfix/postfix-script: stopping the Postfix mail system
Aug 25 12:32:27 ceres postfix/master[5379]: terminating on signal 15
Aug 25 12:32:32 ceres ntpd[5215]: ntpd exiting on signal 15
Aug 25 12:32:41 ceres sshd[4561]: Received signal 15; terminating.
Aug 25 12:32:49 ceres mountd[4447]: Caught signal 15, un-registering and exiting.
Aug 25 12:32:49 ceres nfsd: last server has exited
Aug 25 12:32:49 ceres nfsd: unexporting all filesystems
Aug 25 12:32:59 ceres twisted: [-] Received SIGTERM, shutting down.
Aug 25 12:32:59 ceres twisted: [-] (Port 2051 Closed)
Aug 25 12:32:59 ceres twisted: [-] Stopping protocol <__builtin__.klive_protocol instance at 0xb78854ec>
Aug 25 12:32:59 ceres twisted: [-] Main loop terminated.
Aug 25 12:32:59 ceres twisted: [-] Warning: No permission to delete pid file
Aug 25 12:32:59 ceres twisted: [-] Server Shut Down.
Aug 25 12:33:04 ceres dnsmasq[4288]: exiting on receipt of SIGTERM
Aug 25 12:33:17 ceres authdaemond: stopping authdaemond children
Aug 25 12:33:33 ceres 0000:00:0b.0: tulip_stop_rxtx() failed
Aug 25 12:34:03 ceres syslog-ng[3777]: syslog-ng version 1.6.11 going down | What you see will be somewhat different based on the services you're running, but, you get the idea.
- John |
|
Back to top |
|
|
|