Les services de NUT ne démarrent pas [Réglé]
Bien que sélectionnés pour cela
Système et matériels / Autres matériels et périphériques
Meuz Membre non connecté
-
- Voir le profil du membre Meuz
- Inscrit le : 06/08/2011
- Groupes :
Reprise du message précédent
État des lieux en mode texte. En début de session, j'ai :Code TEXT :
$ systemctl status nut-server
○ nut-server.service - Network UPS Tools - power devices information server
Loaded: loaded (/usr/lib/systemd/system/nut-server.service; enabled; preset: disabled)
Active: inactive (dead)
Docs: man:upsd(8)
...nut-serverest enableb et pourtant inactive.
Donc, il devrait avoir démarré, et planté, failed, et le fait serait repérable par
journalctl:
Code TEXT :
Rien n'a planté !# journalctl -xeu nut-server.service ~ ... -- No entries -- ...skipping... ~ ... -- No entries --
Si je le démarre :
Code BASH :
systemctl start nut-server
cette fois ça marche :
Caché :
Code TEXT :
$ systemctl status nut-server
● nut-server.service - Network UPS Tools - power devices information server
Loaded: loaded (/usr/lib/systemd/system/nut-server.service; enabled; preset: disabled)
Active: active (running) since Wed 2026-07-15 16:24:05 CEST; 10s ago
...
Process: 8479 ExecStartPre=/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-common-tmpfiles.conf (code=exited, status=0/SUCCESS)
Process: 8482 ExecStartPost=/bin/grep -E Units|Max open files /proc/${MAINPID}/limits (code=exited, status=0/SUCCESS)
Main PID: 8481 (upsd)
Tasks: 1 (limit: 18885)
Memory: 1.3M (peak: 3.7M)
CPU: 29ms
CGroup: /system.slice/nut-server.service
└─8481 /usr/sbin/upsd -FRésumé des épisodes. Le service a démarré, il n'a pas planté, et il n'est pas actif. Si je le démarre, il devient actif.
Qu'en pensez vous ?
PS.
- J'ai tronqué quelques lignes, remplacées par ...
- La source de ma science toute fraîche, malgré la canicule.
Edit. Rectification du lien ci-dessus.
Édité par Meuz Le 16/07/2026 à 08h26
Jybz Membre non connecté
-
- Voir le profil du membre Jybz
- Inscrit le : 10/10/2018
- Groupes :
-
Administrateur
-
Forgeron
Téléverser une image : /wiki/hebergement-de-fichiers-sur-mlo
| Arch | Machine | OS |
| x86_64 | lenovo x250 | mga9 |
| armv7hl | bananapro | mga9 |
| aarch64 | Raspberry Pi 4B | mga9 |
Meuz Membre non connecté
-
- Voir le profil du membre Meuz
- Inscrit le : 06/08/2011
- Groupes :
cat /usr/lib/systemd/system/nut-server.service, je trouve :
Code TEXT :
[Unit] ... Description=Network UPS Tools - power devices information server After=local-fs.target network.target nut-driver.target Wants=nut-driver.target Requires=network.target Before=nut-monitor.service PartOf=nut.target ...
Pour chacune des 3,
journalctl -xeuretourne
-- No entries --.
Démarche probablement incomplète.
Meuz Membre non connecté
-
- Voir le profil du membre Meuz
- Inscrit le : 06/08/2011
- Groupes :
Après le démarrage. Rien n'apparait dans
/var/state/ups/:
Code TEXT :
# ls -l /var/state/ups/* total 0
Le démon
upsden mode débogage :
Caché :
Code TEXT :
# upsd -D Network UPS Tools upsd 2.8.4 release 0.000000 fopen /var/state/ups/upsd.pid: No such file or directory 0.000006 [D1] Just failed to send signal, no daemon was running 0.000440 [D1] debug level is '1' 0.000490 listening on 127.0.0.1 port 3493 0.000498 [D1] server_load: tried to set up 1 listening sockets, succeeded with 1 0.000982 [D1] Succeeded to become_user(ups): now UID=970 GID=970 0.000996 [D1] chdired into statepath /var/state/ups for driver sockets 0.001234 Can't connect to UPS [ellipse650] (/var/state/ups/usbhid-ups-ellipse650): No such file or directory 0.001252 Found 1 UPS defined in ups.conf 0.001943 Running as foreground process, not saving a PID file 0.001955 upsnotify: notify about state NOTIFY_STATE_READY_WITH_PID with libsystemd: was requested, but not running as a service unit now, will not spam more about it 0.001960 [D1] On systems without service units, consider `export NUT_QUIET_INIT_UPSNOTIFY=true` 0.001965 upsnotify: failed to notify about state NOTIFY_STATE_READY_WITH_PID: no notification tech defined, will not spam more about it 0.001970 upsnotify: logged the systemd watchdog situation once, will not spam more about it 0.001975 [D1] mainloop: UPS [ellipse650] is not currently connected, trying to reconnect 0.001987 [D1] mainloop: UPS [ellipse650] is still not connected (FD -1) 2.003393 [D1] mainloop: UPS [ellipse650] is not currently connected, trying to reconnect 2.003467 [D1] mainloop: UPS [ellipse650] is still not connected (FD -1) ... 10.012394 [D1] mainloop: UPS [ellipse650] is still not connected (FD -1) 12.014595 [D1] mainloop: UPS [ellipse650] is not currently connected, trying to reconnect 12.014763 [D1] mainloop: UPS [ellipse650] is still not connected (FD -1) ^C 13.878796 mainloop: Interrupted system call 13.878849 Signal 2: exiting 13.878875 [D1] upsd_cleanup: starting the end-game 13.878940 [D1] driver_free: forgetting UPS [ellipse650] (FD -1) 13.878957 [D1] upsd_cleanup: finished # ls -l /var/state/ups/u* total 0
État de nut-server :
Caché :
Code TEXT :
# systemctl status nut-server.service
○ nut-server.service - Network UPS Tools - power devices information server
Loaded: loaded (/usr/lib/systemd/system/nut-server.service; enabled; preset: disabled)
Active: inactive (dead)
Docs: man:upsd(8)
https://www.networkupstools.org/historic/v2.8.4/docs/man/upsd.html
man:ups.conf(5)
https://www.networkupstools.org/historic/v2.8.4/docs/man/ups.conf.html
man:upsd.conf(5)
https://www.networkupstools.org/historic/v2.8.4/docs/man/upsd.conf.html
man:upsd.users(5)
https://www.networkupstools.org/historic/v2.8.4/docs/man/upsd.users.html
man:nut.conf(5)
https://www.networkupstools.org/historic/v2.8.4/docs/man/nut.conf.html
Je démarre le service peu après :
systemctl start nut-server.service
Caché :
Code TEXT :
# systemctl start nut-server.service
# systemctl status nut-server.service
● nut-server.service - Network UPS Tools - power devices information server
Loaded: loaded (/usr/lib/systemd/system/nut-server.service; enabled; preset: disabled)
Active: active (running) since Fri 2026-07-17 22:08:09 CEST; 9s ago
Invocation: 8442e2579f6e40438e30d4392a063ce2
Docs: man:upsd(8)
https://www.networkupstools.org/historic/v2.8.4/docs/man/upsd.html
man:ups.conf(5)
https://www.networkupstools.org/historic/v2.8.4/docs/man/ups.conf.html
man:upsd.conf(5)
https://www.networkupstools.org/historic/v2.8.4/docs/man/upsd.conf.html
man:upsd.users(5)
https://www.networkupstools.org/historic/v2.8.4/docs/man/upsd.users.html
man:nut.conf(5)
https://www.networkupstools.org/historic/v2.8.4/docs/man/nut.conf.html
Process: 2982 ExecStartPre=/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-common-tmpfiles.conf (code=exited, status=0/SUCCESS)
Process: 2985 ExecStartPost=/bin/grep -E Units|Max open files /proc/${MAINPID}/limits (code=exited, status=0/SUCCESS)
Main PID: 2984 (upsd)
Tasks: 1 (limit: 18885)
Memory: 1.1M (peak: 3.6M)
CPU: 23ms
CGroup: /system.slice/nut-server.service
└─2984 /usr/sbin/upsd -F
juil. 17 22:08:09 bureau nut-server[2984]: Found 1 UPS defined in ups.conf
juil. 17 22:08:09 bureau upsd[2984]: Found 1 UPS defined in ups.conf
juil. 17 22:08:09 bureau nut-server[2984]: Running as foreground process, not saving a PID file
juil. 17 22:08:09 bureau nut-server[2984]: upsnotify: notify about state NOTIFY_STATE_READY_WITH_PID with libsystemd: was requested, but not running as a service unit now, will not spam more about it
juil. 17 22:08:09 bureau nut-server[2984]: upsnotify: failed to notify about state NOTIFY_STATE_READY_WITH_PID: no notification tech defined, will not spam more about it
juil. 17 22:08:09 bureau nut-server[2984]: upsnotify: logged the systemd watchdog situation once, will not spam more about itCode TEXT :
# ls -l /var/state/ups/* srw-rw---- 1 ups ups 0 juil. 17 22:08 /var/state/ups/usbhid-ups-ellipse650= -rw-r--r-- 1 ups ups 5 juil. 17 22:08 /var/state/ups/usbhid-ups-ellipse650.pid /var/state/ups/upssched: total 0
Et cette fois, ça marche.
NB. Le socket
/var/state/ups/usbhid-ups-ellipse650=, ne devrait pas comporter de "=" selon Mistral AI : bogue connu dit-il.
Meuz Membre non connecté
-
- Voir le profil du membre Meuz
- Inscrit le : 06/08/2011
- Groupes :
nut-serverne démarre pas avec le boot. Son statut est toujours enabled, mais incative.
Jybz Membre non connecté
-
- Voir le profil du membre Jybz
- Inscrit le : 10/10/2018
- Groupes :
-
Administrateur
-
Forgeron
Le service Nut a quelle target ?
Peux-tu lister les fichiers service ?
Peux-tu les passer un a un à la moulinette :
systemd-analyze verify ./chemin/fichier.service
Téléverser une image : /wiki/hebergement-de-fichiers-sur-mlo
| Arch | Machine | OS |
| x86_64 | lenovo x250 | mga9 |
| armv7hl | bananapro | mga9 |
| aarch64 | Raspberry Pi 4B | mga9 |
nic80 Membre non connecté
-
- Voir le profil du membre nic80
- Inscrit le : 06/08/2018
- Groupes :
-
Modérateur
Visiblement le nuts-server dépend du réseau (network.services). Le gestionnaire de réseau est netapplet ou NetworkManager ?
Le fait de le rédémarrer par la suite implique que tous les services sont démarrés ( et est ce que le firewall n' est pas relancé lorsque le service nuts est lancé par l' interface graphique ?).
Si le parefeu est désactivé temporairement ( et que la machine est relancée), est ce que cela permet de au service de démarrer ?
Meuz Membre non connecté
-
- Voir le profil du membre Meuz
- Inscrit le : 06/08/2011
- Groupes :
@nic80
J'ai testé en désactivant les pare-feux (IPv4 et IPV6), mais après le redémarrage, nut-server n'était toujours pas démarré.
Mon gestionnaire de réseau est netapplet.
Après quelques investigations, j'ai découvert et testé ceci :
Caché :
Code TEXT :
cat /usr/lib/systemd/system/nut-server.service où on lit : # The `upsd` is a networked service (even if bound to a `localhost`) # so it requires that the OS has some notion of networking already. # Extending the unit does not require *this* file to be edited, you # can instead drop in an additional piece of configuration, e.g. to # require that NUT data server only starts after external networking # is configured (usable IP addresses appear in the system) you can # add a `/etc/systemd/system/nut-server.service.d/network.conf` with: # [Unit] # Requires=network-online.target # After=network-online.target
Donc création de ces répertoire et fichier. Sans succès.
Mais la documentation est pour linux en général − il y des différences les debian, ubuntu… − ? ou pour Mageia, voire pour les Fedora-like ?
Meuz Membre non connecté
-
- Voir le profil du membre Meuz
- Inscrit le : 06/08/2011
- Groupes :
Code TEXT :
$ cat /usr/lib/systemd/system/nut-server.service | grep target After=local-fs.target network.target nut-driver.target Wants=nut-driver.target # Requires=network-online.target # After=network-online.target Requires=network.target PartOf=nut.target WantedBy=nut.target
Quelques remarques.
Le fichier nut.conf, cité dans ce tuto Ubuntu, n'existait pas, je l'ai créé :
Code TEXT :
$ cat /etc/ups/nut.conf MODE=standalone
Ça n'a pas suffit.
D'autre part,
Caché :
Code TEXT :
$ cat /usr/lib/systemd/system/nut-server.service
# Network UPS Tools (NUT) systemd integration
# Copyright (C) 2011-2026 by NUT contributors
# Distributed under the terms of GPLv2+
# See https://networkupstools.org/
# and https://github.com/networkupstools/nut/
[Unit]
Description=Network UPS Tools - power devices information server
After=local-fs.target network.target nut-driver.target
# We don't Require drivers to be successfully started! This would be
# a change of behavior compared to init SysV, and could prevent from
# accessing successfully started, at least to audit a system.
Wants=nut-driver.target
# The `upsd` is a networked service (even if bound to a `localhost`)
# so it requires that the OS has some notion of networking already.
# Extending the unit does not require *this* file to be edited, you
# can instead drop in an additional piece of configuration, e.g. to
# require that NUT data server only starts after external networking
# is configured (usable IP addresses appear in the system) you can
# add a `/etc/systemd/system/nut-server.service.d/network.conf` with:
# [Unit]
# Requires=network-online.target
# After=network-online.target
Requires=network.target
Before=nut-monitor.service
PartOf=nut.target
Documentation=man:upsd(8)
...
[Service]
# A busy server can be monitoring a lot of devices as well as replying
# to many clients. The "infinity" definition is actually capped by OS
# settings and hard-coded defaults; typically can be 65535+ nowadays.
# On 64-bit distros this can well be set into hundreds of thousands
# as well (though note each connection has a CPU and RAM overhead
# so one can strike physical limits upon deployment and/or bring the
# poorly sized system to a crawl, or worse). On a running system you
# can check /proc/$MAINPID/limits for active ulimits of the process.
# From my experiments, up to 1048576 can be set, but any larger value
# falls back to 65536. The systemd definition of "infinity" is 65536
# too (or maybe it falls back to that); though this may be OS/distro
# limitation and not systemd fault specifically.
#LimitNOFILE=infinity
#LimitNOFILE=65535
LimitNOFILE=1048576
EnvironmentFile=-/etc/ups/nut.conf
SyslogIdentifier=%N
# DO NOT actually start if MODE is known and is "netclient" or "none";
# however do start (and maybe fail if not yet configured), for other
# MODE values or if nut.conf file is absent:
### Since systemd v243 ### ExecCondition=/bin/sh -c '[ x"${MODE}" != x"netclient" -a x"${MODE}" != x"none" ]'
# This should be executed by the system, but better safe than sorry
# (e.g. in custom rebuilds):La ligne
EnvironmentFile=-/etc/ups/nut.confcomporte un - . C'est normal ?
Jybz Membre non connecté
-
- Voir le profil du membre Jybz
- Inscrit le : 10/10/2018
- Groupes :
-
Administrateur
-
Forgeron
Meuz :
La ligneEnvironmentFile=-/etc/ups/nut.confcomporte un - . C'est normal ?
Je ne sais pas.
As-tu vérifié ?
Jybz :
Peux-tu les passer un a un à la moulinette :
systemd-analyze verify ./chemin/fichier.service
Téléverser une image : /wiki/hebergement-de-fichiers-sur-mlo
| Arch | Machine | OS |
| x86_64 | lenovo x250 | mga9 |
| armv7hl | bananapro | mga9 |
| aarch64 | Raspberry Pi 4B | mga9 |
Meuz Membre non connecté
-
- Voir le profil du membre Meuz
- Inscrit le : 06/08/2011
- Groupes :
Code TEXT :
[meuz@bureau system]$ ls ./ Display all 480 possibilities? (y or n)
480, c'est du lourd !
Y aurait-il une stratégie efficace ? Par quoi commencer ? nut-server, nut-* ?
Edit.
J'ai effectué ceci :
Caché :
Code TEXT :
$ for f in *.service; do systemd-analyze verify "./$f"; done chrony-dnssrv@test_instance.service: Command /usr/libexec/chrony-helper is not executable: Aucun fichier ou dossier de ce nom dhcpcd-online.service: Command dhcpcd-online is not executable: Aucun fichier ou dossier de ce nom earlyoom.service: Command 'man earlyoom(1)' failed with code 16 ostree-prepare-root.service: Failed to create ostree-prepare-root.service/start: Unit sysroot.mount not found. quotaon@test_instance.service: Failed to create quotaon@test_instance.service/start: Unit test_instance.mount not found. rc-local.service: Command /etc/rc.d/rc.local is not executable: Aucun fichier ou dossier de ce nom systemd-growfs@test_instance.service: Failed to create systemd-growfs@test_instance.service/start: Unit test_instance.mount not found. systemd-homed-activate.service: Command homectl is not executable: Aucun fichier ou dossier de ce nom systemd-homed-firstboot.service: Command homectl is not executable: Aucun fichier ou dossier de ce nom systemd-homed-firstboot.service: Command 'man homectl(1)' failed with code 16 systemd-pcrfs@test_instance.service: Failed to create systemd-pcrfs@test_instance.service/start: Unit test_instance.mount not found. systemd-pcrphase-factory-reset.service: Command 'man systemd-pcrphase-factory-reset.service(8)' failed with code 16 systemd-pcrphase-storage-target-mode.service: Command 'man systemd-pcrphase-storage-target-mode.service(8)' failed with code 16 systemd-quotacheck@test_instance.service: Failed to create systemd-quotacheck@test_instance.service/start: Unit test_instance.mount not found. systemd-userdb-load-credentials.service: Command 'man systemd-userdb(8)' failed with code 16 systemd-validatefs@test_instance.service: Failed to create systemd-validatefs@test_instance.service/start: Unit test_instance.mount not found. xdm.service: Command 'man xdm(1)' failed with code 16 /usr/lib/systemd/system/xfs_scrub_all.service:26: Support for option CPUAccounting= has been removed and it is ignored /usr/lib/systemd/system/system-xfs_scrub.slice:15: Support for option CPUAccounting= has been removed and it is ignored /usr/lib/systemd/system/system-xfs_scrub.slice:15: Support for option CPUAccounting= has been removed and it is ignored /usr/lib/systemd/system/system-xfs_scrub.slice:15: Support for option CPUAccounting= has been removed and it is ignored /usr/lib/systemd/system/xfs_scrub_media@.service:31: Support for option CPUAccounting= has been removed and it is ignored /usr/lib/systemd/system/system-xfs_scrub.slice:15: Support for option CPUAccounting= has been removed and it is ignored /usr/lib/systemd/system/xfs_scrub@.service:31: Support for option CPUAccounting= has been removed and it is ignored /usr/lib/systemd/system/system-xfs_scrub.slice:15: Support for option CPUAccounting= has been removed and it is ignored
Édité par Meuz Le 31/07/2026 à 15h04
Jybz Membre non connecté
-
- Voir le profil du membre Jybz
- Inscrit le : 10/10/2018
- Groupes :
-
Administrateur
-
Forgeron
Téléverser une image : /wiki/hebergement-de-fichiers-sur-mlo
| Arch | Machine | OS |
| x86_64 | lenovo x250 | mga9 |
| armv7hl | bananapro | mga9 |
| aarch64 | Raspberry Pi 4B | mga9 |
Meuz Membre non connecté
-
- Voir le profil du membre Meuz
- Inscrit le : 06/08/2011
- Groupes :
J'ai crée le fichier texte
/etc/systemd/system/timer-nut-server.timer
contenant
Code TEXT :
[Unit] Description="Run nut-server.service 2 minutes after boot. meuz 19_08_2026" [Timer] OnBootSec=2min Unit=nut-server.service [Install] WantedBy=multi-user.target
Vérification d'erreurs éventuelles avec la commande :
Code BASH :
systemd-analyze verify /etc/systemd/system/timer-nut-server.timer
Si la commande ne renvoie aucun résultat, le fichier ne comporte pas d'erreurs.
Et ça marche ! nut-server est alors démarré après le boot.
Ceci dit, je ne sais pas si cela est bien orthodoxe.
Sources
Jybz Membre non connecté
-
- Voir le profil du membre Jybz
- Inscrit le : 10/10/2018
- Groupes :
-
Administrateur
-
Forgeron
Il n'est pas nécessaire de crée un timer, normalement on peut ajouter un délais de démarrage au service nut.
Sauf si on a un problème de dépendance.
Téléverser une image : /wiki/hebergement-de-fichiers-sur-mlo
| Arch | Machine | OS |
| x86_64 | lenovo x250 | mga9 |
| armv7hl | bananapro | mga9 |
| aarch64 | Raspberry Pi 4B | mga9 |
Meuz Membre non connecté
-
- Voir le profil du membre Meuz
- Inscrit le : 06/08/2011
- Groupes :
Code TEXT :
$ cat /etc/systemd/system/nut-server.service.d/network.conf [Unit] Requires=network-online.target After=network-online.target
Comment pourrais-je créer ce délai de démarrage que tu mentionnes ?
Jybz Membre non connecté
-
- Voir le profil du membre Jybz
- Inscrit le : 10/10/2018
- Groupes :
-
Administrateur
-
Forgeron
https://www.baeldung.com/linux/systemd-postpone-script-boot#adding-explicit-delays
ExecStartPre=/bin/sleep 120
Si le service ne démarre toujours pas, c'est bien let dépendances qui ne vont pas sur systemd. Et aucune idée comment débugger
Téléverser une image : /wiki/hebergement-de-fichiers-sur-mlo
| Arch | Machine | OS |
| x86_64 | lenovo x250 | mga9 |
| armv7hl | bananapro | mga9 |
| aarch64 | Raspberry Pi 4B | mga9 |
Répondre
Vous n'êtes pas autorisé à écrire dans cette catégorie