With default settings packagekit.service gets invoked for every graphical login hourly. With the following modification of unit files packagekit runs in the backgroud and sends email notification:
erlangen:~ # systemctl list-unit-files packagekit*
UNIT FILE STATE
packagekit-background.service static
packagekit-offline-update.service masked
packagekit.service masked
packagekit-background.timer enabled
4 unit files listed.
erlangen:~ #
You need to mask unwanted services and enable packagekit-background.timer:
erlangen:~ # systemctl list-timers packagekit-background.timer
NEXT LEFT LAST PASSED UNIT ACTIVATES
Fri 2019-08-23 00:00:00 CEST 15h left Thu 2019-08-22 02:51:39 CEST 6h ago packagekit-background.timer packagekit-background.service
1 timers listed.
Pass --all to see loaded but inactive timers, too.
erlangen:~ #
Check for proper operation:
erlangen:~ # journalctl -b -u packagekit-background.service
-- Logs begin at Wed 2019-07-31 16:03:01 CEST, end at Thu 2019-08-22 08:54:47 CEST. --
Aug 22 02:51:39 erlangen systemd[1]: Started Script to update the system with PackageKit.
Aug 22 02:51:40 erlangen systemd[1]: packagekit-background.service: Succeeded.
erlangen:~ #
Edit units by running ‘systemctl edit packagekit-background.timer’ and ‘systemctl edit packagekit-background.service’. Drop-in directories will be created automatically:
erlangen:~ # systemctl cat packagekit-background.timer packagekit-background.service
# /usr/lib/systemd/system/packagekit-background.timer
[Unit]
Description=Systemd timer to update the system daily with PackageKit
[Timer]
**OnCalendar=daily**
AccuracySec=12h
Persistent=true
Unit=packagekit-background.service
[Install]
WantedBy=timers.target
# /usr/lib/systemd/system/packagekit-background.service
[Unit]
Description=Script to update the system with PackageKit
[Service]
ExecStart=/usr/share/PackageKit/packagekit-background.sh
# /etc/systemd/system/packagekit-background.service.d/override.conf
[Service]
** KillMode=process**
#Environment=SYSTEMD_LOG_LEVEL=debug
erlangen:~ #
The above configuration invokes packagekit daily. The timer is default. The service needs editing of KillMode.