[ntpd] Failed to start Network Time Service (résolu)

Questions et astuces concernant l'installation et la configuration d'archlinux
Avatar de l’utilisateur
LuX
yeomen
Messages : 216
Inscription : lun. 17 mai 2010, 13:56
Localisation : Angers (France)

[ntpd] Failed to start Network Time Service (résolu)

Message par LuX »

Bonjour

Je viens d'installer de Arch Linux ces jours-ci. Ça tourne mais le service ntpd ne semble pas marcher. L'heure affichée par la commande 'date' est celle du Bios (qui avait deux heures de décalage et que je viens de mettre à l'heure manuellement dans le Bios).

Code : Tout sélectionner

# systemctl is-enabled ntpd.service
enabled
# systemctl -l status ntpd
● ntpd.service - Network Time Service
   Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since sam. 2015-04-11 01:36:41 CEST; 2min 34s ago
  Process: 796 ExecStart=/usr/bin/ntpd -g -u ntp:ntp (code=exited, status=0/SUCCESS)
 Main PID: 797 (code=exited, status=255)

avril 11 01:36:41 venus systemd[1]: ntpd.service: main process exited, code=exited, status=255/n/a
avril 11 01:36:41 venus systemd[1]: Unit ntpd.service entered failed state.
avril 11 01:36:41 venus systemd[1]: ntpd.service failed.
avril 11 01:36:41 venus systemd[1]: start request repeated too quickly for ntpd.service
avril 11 01:36:41 venus systemd[1]: Failed to start Network Time Service.
avril 11 01:36:41 venus systemd[1]: Unit ntpd.service entered fa
Pourtant 'timedate' dit que que l'horloge est bien 'NTP synchronized' :

Code : Tout sélectionner

# timedatectl 
      Local time: ven. 2015-04-10 19:50:07 CEST
  Universal time: ven. 2015-04-10 17:50:07 UTC
        RTC time: ven. 2015-04-10 17:50:06
       Time zone: Europe/Paris (CEST, +0200)
     NTP enabled: no
NTP synchronized: yes
 RTC in local TZ: no
      DST active: yes
 Last DST change: DST began at
                  dim. 2015-03-29 01:59:59 CET
                  dim. 2015-03-29 03:00:00 CEST
 Next DST change: DST ends (the clock jumps one hour backwards) at
                  dim. 2015-10-25 02:59:59 CEST
                  dim. 2015-10-25 02:00:00 CET
                  
J'ai lu la page du wiki sur l'horloge (en français et en anglais) et cherché dans le forum, mais je ne vois pas bien quel est le problème. Une suggestion ?

Cordialement,
Dernière modification par LuX le sam. 11 avr. 2015, 00:00, modifié 1 fois.
LuX
Avatar de l’utilisateur
LuX
yeomen
Messages : 216
Inscription : lun. 17 mai 2010, 13:56
Localisation : Angers (France)

Re: [ntpd] Failed to start Network Time Service

Message par LuX »

Re-bonjour

Une recherche sur "ntpd.service: main process exited, code=exited, status=255/n/a" m'a amené ici :
https://github.com/coreos/bugs/issues/61
Ça m'a donné l'idée d'essayer autre chose :

Code : Tout sélectionner

# systemctl restart ntpdate
Job for ntpdate.service failed. See "systemctl status ntpdate.service" and "journalctl -xe" for details.
# systemctl -l status ntpdate
● ntpdate.service - One-Shot Network Time Service
   Loaded: loaded (/usr/lib/systemd/system/ntpdate.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since sam. 2015-04-11 01:37:25 CEST; 3min 58s ago
  Process: 816 ExecStart=/usr/bin/ntpd -q -n -g -u ntp:ntp (code=exited, status=255)
 Main PID: 816 (code=exited, status=255)

avril 11 01:37:25 venus ntpd[816]: 11 Apr 01:37:25 ntpd[816]: Listen normally on 3 enp2s3 192.168.1.22:123
avril 11 01:37:25 venus ntpd[816]: 11 Apr 01:37:25 ntpd[816]: Listen normally on 4 lo [::1]:123
avril 11 01:37:25 venus ntpd[816]: 11 Apr 01:37:25 ntpd[816]: Listen normally on 5 enp2s3 [fe80::a00:46ff:fed9:9cf6%2]:123
avril 11 01:37:25 venus ntpd[816]: 11 Apr 01:37:25 ntpd[816]: Listening on routing socket on fd #22 for interface updates
avril 11 01:37:25 venus ntpd[816]: Cannot find user `ntp'
avril 11 01:37:25 venus ntpd[816]: 11 Apr 01:37:25 ntpd[816]: Cannot find user `ntp'
avril 11 01:37:25 venus systemd[1]: ntpdate.service: main process exited, code=exited, status=255/n/a
avril 11 01:37:25 venus systemd[1]: Failed to start One-Shot Network Time Service.
avril 11 01:37:25 venus systemd[1]: Unit ntpdate.service entered failed state.
avril 11 01:37:25 venus systemd[1]: ntpdate.service failed.
Vu ce nouveau message d'erreur j'ai crée l'utilisateur ntp et redémarré les deux services :

Code : Tout sélectionner

# useradd ntp
/usr/local/share/fortune/fr # systemctl restart ntpdate
/usr/local/share/fortune/fr # systemctl -l status ntpdate
● ntpdate.service - One-Shot Network Time Service
   Loaded: loaded (/usr/lib/systemd/system/ntpdate.service; disabled; vendor preset: disabled)
   Active: inactive (dead)

avril 11 01:42:41 venus ntpd[905]: Listen normally on 4 lo [::1]:123
avril 11 01:42:41 venus ntpd[905]: Listen normally on 5 enp2s3 [fe80::a00:46ff:fed9:9cf6%2]:123
avril 11 01:42:41 venus ntpd[905]: Listening on routing socket on fd #22 for interface updates
avril 11 01:42:41 venus ntpd[905]: 11 Apr 01:42:41 ntpd[905]: Listen normally on 2 lo 127.0.0.1:123
avril 11 01:42:41 venus ntpd[905]: 11 Apr 01:42:41 ntpd[905]: Listen normally on 3 enp2s3 192.168.1.22:123
avril 11 01:42:41 venus ntpd[905]: 11 Apr 01:42:41 ntpd[905]: Listen normally on 4 lo [::1]:123
avril 11 01:42:41 venus ntpd[905]: 11 Apr 01:42:41 ntpd[905]: Listen normally on 5 enp2s3 [fe80::a00:46ff:fed9:9cf6%2]:123
avril 11 01:42:41 venus ntpd[905]: 11 Apr 01:42:41 ntpd[905]: Listening on routing socket on fd #22 for interface updates
avril 10 23:42:47 venus ntpd[905]: 10 Apr 23:42:47 ntpd[905]: ntpd: time set -7194.651636 s
avril 10 23:42:47 venus ntpd[905]: ntpd: time set -7194.651636s
# systemctl restart ntpd
# systemctl -l status ntpd
● ntpd.service - Network Time Service
   Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
   Active: active (running) since ven. 2015-04-10 23:43:13 CEST; 8s ago
  Process: 914 ExecStart=/usr/bin/ntpd -g -u ntp:ntp (code=exited, status=0/SUCCESS)
 Main PID: 915 (ntpd)
   CGroup: /system.slice/ntpd.service
           └─915 /usr/bin/ntpd -g -u ntp:ntp

avril 10 23:43:13 venus ntpd[914]: ntpd 4.2.8p2@1.3265-o Tue Apr  7 19:12:57 UTC 2015 (1): Starting
avril 10 23:43:13 venus ntpd[914]: Command line: /usr/bin/ntpd -g -u ntp:ntp
avril 10 23:43:13 venus ntpd[915]: proto: precision = 1.117 usec (-20)
avril 10 23:43:13 venus ntpd[915]: Listen and drop on 0 v6wildcard [::]:123
avril 10 23:43:13 venus ntpd[915]: Listen and drop on 1 v4wildcard 0.0.0.0:123
avril 10 23:43:13 venus ntpd[915]: Listen normally on 2 lo 127.0.0.1:123
avril 10 23:43:13 venus ntpd[915]: Listen normally on 3 enp2s3 192.168.1.22:123
avril 10 23:43:13 venus ntpd[915]: Listen normally on 4 lo [::1]:123
avril 10 23:43:13 venus ntpd[915]: Listen normally on 5 enp2s3 [fe80::a00:46ff:fed9:9cf6%2]:123
avril 10 23:43:13 venus ntpd[915]: Listening on routing socket on fd #22 for interface updates
Ça semble avoir reglé le problème. Je vais redémarrer pour voir. Si c'est bon je passerai en "résolu".

Cordialement,
LuX
Moviuro
Elfe
Messages : 765
Inscription : dim. 17 juin 2012, 22:49

Re: [ntpd] Failed to start Network Time Service

Message par Moviuro »

Plop,

Si tu n'arrives pas à faire fonctionner ntpd ou ntpdate, tu peux utiliser systemd-timesyncd qui est l'alternative systemd (attention, il fait seulement la partie cliente de ntp, pas le serveur) : timesyncd.conf(5)

Oui, c'est un contournement, mais c'est plus cool d'avoir un truc built-in qu'un nouvel outil, non ?

Bon courage,
psycho : Latitude E6430 ; BTRFS over LUKS, UEFI & secureboot
schizo : Acer 8942G ; KDE 4, BTRFS over LUKS ; W7 (prend la poussière)
toxo : i5-6600K, bspwm, VM W10 en PCI-passthrough
deadman : Lenovo Thinkcenter, OpenBSD 6.0-stable
popho.be : Kimsufi KS-3, FreeBSD 11.0
Loi de Murphy : Le jour où tu as besoin d'une backup, tu te dis que tu aurais dû en mettre en place
Venez sur IRC en plus du forum !
Avatar de l’utilisateur
LuX
yeomen
Messages : 216
Inscription : lun. 17 mai 2010, 13:56
Localisation : Angers (France)

Re: [ntpd] Failed to start Network Time Service

Message par LuX »

Bonsoir Moviuro

Je viens de redémarrer, et le service ntpd est actif. Merci quand même pour la réponse, mais puisque le problème a maintenant disparu grâce à la création du "user" ntp, je vais en rester là.
Question : Est-ce que c'est un bug et faut-il le signaler ?

PS (rien à voir) :
Moviuro a écrit :Loi de Murphy : Le jour où tu as besoin d'une backup, tu te dis que tu aurais dû en mettre en place
:lol:
LuX
Répondre