Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sysstat blocks fcron running cron.hourly #49553

Closed
Clos3y opened this issue Mar 26, 2024 · 8 comments
Closed

sysstat blocks fcron running cron.hourly #49553

Clos3y opened this issue Mar 26, 2024 · 8 comments
Assignees
Labels
bug Something isn't working needs-testing Testing a PR or reproducing an issue needed

Comments

@Clos3y
Copy link
Contributor

Clos3y commented Mar 26, 2024

Is this a new report?

Yes

System Info

Void 6.6.22_1 x86_64 AuthenticAMD notuptodate rrrmFFFF

Package(s) Affected

sysstat-12.7.2_1, fcron-3.3.1_2

Does a report exist for this bug with the project's home (upstream) and/or another distro?

No, not that I can see

Expected behaviour

fcron runs all scripts in /etc/cron.hourly

Actual behaviour

fcron runs all scripts alphabetically up to sysstat. This process does not terminate, locking fcron and preventing the execution of files starting with letters after 's' in /etc/cron.hourly.

Steps to reproduce

  1. Install sysstat, fcron, and setup the fcron service and systab crontab.
  2. Create a script in /etc/cron.hourly.
  3. If it comes before 'sysstat' alphabetically, it will be executed when the systab is set to run hourly. If it comes after, it will not execute until around fifty minutes after due to sysstat locking.
@Clos3y Clos3y added bug Something isn't working needs-testing Testing a PR or reproducing an issue needed labels Mar 26, 2024
@Clos3y Clos3y changed the title sysstat blocks fcron running cron.hourly sysstat blocks fcron running cron.hourly Mar 26, 2024
@classabbyamp
Copy link
Member

probably caused by sysstat/sysstat@e659232, where an assumption is probably made that the cron daemon runs things in cron.hourly asynchronously

@Clos3y
Copy link
Contributor Author

Clos3y commented Mar 27, 2024

Hmm, adding & back in (and running # fcrontab -z -u systab followed by a reboot) doesn't fix the issue for me: it's still locked. fcron doesn't seem to care if you use &, it'll still lock. For example, I just tested

while true; do sleep 5; done &

in a test file in /etc/cron.monthly, reloaded the system crontab, and then forced /etc/cron.monthly to run with fcrondyn. fcron is still executing and is locked:

2024-03-27T00:20:08.44950 cron.notice: Mar 27 00:20:08 fcron[3843]: Job '/usr/bin/run-parts /etc/cron.monthly' started for user systab (pid 3844)
2024-03-27T00:20:46.30541 cron.warn: Mar 27 00:20:46 fcron[1022]:     process already running: systab's '/usr/bin/run-parts /etc/cron.monthly'

Perhaps this is an fcron issue specifically?

@classabbyamp
Copy link
Member

then yeah it's probably fcron. might be interesting to check how another cron daemon reacts to this

@Clos3y
Copy link
Contributor Author

Clos3y commented Mar 27, 2024

I've tested with cronie: if you add the & to the script, cronie has no problem and will execute the rest. But in its current state without the &, the script will lock cronie too.

So I think a solution might be to patch /etc/cron.hourly/sysstat to reinclude the & and just accept that fcron misbehaves, but I appreciate the Void ethos is to have upstream fix these things.

@leahneukirchen
Copy link
Member

Surely cronie runs all jobs in parallel?

@leahneukirchen
Copy link
Member

But perhaps sysstat should use a /etc/cron.d file, as run-parts from 0hourly will run in sequence (by design).

So sysstat shouldn't be run from cron.hourly.

@leahneukirchen leahneukirchen self-assigned this Mar 27, 2024
@Clos3y
Copy link
Contributor Author

Clos3y commented Mar 27, 2024

Surely cronie runs all jobs in parallel?

Seemingly not. cronie and fcron call run-parts which, if you execute it on /etc/cron.hourly, will take 50 mins to finish due to sysstat's current form.

But perhaps sysstat should use a /etc/cron.d file, as run-parts from 0hourly will run in sequence (by design).

So sysstat shouldn't be run from cron.hourly.

Yeah that sounds sensible, so just change these to etc/cron.d?

vmkdir etc/cron.daily
vmkdir etc/cron.hourly

@leahneukirchen
Copy link
Member

I'm at it, let me test it locally.

atweiden added a commit to atweiden/voidpkgs that referenced this issue Mar 27, 2024
Upstream moved.

Use /etc/cron.d since the sa1 calls should not block run-parts cron.hourly.

Fixes void-linux/void-packages#49553.

void-linux/void-packages@16ecee2
snwnde pushed a commit to snwnde/void-packages that referenced this issue Apr 18, 2024
Upstream moved.

Use /etc/cron.d since the sa1 calls should not block run-parts cron.hourly.

Fixes void-linux#49553.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-testing Testing a PR or reproducing an issue needed
Projects
None yet
Development

No branches or pull requests

3 participants