7

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? Jun 5, 2020 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'?
    – J23
    Jun 5, 2020 at 23:49
  • Check ubuntu form ubuntuforums.org/… Feb 19, 2021 at 4:41

5 Answers 5

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) Sep 25, 2020 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, 2020 at 8:15
4

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 )

2
3

If the problem is faced after installing "Free Download Manager", then you just got infected with Malware.

https://securelist.com/backdoored-free-download-manager-linux-malware/110465/

That mentioned crond process is the one used for persistence and C2 communication.

3

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

Edit: As a comment mentions, the setup file for linux at the "Free Download Manager" website was malicious. Additionally delete the file:

  • /var/tmp/atd
3
  • 2
    Oh interesting! I also have Free download Manager, so I guess that's pretty definitive evidence for what caused it.
    – J23
    Jun 12, 2021 at 18:47
  • 2
    Free download manager is the culprit for me too. For me I only had the /etc/cron.d/collect file to delete - the other files didn't exist.
    – mcarans
    Nov 14, 2021 at 2:28
  • 1
    Seems like you downloaded free download manager from a suspicious source & had malware installed on your computer: securelist.com/backdoored-free-download-manager-linux-malware/…
    – flaviut
    Sep 12 at 22:06
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!
    – J23
    Feb 20, 2021 at 5:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .