Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

My computer shuts down by itself at a specific time everyday 6:00am. I can't find what's causing it.

I'm a long time Windows user and just recently tried Ubuntu. So I don't know anything about Linux commands. I remember when I was starting out with Ubuntu, I tried to look for an auto-shutdown program. I'm using qshutdown right now. It's working OK and I'm pretty sure my auto shutdown problem is not cause by qshutdown since I checked all of its settings.

Now, maybe when I was still new to Ubuntu, I maybe installed some package about auto shutdown. I really can't remember if I did or didn't. But if I did, I don't know where to begin looking for it.

If I didn't install by accident, any other autoshutdown progam, what do you guys think may be causing the timed shutdown of my PC?

$ sudo crontab -l
4 6 * * * /sbin/poweroff # JOB_ID_1 

Here's what my syslog says:

Jul 26 06:04:01 ubuntu CRON[2593]: (root) CMD (/sbin/poweroff # JOB_ID_1)  
Jul 26 06:04:01 ubuntu kernel: Kernel logging (proc) stopped.  
Jul 26 06:04:01 ubuntu rsyslogd: [origin software="rsyslogd" swVersion="5.8.6" x-pid="795" x-info="http://www.rsyslog.com"] exiting on signal 15.
share|improve this question
    
Have you checked root's cron entries (sudo crontab -l) or the contents of /etc/cron.daily if you have anacron installed? –  StarNamer Jul 26 '12 at 11:24
1  
Welcome Tim: Assuming your using 12.04 you can browse through all the apps you have installed in the "Dash" by selecting the Application Lens (at the bottom of the screen), then select Installed Apps –  Stephen Myall Jul 26 '12 at 11:26
    
That won't help him much I guess. @Tim a good starting point is to check your systems log (/var/log/syslog), which should mention the shutdown event (and hopefully who initiated it). Also the places named by StarNamer above, plus /etc/cron.d. –  Izzy Jul 26 '12 at 12:08
    
@StarNamer Here's what happened when I tried 'sudo crontab -l' 4 6 * * * /sbin/poweroff # JOB_ID_1 –  Tim Jul 26 '12 at 12:23
    
@Izzy Jul 26 06:04:01 ubuntu CRON[2593]: (root) CMD (/sbin/poweroff # JOB_ID_1) Jul 26 06:04:01 ubuntu kernel: Kernel logging (proc) stopped. Jul 26 06:04:01 ubuntu rsyslogd: [origin software="rsyslogd" swVersion="5.8.6" x-pid="795" x-info="rsyslog.com"] exiting on signal 15. –  Tim Jul 26 '12 at 12:28

1 Answer 1

To find what's causing it, there are multiple sources you could look up:

  • check /etc/cron.daily and /etc.cron.d for contained files
  • check root's crontab using sudo crontab -l
  • check the system log (/var/log/syslog) which should mention the execution of this event

As it turned out, in your case the cause was in root's crontab:

sudo crontab -l
4 6 * * * /sbin/poweroff # JOB_ID_1

Which is confirmed by your /var/log/syslog, as you wrote:

Jul 26 06:04:01 ubuntu CRON[2593]: (root) CMD (/sbin/poweroff # JOB_ID_1)

Explanation of above crontab line: 4 minutes past 6 on every day and every month, every weekday execute /sbin/poweroff (i.e. switch off the computer). remark: JOB_ID_1 (i.e., everything following a '#' is treated as comment).

Just do a sudo crontab -e to edit that crontab. Using the cursor keys, move the cursor to that line and remove it. Assuming vi will be used as editor, enter dd (which removes that line), followed by :x to save it back and exit the editor.

Now the event is removed, and no longer will be executed -- problem solved.

share|improve this answer
    
Done. Thanks a lot! I'll confirm it tomorrow. What do you think caused this auto-shutdown thing to happen? I want to have an idea so I don't repeat the same mistake again. –  Tim Jul 26 '12 at 12:40
    
Some application entered that line to the crontab (I just edited my answer again to explain in detail how to read that line). It must have asked you for a password before, as this crontab can only be edited with root/sudo. To becalm you: I never encountered anything doing so without being asked -- so probably it was one of those "tools" you mentioned you might have tried before. –  Izzy Jul 26 '12 at 12:47
    
Problem solved! As confirmed this morning when my PC didn't shut down at 6:04 am. Thanks again. –  Tim Jul 27 '12 at 14:08
    
Glad to read! So how about accepting the answer? ;) –  Izzy Jul 27 '12 at 14:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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