4

I'm running Kubuntu 20.04. 3 out of 4 times when I shutdown or reboot, it hangs at:

 Reached target Reboot.
 systemd-shutdown[1]: Waiting for process: crond

I've spent a fair bit of time googling, but have unable to figure out why it's doing this. It makes frequent reboots agonizingly slow. I did find one thread describing the same issue on the Ubuntu forums, but they failed to post their solution (just that they solved it).

Any help or info would be greatly appreciated.

3
  • Does the same happen when you use dcron instead of crond? Have you always been having this problem or is it something that arouse after taking some action? – David Kariuki Jun 5 '20 at 22:36
  • This is a relatively fresh Kubuntu install, and I'm relatively new to Linux. I was basically working on getting everything installed, and at some point, this radomly started happening. It's unclear exactly when, particularly because it only occurs intermittently. Not sure what I would need to change to 'use dcron instead of crond'? – Metal450 Jun 5 '20 at 23:49
  • Check ubuntu form ubuntuforums.org/… – Sudhakar Krishnan Feb 19 at 4:41
1

I faced the same problem. When shutdown it displays

systemd-shutdown 1: waiting for process: crond

and wait for some time (more than a minute) and it shutsdown.

I'm using Ubuntu 20.04 LTS I googled it and found the solution. I installed Bleachbit from official site: https://www.bleachbit.org/download/linux and link to file: https://www.bleachbit.org/download/file/t?file=bleachbit_4.2.0-0_all_ubuntu2004.deb

Install: Just right click it and select Open with other app and select Software install Or by command line: sudo install < file >

After success install you can see it in Application list, select bleachbit admin and run it. List is in attachment image(screenshot). enter image description here

After this. For First time shutdown it took some time (More than a min) and it did't display any error, and shutdown.

After that everything is normal, now it shutdown fast. I tested many times, it's working good.

1
  • Thanks - I can confirm that Bleachbit fixed the issue. I actually found this solution elsewhere & forgot to note it here, so thanks for posting! – Metal450 Feb 20 at 5:03
4
+50

Cron can hang if one of its jobs is hanging (for example if you have a misconfigured log rotation, etc.).

To find the culprit run pstree before you reboot to see if any processes are active/hanging:

pstree -ap $(pidof cron)

You can also look what cron jobs are defined in

/etc/crontab  
/etc/cron.d/  
/etc/cron.daily/  
/etc/cron.hourly/  
/etc/cron.monthly/  
/etc/cron.weekly/

as well as crontab -l (for each user).

If this does not help you solve your problem you can use this as a workaround:

  • edit /etc/systemd/system.conf

  • set DefaultTimeoutStopSec in the Manager section

    [Manager]
    DefaultTimeoutStopSec=5s
    
  • run systemctl daemon-reload

This will tell systemd to only wait for 5 seconds for the crond process to exit.

2
  • Even after setting timeout to 5 seconds it's still taking around 3 minutes to shutdown and the same message pops up (waiting for process crond) – Mateen Kiani Sep 25 '20 at 7:59
  • Since this is not your question you cannot update it with the output of journalctl -b -1 -r ...? check if there are any messages related to crond. It should say "Shutting down." before "Reached target Reboot." (the log is reversed with -r) – laktak Sep 25 '20 at 8:15
2

I can confirm the answer of gilles gaido. In my case these files

  • /etc/cron.d/collect
  • /var/tmp/crond
  • /var/tmp/bs

were probably created by "Free Download Manager" version 6.X

Removing this software did not remove these files, so I did what gilles gaido describes but additionally removing /var/tmp/bs

1
  • 1
    Oh interesting! I also have Free download Manager, so I guess that's pretty definitive evidence for what caused it. – Metal450 Jun 12 at 18:47
1

Same problem on my Xubuntu 20.04 since 2 weeks.

In order to find out the origin of this message displayed at shutdown

Reached target Reboot.
systemd-shutdown[1]: Waiting for process: crond

I used this command to get the cron jobs files list (ordered by date) :

find /etc/cron* -type f | xargs  ls -ltr

I discovered that the file /etc/cron.d/collect ( freshly updated ) was scheduling a weird binary named /var/tmp/crond

My solution to disable this job was to move /etc/cron.d/collect elsewhere (in my home directory, so as to try before deleting it forever).

After 2 reboots I checked that I recovered a fast shutdown !

(can also follow this link : https://askubuntu.com/a/1329933 )

1
  • I had the same issue. This worked. Thanks – advay rajhansa May 14 at 4:43

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.