Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 531032 - app-admin/sysstat-11.0.2 - /etc/cron.d/sysstat format incompatible with sys-process/dcron
Summary: app-admin/sysstat-11.0.2 - /etc/cron.d/sysstat format incompatible with sys-p...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jeroen Roovers
URL:
Whiteboard:
Keywords: NeedPatch, PullRequest
Depends on:
Blocks:
 
Reported: 2014-11-28 20:22 UTC by Robert Trace
Modified: 2020-07-09 10:36 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Add (back) a cron USE flag (sysstat-11.0.5_ebuild_USE_cron.patch,659 bytes, patch)
2015-06-20 01:40 UTC, Hank Leininger
Details | Diff
Add (back) a cron USE flag; refuse to install with cron enabled if incompatible dcron is in use (sysstat-11.0.6_ebuild_USE_cron.patch,994 bytes, patch)
2015-08-29 01:40 UTC, Hank Leininger
Details | Diff
Add IUSE=+cron, and refuse to install when dcron is in use, to avoid errors. (sysstat-11.2.0_ebuild_USE_cron.patch,946 bytes, patch)
2016-02-26 02:12 UTC, Hank Leininger
Details | Diff
user patch as workaround for dcron/sysstat problem (sysstat-cron-owner.patch,616 bytes, patch)
2018-11-17 05:03 UTC, email200202
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Trace 2014-11-28 20:22:34 UTC
sysstat-11.0.2 installs a cron file in /etc/cron.d that's compatible with vixie/cronie but not dcron.  vixie/cronie uses /etc/cron.d for system jobs, so the username field is required.  dcron runs everything as root, so the username field can not be there.

See bug #493706 for the same problem with a different program.


Reproducible: Always

Steps to Reproduce:
1. install dcron
2. install sysstat
3. wait 10 minutes
Actual Results:  
error e-mail generated from dcron:

Subject: cron for user root root /usr/lib64/sa/sa1 1 1

/bin/sh: root: command not found

---

These messages are repeated every 10 minutes.
Comment 1 Hank Leininger 2015-06-20 01:38:01 UTC
This happens now (still?) with sysstat-11.0.5.

But it has gotten slightly worse, because installing crontab files has become non-optional (I think as a result of #547846).  I don't care to have the sysstat cron jobs run, I only install the package for interactive use of tools like 'iostat'.

The attached patch does not actually fix the /etc/cron.d/ file for compatibility with dcron, but it does re-add the 'cron' USE flag, which seems useful in its own right.
Comment 2 Hank Leininger 2015-06-20 01:40:04 UTC
Created attachment 405390 [details, diff]
Add (back) a cron USE flag
Comment 3 Thomas Capricelli 2015-06-28 00:23:48 UTC
Hit by this since i've updated to app-admin/sysstat-11.0.5
(was using 11.0.4 installed on april 29th before this)
Comment 4 Thomas Capricelli 2015-08-26 13:12:46 UTC
Hit again by this. I "fix" it by deleting /etc/cron.d/sysstat, but i'm probably missing some functionality. Moreover i have to do this on every server for each update ..
Comment 5 Hank Leininger 2015-08-29 01:38:57 UTC
Same, this hit me again because app-admin/sysstat got a version bump without any fix for this, so the fixed version in my local overlay got superseded.

Attaching an updated workaround patch; in addition to re-adding the cron use flag, this causes merging to fail with USE=cron if dcron is installed - since USE=cron does not support dcron.
Comment 6 Hank Leininger 2015-08-29 01:40:13 UTC
Created attachment 410548 [details, diff]
Add (back) a cron USE flag; refuse to install with cron enabled if incompatible dcron is in use
Comment 7 Hank Leininger 2015-10-06 02:32:28 UTC
Another sysstat version bump, and the problem is still present.

The previous patch applies cleanly to sysstat-11.0.7.ebuild, and once again fixes the problem.

Can this be applied to the ebuild in portage please?  Or if dcron is not going to be supported by Gentoo, should it be removed from portage?
Comment 8 Thomas Capricelli 2016-01-23 11:28:39 UTC
Please, i've been hit by this bug, again.
Comment 9 Jeroen Roovers gentoo-dev 2016-02-05 06:38:25 UTC
You can set CONFIG_PROTECT on it.
Comment 10 Jeroen Roovers gentoo-dev 2016-02-05 06:54:40 UTC
Comment on attachment 410548 [details, diff]
Add (back) a cron USE flag; refuse to install with cron enabled if incompatible dcron is in use

Why does your ebuild change what happens with SYSSTAT_FAKE_RC_DIR?
Comment 11 Hank Leininger 2016-02-26 02:11:06 UTC
> You can set CONFIG_PROTECT on it.

AFAIK that works for fixing dcron-compatibility in the existing file by hand, once deployed.  But not for telling portage "don't install this file, I don't want the cron job" (which in my case is true - I like iostat, but don't care to have sar cron jobs run).  I suppose you could hand-edit the file to be empty or a noop, and trust CONFIG_PROTECT to not overwrite it.  If that is the preferred solution, I'll just do that on all my boxes and move on.  But it will still be broken for any user of dcron who emerges sysstat.

> Why does your ebuild change what happens with SYSSTAT_FAKE_RC_DIR?

The short answer is, without that, emerge blows up during src_install if USE=-cron:

rm: cannot remove '/var/tmp/portage/app-admin/sysstat-11.2.0-r1/image//Gentoo-does-not-use-rc.d': No such file or directory

I _think_ it is because the directory is only created when configure has been told --enable-install-cron.  In the in-tree ebuild, that is unconditionally set, so the dir needs to be unconditionally removed.  But when disabled with USE=-cron, the dir isn't created, so doesn't need to be removed as part of install.

I noticed something else, though: the version of my patch attached to this bug is old, and it adds IUSE="cron" instead of IUSE="+cron".  +cron is better I think, because that way users who have no problem and do nothing at all, keep the same behavior as now.  Only users who choose to set USE=-cron for sysstat see any change in behavior.I'll update this with the version in bug #571012.
Comment 12 Hank Leininger 2016-02-26 02:12:38 UTC
Created attachment 426576 [details, diff]
Add IUSE=+cron, and refuse to install when dcron is in use, to avoid errors.
Comment 13 Thomas Capricelli 2016-08-26 19:18:51 UTC
hit again by this bug with 11.4.0 ebuild, which, if i understand well, has no 'cron' USE flag anyway.
Comment 14 Thomas Capricelli 2017-01-27 19:25:38 UTC
(In reply to Hank Leininger from comment #7)
> Another sysstat version bump, and the problem is still present.
> 
> The previous patch applies cleanly to sysstat-11.0.7.ebuild, and once again
> fixes the problem.
> 
> Can this be applied to the ebuild in portage please?  Or if dcron is not
> going to be supported by Gentoo, should it be removed from portage?



And yet another. This package has been broken for months with people reporting success on a proposed patch. Please do something.
Comment 15 Hank Leininger 2017-08-04 21:42:21 UTC
FWIW, I got tired of making a private ebuild in my overlay to wrap /etc/cron.d/sysstat in a USE=cron flag for every single release, and simply replaced the content of that file with a single '#'.

That avoids the constant errors, and upon upgrade the worst I have to do is pay attention during etc-update to not let the package's broken version take its place.

Please consider applying the IUSE=+cron patch, which AFAIK has no ill side effects & leaves behavior the same for people who aren't impacted by this, but gives people who are a workaround.  AFAIK I answered your 2016-02-05 question on 2016-02-26, let me know if there's more info I can provide.
Comment 16 Thomas Capricelli 2017-08-05 00:30:06 UTC
Yes, please someone do something ..
Comment 17 email200202 2018-11-17 05:03:57 UTC
Created attachment 555392 [details, diff]
user patch as workaround for dcron/sysstat problem
Comment 18 email200202 2018-11-17 05:07:21 UTC
For people waiting for this bug to bug to be fixed, I attached user patch file to remove "root" from /etc/cron.d/sysstat.

Place the patch file under the directory /etc/portage/patches/app-admin/sysstat/ and re-emerge app-admin/sysstat.
Comment 19 email200202 2018-11-17 05:10:21 UTC
(In reply to email200202 from comment #18)
> For people waiting for this bug to bug to be fixed, I attached user patch
> file to remove "root" from /etc/cron.d/sysstat.
> 
> Place the patch file under the directory
> /etc/portage/patches/app-admin/sysstat/ and re-emerge app-admin/sysstat.

And then do etc-update and run /etc/init.d/dcron restart
Comment 20 Peter Gantner (a.k.a. nephros) 2020-07-08 10:52:54 UTC
Hey, anything happening about this?

Current stable version is still affected by this.