[Bug 1759846] Re: Incorrect test used for anacron being active

Gordon Lack 1759846 at bugs.launchpad.net
Fri May 2 10:10:50 UTC 2025


This continues to be an issue in Plucky (so 7 years and counting).

If you have a system that is on 24/7, but you also want to have a desktop on it (i.e. a GUI login), you install kubuntu-desktop.
But that pulls in anacron, and you now have the cron.d, cron.daily etc scripts run at random(ish) times by anacron. This is not useful when you wish to schedule things like backups across systems to run when you know they will not interact.

You can disable anacron, but that just means the scripts will not run AT
ALL, as the /etc/crontab file just checks for the existence of the
anacron executable NOT whether it is being used.

/etc/crontab should replace all "test -x /usr/sbin/anacron" tests with
"systemctl -q is-enabled anacron.timer"

(You have to check the timer, not the service....)


Currently you have to remove anacron, which also removes kubuntu-desktop!   (Fortunately this does not remove the other packages that kubuntu-desktop installs - somehow).

-- 
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