[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#923014: Add systemd unit - allow usage without cron installed



On Wed, 2022-11-16 at 19:00 +0100, Bill Allombert wrote:

> /etc/cron.daily/popularity-contest is a conffile, I cannot make it into
> a systemd service.

The usual way to handle both cron and systemd timers is to move most of
the logic in the cron script into a script in /usr then make the cron
script exit under systemd or call the /usr script under sysvinit and
then add a systemd timer and service that calls the /usr script.

An example of this approach is in the apt package, I think you could
use most of that as-is but adjusting names for the popcon cron job:

   /etc/cron.daily/apt-compat
   /usr/lib/apt/apt.systemd.daily
   /lib/systemd/system/apt-daily.service
   /lib/systemd/system/apt-daily.timer
   /lib/systemd/system/apt-daily-upgrade.service
   /lib/systemd/system/apt-daily-upgrade.timer
   
The systemd.directives manual page can be used to look up where
individual settings in the systemd service/timer files are documented.

-- 
bye,
pabs

https://wiki.debian.org/PaulWise

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: