5

My Raspberry Pi has been rebooting itself a lot lately and I can't seem to figure out what is happening. Here's the output of last -x:

hal@raspberrypi ~ $ last -x
hal pts/10            localhost        Wed May 21 14:13   still logged in   
runlevel (to lvl 2)   3.6.11-atsw-rtc+ Tue May 20 21:17 - 14:56  (17:39)    
reboot   system boot  3.6.11-atsw-rtc+ Tue May 20 21:17 - 14:56  (17:39)    
runlevel (to lvl 2)   3.6.11-atsw-rtc+ Mon May 19 21:17 - 21:17 (1+00:00)   
reboot   system boot  3.6.11-atsw-rtc+ Mon May 19 21:17 - 14:56 (1+17:39)   
hal pts/6             localhost        Mon May 19 11:25 - 11:37  (00:12)    
runlevel (to lvl 2)   3.6.11-atsw-rtc+ Sun May 18 21:17 - 21:17 (1+00:00)   
reboot   system boot  3.6.11-atsw-rtc+ Sun May 18 21:17 - 14:56 (2+17:39)   
runlevel (to lvl 2)   3.6.11-atsw-rtc+ Sat May 17 23:17 - 21:17  (22:00)    
reboot   system boot  3.6.11-atsw-rtc+ Sat May 17 23:17 - 14:56 (3+15:39)   
runlevel (to lvl 2)   3.6.11-atsw-rtc+ Fri May 16 23:17 - 23:17 (1+00:00)   
reboot   system boot  3.6.11-atsw-rtc+ Fri May 16 23:17 - 14:56 (4+15:39)   
runlevel (to lvl 2)   3.6.11-atsw-rtc+ Thu May 15 21:17 - 23:17 (1+01:59)   
reboot   system boot  3.6.11-atsw-rtc+ Thu May 15 21:17 - 14:56 (5+17:39)   
runlevel (to lvl 2)   3.6.11-atsw-rtc+ Wed May 14 21:17 - 21:17  (23:59)    
reboot   system boot  3.6.11-atsw-rtc+ Wed May 14 21:17 - 14:56 (6+17:39)   
hal pts/12            localhost        Wed May 14 15:07 - 15:10  (00:02)  

From my understanding, the device has been rebooting once a day at either 21:17 ou 23:17 and it stays online for over a day, right?

Moreover, on May 16th the system was online for 4 days (last column), right? How can this be if I've got a reboot entry for both the previous and the following days?!

Running last reboot yields similar results: http://pastebin.com/F1ZUBpyf

Moreover, I've actually got a reboot scheduled, but its scheduled to 3AM:

0 3 * * * /sbin/reboot -h

I've been looking through the system logs, but so far no such luck. Any ideas what might be going on?

Edit: Last night, the Raspberry felt creative and rebooted at 22:17, even though i removed the 3AM boot.

Here's the output of last:

hal pts/6        localhost        Thu May 22 10:42   still logged in   
reboot   system boot  3.6.11-atsw-rtc+ Wed May 21 22:17 - 11:33  (13:15)    
hal pts/3        localhost        Wed May 21 16:25 - 16:45  (00:20)    
hal pts/6        localhost        Wed May 21 15:22 - 16:18  (00:56)    
hal pts/10       localhost        Wed May 21 14:13 - 15:11  (00:58)    
reboot   system boot  3.6.11-atsw-rtc+ Tue May 20 21:17 - 11:33 (1+14:15)   

and here's a pastebin containing the full /var/log/syslog of today.

I checked all of the cron jobs of all users and everything checks out. added an extra command to measure the temperature every minute, here's its cronjob:

          • echo $(date -u) ";" $(cat /sys/class/thermal/thermal_zone0/temp) >> /home/hal/temperature.txt

The temperature is currently a 69ºC by the way.

Edit 2: Running grep CRON /var/log/syslog yielded an interesting result:

May 21 22:17:18 raspberrypi /usr/sbin/cron[1962]: (CRON) INFO (pidfile fd = 3)
May 21 22:17:18 raspberrypi /usr/sbin/cron[1965]: (CRON) STARTUP (fork ok)
May 21 22:17:18 raspberrypi /usr/sbin/cron[1965]: (CRON) INFO (Running @reboot jobs)

Edit 3: Apparently, that last line only shows up after a system boot; it doesn't reboot the Raspberry itself

  • Just an idea, but could it have something to do with the RPi not having an RTC? I don't know wheter these timestamps are created before or after syncing to a timeserver. It might also be a good idea to check your timezone (running raspbian, I think that the config program can do this). – LuWi May 21 '14 at 14:37
  • Well, it does have an RTC, a Rasclock. The timezone was Europe/Lisbon, but I've just changed it to GMT+1 in any case. – João Pereira May 21 '14 at 14:41
  • If you're running syslog, what does /var/log/syslog show just before the time of the reboot or around that time or grep syslog for CRON using grep CRON /var/log/syslog and syslog.1 – HeatfanJohn May 21 '14 at 17:03
  • Just added more info, thank you for your time. I've found out a very interesting entry in this log, check it out. – João Pereira May 22 '14 at 10:40
  • 1
    Hmm. Just a thought: what else is connected to the same power source - that is, the same part of your house wiring - as the pi? Can there be something that steals enough power and 17 minutes past full our in the evenings to starve the pi? – Bex Jun 3 '14 at 18:39
2

I ended up formatting and reinstalling Raspbian and the problem went away. Never did manage to determine the cause of these reboots.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.