feat: add feature to update cachyOS in the background
This commit is contained in:
19
systemd/cachyos-updater-shutdown.service
Normal file
19
systemd/cachyos-updater-shutdown.service
Normal file
@ -0,0 +1,19 @@
|
||||
[Unit]
|
||||
Description=CachyOS Updater - Installation des mises à jour reportées avant extinction
|
||||
DefaultDependencies=no
|
||||
Before=poweroff.target halt.target reboot.target shutdown.target
|
||||
# Après Plymouth pour pouvoir lui envoyer des messages
|
||||
After=local-fs.target plymouth-start.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/cachyos-updater-shutdown
|
||||
# Jusqu'à 10 minutes pour installer les mises à jour (kernel, systemd...)
|
||||
TimeoutStartSec=600
|
||||
RemainAfterExit=no
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=cachyos-updater-shutdown
|
||||
|
||||
[Install]
|
||||
WantedBy=poweroff.target halt.target reboot.target
|
||||
20
systemd/cachyos-updater.service
Normal file
20
systemd/cachyos-updater.service
Normal file
@ -0,0 +1,20 @@
|
||||
[Unit]
|
||||
Description=CachyOS Updater - Daemon de mises à jour automatiques
|
||||
Documentation=https://github.com/cachyos/cachyos-updater
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/cachyos-updater
|
||||
Restart=on-failure
|
||||
RestartSec=30
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=cachyos-updater
|
||||
|
||||
# Sécurité : restreindre les accès inutiles
|
||||
ProtectHome=read-only
|
||||
ProtectHostname=yes
|
||||
PrivateTmp=yes
|
||||
NoNewPrivileges=no
|
||||
16
systemd/cachyos-updater.timer
Normal file
16
systemd/cachyos-updater.timer
Normal file
@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=CachyOS Updater - Vérification périodique des mises à jour
|
||||
Requires=cachyos-updater.service
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Timer]
|
||||
# Lancer dès que le réseau est disponible au démarrage
|
||||
OnBootSec=30s
|
||||
# Puis toutes les heures après la dernière exécution
|
||||
OnUnitInactiveSec=1h
|
||||
Unit=cachyos-updater.service
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
Reference in New Issue
Block a user