update-cron-daily-schedule config modifies entries in sudo user crontab instead of system crontab file

Bug #2017798 reported by Tianqi Xiao
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
logrotate-charm
Fix Released
High
Ashley James

Bug Description

`update-cron-daily-schedule` config modifies entries in sudo user crontab (which will be saved to `/var/spool/cron/crontabs/root`) instead of system crontab file (`/etc/crontab`), leaving the latter unchanged. This has two consequences:

1. both cron configs will be used to run cronjobs, so the scripts will be ran twice
2. `hookenv.log` cannot be correctly executed when running with sudo user cronjob so its messages will not show up in juju debug-log.

We should instead only manipulate `/etc/crontab` file, either by manually changing the file entries, or using dedicated library to achieve so.

Tags: bseng-1138

Related branches

Tianqi Xiao (txiao)
Changed in charm-logrotated:
status: New → Triaged
tags: added: bseng-1138
description: updated
Eric Chen (eric-chen)
Changed in charm-logrotated:
importance: Undecided → Medium
Ashley James (dashmage)
Changed in charm-logrotated:
assignee: nobody → Ashley James (dashmage)
Revision history for this message
Ashley James (dashmage) wrote :
Changed in charm-logrotated:
status: Triaged → Fix Committed
Eric Chen (eric-chen)
Changed in charm-logrotated:
importance: Medium → High
Chi Wai CHAN (raychan96)
Changed in charm-logrotated:
milestone: none → 23.07
Chi Wai CHAN (raychan96)
Changed in charm-logrotated:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.