Quand tu fais tu édites le fichier en question tu enregsitres les modifications ?
Sur un système non modifier il me semble que l’éditeur est nano il faut faire ctrl +x et O pour oui
Lorsque tu édites le fichier .timer au moment ou tu enregistres il te créer le fameux fichier d’override.conf et tu te retrouve donc avec l’arborescence que j’ai partagé
C’est ce qui ne semble pas fonctionner chez moi. Pourtant quand j’utilise systemctl edit apt-daily.timer, que je modifie le fichier, au moment d’enregistrer il me dit bien :
Écrire dans un fichier: /etc/systemd/system/apt-daily.timer.d/.#override.conf15fd539ec5cf7ad2
Sauf que quand je reviens au prompt j’ai :
# systemctl edit apt-daily.timer
/etc/systemd/system/apt-daily.timer.d/override.conf: after editing, new contents are empty, not writing file.
EDITOR=/bin/nano systemctl edit apt-daily.timer
/etc/systemd/system/apt-daily.timer.d/override.conf: after editing, new contents are empty, not writing file.
Bon ben j’ai trouvé. Quand j’édite avec systemctl edit apt-daily.timer il est écrit ceci dans le fichier :
### Editing /etc/systemd/system/apt-daily.timer.d/override.conf
### Anything between here and the comment below will become the contents of the drop-in file
### Edits below this comment will be discarded
### /usr/lib/systemd/system/apt-daily.timer
# [Unit]
# Description=Daily apt download activities
#
# [Timer]
# OnCalendar=*-*-* 6,17:30
# RandomizedDelaySec=600
# Persistent=true
#
# [Install]
Ce qui signifie qu’il faut que j’édite le fichier comme ceci pour que mon fichier override soit créé et ne soit pas vide.
### Editing /etc/systemd/system/apt-daily.timer.d/override.conf
### Anything between here and the comment below will become the contents of the drop-in file
### /usr/lib/systemd/system/apt-daily.timer
# [Unit]
# Description=Daily apt download activities
#
# [Timer]
# OnCalendar=*-*-* 6,20:44
# RandomizedDelaySec=0
# Persistent=true
#
# [Install]
# WantedBy=timers.target
### Edits below this comment will be discarded
### /usr/lib/systemd/system/apt-daily.timer
# [Unit]
# Description=Daily apt download activities
#
# [Timer]
# OnCalendar=*-*-* 6,17:30
# RandomizedDelaySec=600
# Persistent=true
#
# [Install]
Maintenant y’a plus qu’à voir si ça marche mais au moins ça c’est résolu.
Oui et non parce que j’ai rencontré ce problème en cherchant la réponse à mon premier problème qui est de régler l’heure des mises à jour avec Unattended Upgrades. Ce n’est pas le problème initial.
En tout cas pour le moment toujours rien dans les log après un nouvel essai. J’ai vérifié, les fichiers override.conf sont bien renseignés avec les heures auxquelles je veux que les mises à jour automatiques soient faites mais rien ne se passe. Y’a quelque chose qui cloche là-dedans…
Ah oui, j’ai oublié… Je recommence et je dé-commente comme ça :
### Editing /etc/systemd/system/apt-daily.timer.d/override.conf
### Anything between here and the comment below will become the contents of the drop-in file
### /usr/lib/systemd/system/apt-daily.timer
# [Unit]
# Description=Daily apt download activities
#
[Timer]
OnCalendar=*-*-* 6,21:05
RandomizedDelaySec=0
Persistent=true
#
# [Install]
# WantedBy=timers.target
### Edits below this comment will be discarded
Est-ce que c’est suffisant ou bien il faut tout dé-commenter ?
Donc je mets juste ça dans le fichier apt-daily.timer et ça devrait fonctionner. Je vérifie les logs demain matin.
### Editing /etc/systemd/system/apt-daily.timer.d/override.conf
### Anything between here and the comment below will become the contents of the drop-in file
### /usr/lib/systemd/system/apt-daily.timer
# [Unit]
# Description=Daily apt download activities
[Timer]
OnCalendar=*-*-* 6,07:25
RandomizedDelaySec=0
Persistent=true
# [Install]
# WantedBy=timers.target
### Edits below this comment will be discarded
En tout cas, vérification de /var/log/unattended-upgrades/unattended-upgrades.log ce matin. La mise à jour automatique a été faite à l’heure indiquée dans les fichiers apt-daily-upgrade.timer et apt-daily.timer donc tout est bon pour moi.
Une dernière question. Si jamais je décide d’éteindre ma machine pendant qu’un update ou un upgrade automatique est en train de se faire est-ce que je serai prévenu qu’Unattended Upgrades est en train de bosser ?