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.
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.
Created attachment 405390 [details, diff] Add (back) a cron USE flag
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)
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 ..
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.
Created attachment 410548 [details, diff] Add (back) a cron USE flag; refuse to install with cron enabled if incompatible dcron is in use
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?
Please, i've been hit by this bug, again.
You can set CONFIG_PROTECT on it.
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?
> 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.
Created attachment 426576 [details, diff] Add IUSE=+cron, and refuse to install when dcron is in use, to avoid errors.
hit again by this bug with 11.4.0 ebuild, which, if i understand well, has no 'cron' USE flag anyway.
(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.
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.
Yes, please someone do something ..
Created attachment 555392 [details, diff] user patch as workaround for dcron/sysstat problem
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.
(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
Hey, anything happening about this? Current stable version is still affected by this.
new maintainer here. will do something soon, will need some time to research it. sad to see issue being ignored for 6 years.
(In reply to Georgy Yakovlev from comment #21) > new maintainer here. will do something soon, will need some time to research > it. > > sad to see issue being ignored for 6 years. Thank you! I think there are other/related bugs discussing this same issue (see #547846 and maybe others). Speaking as a dcron user who wants the bug fixed... IIRC there are some good points arguing against automagic patching of the cron file to make it dcron-compatible, such as auto-editing the file to be deployed in /etc/cron.d/ , namely that if the admin then changes from dcron to some-other-cron, they'll now get errors for the opposite reason. My best idea is still the one I submitted over 4 years ago - add IUSE=+cron, and refuse USE=cron when dcron is in use. That'll result in no net change for most users, but prevent dcron users from getting a broken cron job deployed. Still imperfect though, because it would prevent dcron users from deploying and manually fixing the cron job.
thanks for suggestions. I'm still reading, and haven't even tested it yet. my first idea was just to add dcron useflag which both adds an explicit dependency and modifies the file. and if disabled, blocks dcron and installs cronfiles as-is. that way it's impossible to get incorrect configuration, and there's explicit opt-in/opt-out via useflag. but not sure yet =)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e5fb72773abb5993c3f4ae7ea5796c6f8fd433f7 commit e5fb72773abb5993c3f4ae7ea5796c6f8fd433f7 Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2020-11-11 07:59:14 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2020-11-11 07:59:25 +0000 app-admin/sysstat: revbump, add dcron workaround for testing Bug: https://bugs.gentoo.org/531032 Package-Manager: Portage-3.0.9, Repoman-3.0.2 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> app-admin/sysstat/metadata.xml | 3 + app-admin/sysstat/sysstat-12.4.0-r1.ebuild | 88 ++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+)
please try out sysstat-12.4.0-r1 and let me know how it works. Feedback really appreciated. It's unkeyworded, for testing purposes. So you'll have to opt-in and keyword it. USE="dcron" should adjust cronjobs and will prevent other implementations from being installed. USE=dcron can't be selected with USE=systemd
(In reply to Georgy Yakovlev from comment #25) > please try out sysstat-12.4.0-r1 and let me know how it works. Works for me, thanks!
(In reply to Georgy Yakovlev from comment #25) > USE="dcron" should adjust cronjobs and will prevent other implementations > from being installed. > USE=dcron can't be selected with USE=systemd Seems to behave exactly as intended now, thanks!
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ee6175e80f202840de51bcaf86be5c1f3420dd53 commit ee6175e80f202840de51bcaf86be5c1f3420dd53 Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2020-11-24 01:48:52 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2020-11-24 02:01:43 +0000 app-admin/sysstat: bump to 12.4.1, add dcron useflag Closes: https://bugs.gentoo.org/531032 Package-Manager: Portage-3.0.10, Repoman-3.0.2 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> app-admin/sysstat/Manifest | 1 + app-admin/sysstat/sysstat-12.4.1.ebuild | 86 +++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) Additionally, it has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=afc8357859078426ec00ea0bd21cb4cedd30330f commit afc8357859078426ec00ea0bd21cb4cedd30330f Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2020-11-24 02:00:43 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2020-11-24 02:01:45 +0000 app-admin/sysstat: drop experimental ebuild Bug: https://bugs.gentoo.org/531032 Package-Manager: Portage-3.0.10, Repoman-3.0.2 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> app-admin/sysstat/sysstat-12.4.0-r1.ebuild | 87 ------------------------------ 1 file changed, 87 deletions(-)
ok 12.4.1 is out, it's keyworded and has useflag. lmk if there are any issues.
I'm not sure about what's happening. There was a conflict between sysstat and dcron, because i didn't have the dcron flag, which is ok i guess. It emerges fine with +dcron, but it still installs a buggy /etc/cron.d/sysstat I have to do the same as usually: refuse the new file using dispatch-conf. So i dont really see the difference... ? dispatch-conf: --- /etc/cron.d/sysstat 2020-11-06 05:30:10.982227710 +0100 +++ /etc/cron.d/._cfg0000_sysstat 2020-12-19 11:05:46.179909969 +0100 @@ -0,0 +1,6 @@ +# Run system activity accounting tool every 10 minutes +*/10 * * * * /usr/lib/sa/sa1 1 1 +# 0 * * * * /usr/lib/sa/sa1 600 6 +# Generate a text summary of previous day process accounting at 00:07 +7 0 * * * /usr/lib/sa/sa2 -A + >> (1 of 1) -- /etc/cron.d/sysstat >> q quit, h help, n next, e edit-new, z zap-new, u use-new m merge, t toggle-merge, l look-merge:
this is what it installs with USE=dcron just what we want, without root user specified as 6th field > # Run system activity accounting tool every 10 minutes > */10 * * * * /usr/lib/sa/sa1 1 1 > # 0 * * * * /usr/lib/sa/sa1 600 6 > # Generate a text summary of previous day process accounting at 00:07 > 7 0 * * * /usr/lib/sa/sa2 -A this is what it installs without it > # Run system activity accounting tool every 10 minutes > */10 * * * * root /usr/lib/sa/sa1 1 1 > # 0 * * * * root /usr/lib/sa/sa1 600 6 > # Generate a text summary of previous day process accounting at 00:07 > 7 0 * * * root /usr/lib/sa/sa2 -A your diff shows it attempts to install correct version (without word root in it) so idkwfm. maybe there's a confusion of some kind?
just re-checked with actual dcron installed: cat image/etc/cron.d/sysstat # Run system activity accounting tool every 10 minutes */10 * * * * /usr/lib/sa/sa1 1 1 # 0 * * * * /usr/lib/sa/sa1 600 6 # Generate a text summary of previous day process accounting at 00:07 7 0 * * * /usr/lib/sa/sa2 -A this looks correct.