You are not logged in.

#1 2012-09-13 20:55:14

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Cronie hangs systemd on shutdown

Moving to systemd has meant that most of my shutdowns are incredibly fast. For approximately one in five or six, however, I get a timeout as cronie is not killed.

This is the relevant excerpt and it is always the same:

[60036.311517] systemd[1]: cronie.service stopping timed out (2). Killing.
[60036.311794] systemd[1]: cronie.service changed final-sigterm -> final-sigkill
[60036.311810] systemd[1]: Running GC...
[60036.313842] systemd[1]: Received SIGCHLD from PID 21147 (python2).
[60036.313883] systemd[1]: Got SIGCHLD for process 21147 (python2)
[60036.313959] systemd[1]: Child 21147 died (code=killed, status=9/KILL)
[60036.314851] systemd[1]: Accepted connection on private bus.
[60036.315074] systemd[1]: Got D-Bus request: org.freedesktop.systemd1.Agent.Released() on /org/freedesktop/systemd1/agent
[60036.317625] systemd[1]: cronie.service: cgroup is empty
[60036.317641] systemd[1]: cronie.service changed final-sigkill -> failed
[60036.317688] systemd[1]: Job cronie.service/stop finished, result=done
[60036.317830] systemd[1]: Unit cronie.service entered failed state.

I have a cron job that runs every three minutes to check mail, and I wonder if this job running coincident with shutdown is what causes the time out.

Has anyone else seen this happening with the cronie.service?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#2 2012-09-15 21:25:13

smudge
Member
Registered: 2011-03-20
Posts: 158

Re: Cronie hangs systemd on shutdown

I use systemd and cronie (no custom cron jobs) and there's no mention at all of cronie.service in almost a month of logs.

Offline

#3 2012-09-16 04:07:35

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Cronie hangs systemd on shutdown

Thanks smudge. I'll manually disable the cron job for the next week or so on shutdown and try and isolate the issue.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2012-09-16 05:26:39

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Cronie hangs systemd on shutdown

Sorry I can't help more, but just to reaffirm what smudge is saying, I use cronie and I have a few custom cron jobs, one of which is a (coincidentally) 3 minute check of my mail.  I too see nothing in my past few weeks of logs, and have not experienced any shutdown delay.

Offline

#5 2012-09-16 05:37:33

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Cronie hangs systemd on shutdown

Thanks WonderWoofy: that is both helpful and dispiriting smile

I wonder if it is the nature of the cron job that is the issue, not the scheduling.

I run offlineimap using this daemon script from the wiki and this in my crontab:

*/3 * * * * exec /usr/local/bin/start_daemon -n19 -c2 -p7 python2 /usr/bin/offlineimap &>/dev/null

I'll play around with that and see if it makes a difference.

As a side note, debugging shutdown's puts you on quite a slow test cycle...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2012-09-16 06:04:49

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Cronie hangs systemd on shutdown

I know what you mean with the slow test cycle.  About three weeks after switching to systemd, my computer now reboots rather than shutting down.  But it is slightly different than normal reboot, pausing briefly before starting back up.  So I found on freedesktop.org how to debug late shutdown using system-shutdown.  See here:

http://www.freedesktop.org/wiki/Softwar … n_Problems

Unfortunately, after a couple days I could not figure out how to debug my problem as late as it is, since it is apparently happening after this debug hack.  So I just gave up because my system runs otherwise totally normally.  I tested a base arch install on both usb and spare hdd space, and it operates totally normally, so it must me my install. 

In any case, I hope that helps weed out your issue though.  My 3-minute call to offlineimap is way simpler.  I didn't see the need to ionice it and all that, so I just used patrick brisbin's cron job. 

#!/bin/bash
read -r pid < ~/.offlineimap/pid

if ps $pid &>/dev/null; then
  echo "offlineimap ($pid): another instance running." >&2
  kill -9 $pid
fi

offlineimap -o -u quiet 2>/dev/null  &

It throws some python errors sometimes, which end up in journalctl, but I don't know enough about python to debug it.  Another instance of "well it works... I'll fix it later..."

Offline

#7 2012-09-16 06:24:58

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Cronie hangs systemd on shutdown

Cool: I'll swap brisbin's script in to my crontab and see if that makes any difference. Might take a week or so to gather any conclusive evidence smile


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2012-09-18 23:12:48

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Cronie hangs systemd on shutdown

jasonwryan wrote:

Cool: I'll swap brisbin's script in to my crontab and see if that makes any difference. Might take a week or so to gather any conclusive evidence smile


Not even. Hung last night. So I guess I can rule out the mail fetching cron job.

I'm not sure what else could be causing cronie to not die gracefully. Meh. It's only one shutdown a week or so.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#9 2012-09-19 01:01:14

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Cronie hangs systemd on shutdown

Just out of pure curiosity, how often do you shut down?

Offline

#10 2012-09-19 01:05:24

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Cronie hangs systemd on shutdown

Every night.

(I know "uptime, blah, blah, blah..." I have a server that runs 24/7, I see no reason to have my desktop drawing power for no reason 50% of the time) smile


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#11 2012-09-19 01:08:12

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Cronie hangs systemd on shutdown

Hey, I am not judging you.  I can agree with that scenerio.  I just got a msata ssd about a month ago, and that coupled with systemd, my boot time is rediculous.  So I often shut down rather than hibernate when taking my laptop around.  It is actually faster to simply reboot, though I of course then have to reopen whatever I was working on.  But that is really not a big deal.

Offline

Board footer

Powered by FluxBB