systemd-logind lance une suspension (veille) du système.
mai 22 08:03:03 tijlf systemd-logind[655]: Lid closed.
mai 22 08:03:03 tijlf systemd-logind[655]: Suspending...
mai 22 08:03:03 tijlf systemd[1]: Reached target sleep.target - Sleep.
mai 22 08:03:03 tijlf systemd[1]: Starting systemd-suspend.service - System Suspend...
logind.confLe fichier /etc/systemd/logind.conf contrôle le comportement de l'alimentation et des événements matériels (couvercle, bouton power, etc.).
sudo nano /etc/systemd/logind.conf
Recherchez les lignes HandleLidSwitch et modifiez-les comme suit :
HandleLidSwitch=suspend
HandleLidSwitchExternalPower=suspend
HandleLidSwitchDocked=ignore
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore
Ctrl + O → Entrée (sauvegarde)Ctrl + X (quitter)systemd-logind
sudo systemctl restart systemd-logind
| Paramètre | Valeur | Comportement |
|---|---|---|
HandleLidSwitch | ignore | Ignorer la fermeture du couvercle (batterie ou secteur) |
HandleLidSwitchExternalPower | ignore | Ignorer même si branché sur secteur |
HandleLidSwitchDocked | ignore | Ignorer quand le PC est docké |
suspend : Mettre en veille (comportement par défaut)hibernate : Hiberner (sauvegarde sur disque)lock : Verrouiller l'écran (sans veille)poweroff : Éteindre le systèmeignore : Ne rien faire (recommandé pour serveur)grep HandleLidSwitch /etc/systemd/logind.conf
Résultat attendu :
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore
journalctl -f
Lid closed. suivi de rien d'autre (pas de Suspending...)
Suspending... → Retournez à l'étape 2
virsh list --all
# Ou
systemctl status libvirtd
ping -c 3 8.8.8.8
ip addr show wlp3s0b1
# Vérifier l'état
sudo systemctl status systemd-logind
# Voir les erreurs
sudo journalctl -u systemd-logind -b
Si vous utilisez tlp (gestion de batterie), vérifiez sa configuration :
sudo nano /etc/tlp.conf
# Cherchez : LID_CLOSE_SUSPEND
# Doit être : LID_CLOSE_SUSPEND=0 ou commenté
Des configurations personnalisées peuvent exister dans :
ls /etc/systemd/logind.conf.d/
# Vérifiez qu'aucun fichier ne redéfinit HandleLidSwitch
mai 22 08:03:03 tijlf systemd-logind[655]: Lid closed.
mai 22 08:03:03 tijlf systemd-logind[655]: Suspending...
mai 22 08:03:03 tijlf systemd[1]: Reached target sleep.target - Sleep.
mai 22 08:03:16 tijlf wlp3s0b1: deauthenticating from ... by local choice
mai 22 08:03:16 tijlf dhcpcd[780]: wlp3s0b1: carrier lost
mai 22 09:15:00 tijlf systemd-logind[655]: Lid closed.
# Aucun message de suspension suivant
# Le système continue de fonctionner normalement
| Action | Commande |
|---|---|
| Éditer la config | sudo nano /etc/systemd/logind.conf |
| Appliquer les changements | sudo systemctl restart systemd-logind |
| Vérifier la config | grep HandleLidSwitch /etc/systemd/logind.conf |
| Surveiller les logs | journalctl -f |
| Vérifier les VM | virsh list --all |
| Vérifier le réseau | ip addr show wlp3s0b1 |