[Bug 1759846] Re: Incorrect test used for anacron being active
Gordon Lack
gordon.lack at dsl.pipex.com
Sun Mar 17 01:07:36 UTC 2019
This is *still* an issue nearly a year on.
A better test line is actually this, which checks for anacron being
present before checking whether it is enabled:
( test -x /usr/sbin/anacron && systemctl -q is-enabled anacron )
The () are needed.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to cron in Ubuntu.
https://bugs.launchpad.net/bugs/1759846
Title:
Incorrect test used for anacron being active
Status in cron package in Ubuntu:
New
Bug description:
/etc/crontab uses
test -x /usr/sbin/anacron
for whether anacron is handling the daily/weekly/monthly cron jobs on a system.
This means that if anacron is installed it is assumed to be running.
However, this is a service, and can be disabled and since the package is installed by default it's simpler to just disable it on systems where you don't want it running rather then remove it.
Changing the test to be:
systemctl --no-pager is-enabled anacron 2>/dev/null
(and changing the || to be &&, since the login is now reversed) caters
for either case by checking what you really wish to know - is it
active, not just installed.
ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: cron 3.0pl1-128ubuntu5
ProcVersionSignature: Ubuntu 4.13.0-37.42-generic 4.13.13
Uname: Linux 4.13.0-37-generic x86_64
ApportVersion: 2.20.7-0ubuntu3.7
Architecture: amd64
CurrentDesktop: KDE
Date: Thu Mar 29 13:33:47 2018
InstallationDate: Installed on 2017-11-01 (147 days ago)
InstallationMedia: Kubuntu 17.10 "Artful Aardvark" - Release amd64 (20171017.1)
SourcePackage: cron
UpgradeStatus: No upgrade log present (probably fresh install)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cron/+bug/1759846/+subscriptions
More information about the foundations-bugs
mailing list