Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

systemd startet ntpd nicht

377 views
Skip to first unread message

Ulli Horlacher

unread,
Jun 27, 2016, 9:42:59 AM6/27/16
to
Wieder mal systemd Murx: ntpd wird nicht gestartet

Das hier ist auf Ubuntu 16.04:

root@xerus:/etc# service ntp start
root@xerus:/etc# service ntp status
* ntp.service - LSB: Start NTP daemon
Loaded: loaded (/etc/init.d/ntp; bad; vendor preset: enabled)
Active: active (exited) since Tue 2016-06-21 08:04:43 CEST; 6 days ago
Docs: man:systemd-sysv-generator(8)
Process: 1215 ExecStop=/etc/init.d/ntp stop (code=exited, status=0/SUCCESS)
Process: 1401 ExecStart=/etc/init.d/ntp start (code=exited, status=0/SUCCESS)
Tasks: 0
Memory: 0B
CPU: 0

Jun 27 15:14:16 xerus systemd[1]: Started LSB: Start NTP daemon.
Jun 27 15:14:41 xerus systemd[1]: Started LSB: Start NTP daemon.
Jun 27 15:20:25 xerus systemd[1]: Started LSB: Start NTP daemon.
Jun 27 15:22:44 xerus systemd[1]: Started LSB: Start NTP daemon.
Jun 27 15:25:09 xerus systemd[1]: Started LSB: Start NTP daemon.
Jun 27 15:26:05 xerus systemd[1]: Started LSB: Start NTP daemon.
Jun 27 15:26:42 xerus systemd[1]: Started LSB: Start NTP daemon.
Jun 27 15:33:12 xerus systemd[1]: Started LSB: Start NTP daemon.

root@xerus:/etc# ps aux | grep ntp
root 7565 0.0 0.2 17704 2520 pts/0 S+ 15:33 0:00 grep ntp
root@xerus:/etc#

Laeuft also nicht und in /var/log/syslog stehen keine Fehlermeldungen!

Wenn ich ntpd von Hand starte, gehts:

root@xerus:/etc# /usr/sbin/ntpd -g
root@xerus:/etc# ps aux | grep ntp
root 7669 0.0 0.4 103796 4364 ? Ssl 15:40 0:00 /usr/sbin/ntpd -g
root 7674 0.0 0.2 17704 2232 pts/0 S+ 15:40 0:00 grep ntp

Wieso kann systemd ntpd nicht starten und wieso gibts dazu keine
Fehlermeldungen?


--
Ullrich Horlacher Server und Virtualisierung
Rechenzentrum IZUS/TIK
Universitaet Stuttgart E-Mail: horl...@tik.uni-stuttgart.de
Allmandring 30a Tel: ++49-711-68565868
70569 Stuttgart (Germany) WWW: http://www.tik.uni-stuttgart.de/

Juergen P. Meier

unread,
Jun 27, 2016, 10:58:58 AM6/27/16
to
E. Braun <erik....@minet.uni-jena.de>:
> Ulli Horlacher <fram...@rus.uni-stuttgart.de> wrote:
>
> [?]
>> Laeuft also nicht und in /var/log/syslog stehen keine Fehlermeldungen!
>
> Pffft, syslog. Wer braucht schon Dateien, wenn man ein rotierendes
> Journal in einem Binary-Format hat?
>
> Schau mal, ob Dir "journalctl -xb -u ntp" weiterhilft. Oder ohne "-u",
> vielleicht ist es ja ein Folgefehler.

Das wird ihm nicht helfen. Das hatten wir hier doch schon einmal.

Ulli Horlacher

unread,
Jun 27, 2016, 11:00:37 AM6/27/16
to
E. Braun <erik....@minet.uni-jena.de> wrote:

> > Laeuft also nicht und in /var/log/syslog stehen keine Fehlermeldungen!
>
> Pffft, syslog. Wer braucht schon Dateien, wenn man ein rotierendes
> Journal in einem Binary-Format hat?
>
> Schau mal, ob Dir "journalctl -xb -u ntp" weiterhilft. Oder ohne "-u",
> vielleicht ist es ja ein Folgefehler.

root@xerus:~/bin# systemctl start ntp
root@xerus:~/bin# journalctl -xb -u ntp
(...)
Jun 27 16:54:30 xerus systemd[1]: Started LSB: Start NTP daemon.
-- Subject: Unit ntp.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit ntp.service has finished starting up.
--
-- The start-up result is done.


root@xerus:~/bin# journalctl -xb
(...)
Jun 27 16:17:01 xerus CRON[1906]: pam_unix(cron:session): session opened for use
Jun 27 16:17:01 xerus CRON[1907]: (root) CMD ( cd / && run-parts --report /etc
Jun 27 16:17:01 xerus CRON[1906]: pam_unix(cron:session): session closed for use
Jun 27 16:54:30 xerus systemd[1]: Started LSB: Start NTP daemon.
-- Subject: Unit ntp.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit ntp.service has finished starting up.
--
-- The start-up result is done.


Nichts zu sehen.

Tim Ritberg

unread,
Jun 27, 2016, 12:21:37 PM6/27/16
to
Ein Hoch auf systemd.

Tim

Juergen P. Meier

unread,
Jun 27, 2016, 12:33:05 PM6/27/16
to
Tim Ritberg <t...@server.invalid>:
> Am 27.06.2016 um 17:00 schrieb Ulli Horlacher:
>> E. Braun <erik....@minet.uni-jena.de> wrote:
>>
>>> Pffft, syslog. Wer braucht schon Dateien, wenn man ein rotierendes
>>> Journal in einem Binary-Format hat?
>>>
>>> Schau mal, ob Dir "journalctl -xb -u ntp" weiterhilft. Oder ohne "-u",
>>> vielleicht ist es ja ein Folgefehler.
>>
>> root@xerus:~/bin# journalctl -xb -u ntp
>>
>> Nichts zu sehen.
>
> Ein Hoch auf systemd.

Diesen Bug haben sie offensichtlich noch immer nicht behoben.

Genau sowas kam doch vor ein paar Monaten hier schon einmal vorbei.

Und da fragen sich noch immer hier und da ein paar Idioten, warum
man fuer Server keine der einschlaegigen Linux-Distributionen mehr
empfehlen kann.

Tim Ritberg

unread,
Jun 27, 2016, 12:53:44 PM6/27/16
to
Am 27.06.2016 um 18:31 schrieb Juergen P. Meier:
> Diesen Bug haben sie offensichtlich noch immer nicht behoben.
>
> Genau sowas kam doch vor ein paar Monaten hier schon einmal vorbei.
>
> Und da fragen sich noch immer hier und da ein paar Idioten, warum
> man fuer Server keine der einschlaegigen Linux-Distributionen mehr
> empfehlen kann.
>

Und wieder mal hatte alle Init-Remainer recht...

Tim

Juergen Schroeder

unread,
Jun 28, 2016, 5:32:02 AM6/28/16
to
Ulli Horlacher <fram...@rus.uni-stuttgart.de> wrote:
> Wieder mal systemd Murx: ntpd wird nicht gestartet

> root@xerus:/etc# service ntp start
> Jun 27 15:33:12 xerus systemd[1]: Started LSB: Start NTP daemon.

> root@xerus:/etc# ps aux | grep ntp
> root 7565 0.0 0.2 17704 2520 pts/0 S+ 15:33 0:00 grep ntp
> root@xerus:/etc#

> Laeuft also nicht und in /var/log/syslog stehen keine Fehlermeldungen!

> Wenn ich ntpd von Hand starte, gehts:

> root@xerus:/etc# /usr/sbin/ntpd -g

haste das -g auch in den Conf Dateien für ntpd drin /etc/default/ntpd oder
/etc/ntpd/*.conf ...

Ohne das -g beendet sich der ntpd wenn die Systemzeit zu falsch ist:
Normally, ntpd exits with a message to the system log if the offset exceeds
the panic threshold

sollte dann abar im syslog stehen ...

HTH Jürgen

Ulli Horlacher

unread,
Jun 28, 2016, 7:46:07 AM6/28/16
to
Juergen Schroeder <js...@gmx.de> wrote:
> Ulli Horlacher <fram...@rus.uni-stuttgart.de> wrote:
> > Wieder mal systemd Murx: ntpd wird nicht gestartet
>
> > root@xerus:/etc# service ntp start
> > Jun 27 15:33:12 xerus systemd[1]: Started LSB: Start NTP daemon.
>
> > root@xerus:/etc# ps aux | grep ntp
> > root 7565 0.0 0.2 17704 2520 pts/0 S+ 15:33 0:00 grep ntp
> > root@xerus:/etc#
>
> > Laeuft also nicht und in /var/log/syslog stehen keine Fehlermeldungen!
>
> > Wenn ich ntpd von Hand starte, gehts:
>
> > root@xerus:/etc# /usr/sbin/ntpd -g
>
> haste das -g auch in den Conf Dateien für ntpd drin /etc/default/ntpd oder
> /etc/ntpd/*.conf ...

root@xerus:~# cat /etc/default/ntp
NTPD_OPTS='-g'

Davon unabhaengig:

root@xerus:~# systemctl stop ntp

root@xerus:~# ntpdate rustime01
28 Jun 13:43:09 ntpdate[1969]: adjust time server 129.69.1.153 offset -0.000025 sec

root@xerus:~# systemctl start ntp

root@xerus:~# systemctl start status
Failed to start status.service: Unit status.service not found.
root@xerus:~# systemctl status ntp
* ntp.service - LSB: Start NTP daemon
Loaded: loaded (/etc/init.d/ntp; bad; vendor preset: enabled)
Active: active (exited) since Tue 2016-06-28 08:13:00 CEST; 5h 30min ago
^^^^^^

Kommt nicht wieder hoch.


> sollte dann abar im syslog stehen ...

Da steht eben nix.

Sven Hartge

unread,
Jun 28, 2016, 12:54:36 PM6/28/16
to
Das heißt nur, dass /etc/init.d/ntp sich ohne Fehlercode beendet hat.

Die Frage ist, warum macht das init-Script das? Direktes ausführen von
"/etc/init.d/ntp start" führt aber dazu, dass wieder der
systemd-Mechanismus zum Starten des Init-Scripts benutzt wird.

Es gibt aber eine Umgebungsvariable, die man setzen kann, damit das
nicht passiert.

Was ist die Ausgabe, wenn du folgendes machst:

_SYSTEMCTL_SKIP_REDIRECT=true /bin/sh -x /etc/init.d/ntp start



--
Sigmentation fault. Core dumped.

Ulli Horlacher

unread,
Jul 11, 2016, 5:18:13 AM7/11/16
to
Sven Hartge <sh-...@svenhartge.de> wrote:
> > root@xerus:~# systemctl start ntp
> > root@xerus:~# systemctl status ntp
> > * ntp.service - LSB: Start NTP daemon
> > Loaded: loaded (/etc/init.d/ntp; bad; vendor preset: enabled)
> > Active: active (exited) since Tue 2016-06-28 08:13:00 CEST; 5h 30min ago
> > ^^^^^^
>
> > Kommt nicht wieder hoch.
>
> Das heißt nur, dass /etc/init.d/ntp sich ohne Fehlercode beendet hat.
>
> Die Frage ist, warum macht das init-Script das? Direktes ausführen von
> "/etc/init.d/ntp start" führt aber dazu, dass wieder der
> systemd-Mechanismus zum Starten des Init-Scripts benutzt wird.
>
> Es gibt aber eine Umgebungsvariable, die man setzen kann, damit das
> nicht passiert.
>
> Was ist die Ausgabe, wenn du folgendes machst:
>
> _SYSTEMCTL_SKIP_REDIRECT=true /bin/sh -x /etc/init.d/ntp start

Es wird immer mysterioeser:
Mit dieser Debug-Anweisung kommt ntpd hoch.
Danach geht

/etc/init.d/ntp stop
/etc/init.d/ntp start

bzw

systemctl stop ntp
systemctl start ntp

Das ganze ist nach reboot reproduzierbar: zuerst kommt ntpd nicht hoch,
ich muss erst _SYSTEMCTL_SKIP_REDIRECT=true setzen, dann gehts.



Output ist:

root@xerus:~# _SYSTEMCTL_SKIP_REDIRECT=true /bin/sh -x /etc/init.d/ntp start
+ PATH=/sbin:/bin:/usr/sbin:/usr/bin
+ . /lib/lsb/init-functions
+ run-parts --lsbsysinit --list /lib/lsb/init-functions.d
+ [ -r /lib/lsb/init-functions.d/01-upstart-lsb ]
+ . /lib/lsb/init-functions.d/01-upstart-lsb
+ unset UPSTART_SESSION
+ _RC_SCRIPT=/etc/init.d/ntp
+ [ -r /etc/init//etc/init.d/ntp.conf ]
+ _UPSTART_JOB=ntp
+ [ -r /etc/init/ntp.conf ]
+ [ -r /lib/lsb/init-functions.d/20-left-info-blocks ]
+ . /lib/lsb/init-functions.d/20-left-info-blocks
+ [ -r /lib/lsb/init-functions.d/40-systemd ]
+ . /lib/lsb/init-functions.d/40-systemd
+ _use_systemctl=0
+ [ -d /run/systemd/system ]
+ prog=ntp
+ service=ntp.service
+ systemctl -p LoadState show ntp.service
+ state=LoadState=loaded
+ [ LoadState=loaded = LoadState=masked ]
+ [ 1903 -ne 1 ]
+ [ -z ]
+ [ -z true ]
+ export _SYSTEMCTL_SKIP_REDIRECT=true
+ [ 0 = 1 ]
+ [ -r /lib/lsb/init-functions.d/50-ubuntu-logging ]
+ . /lib/lsb/init-functions.d/50-ubuntu-logging
+ LOG_DAEMON_MSG=
+ [ -r /lib/lsb/init-functions.d/99-plymouth ]
+ . /lib/lsb/init-functions.d/99-plymouth
+ plymouth --ping
+ return
+ FANCYTTY=
+ [ -e /etc/lsb-base-logging.sh ]
+ true
+ DAEMON=/usr/sbin/ntpd
+ PIDFILE=/var/run/ntpd.pid
+ test -x /usr/sbin/ntpd
+ [ -r /etc/default/ntp ]
+ . /etc/default/ntp
+ NTPD_OPTS=-g
+ [ /var/lib/ntp/ntp.conf.dhcp -nt /etc/ntp.conf ]
+ LOCKFILE=/var/lock/ntpdate
+ RUNASUSER=ntp
+ cut -f 3,4 -d:
+ getent passwd ntp
+ UGID=111:117
+ uname -s
+ test Linux = Linux
+ NTPD_OPTS=-g -u 111:117
+ log_daemon_msg Starting NTP server ntpd
+ [ -z Starting NTP server ]
+ log_use_fancy_output
+ TPUT=/usr/bin/tput
+ EXPR=/usr/bin/expr
+ [ -t 1 ]
+ [ xscreen != x ]
+ [ xscreen != xdumb ]
+ [ -x /usr/bin/tput ]
+ [ -x /usr/bin/expr ]
+ /usr/bin/tput hpa 60
+ FANCYTTY=0
+ false
+ echo * Starting NTP server ntpd
* Starting NTP server ntpd
+ COL=
+ [ -z 111:117 ]
+ lock_ntpdate
+ [ -x /usr/bin/lockfile-create ]
+ start-stop-daemon --start --quiet --oknodo --pidfile /var/run/ntpd.pid --startas /usr/sbin/ntpd -- -p /var/run/ntpd.pid -g -u 111:117
+ status=0
+ unlock_ntpdate
+ [ -x /usr/bin/lockfile-create ]
+ log_end_msg 0
+ [ -z 0 ]
+ [ ]
+ [ 0 -eq 0 ]
+ echo ...done.
...done.
+ return 0


--
Ullrich Horlacher Server und Virtualisierung
Rechenzentrum TIK

Sven Hartge

unread,
Jul 11, 2016, 9:22:37 AM7/11/16
to
Das ist in der Tat mehr wie mysteriös. Da fällt mir auf Anhieb auch
nicht ein, wo man jetzt weiter schauen sollte.

Aber es scheint, wie wenn der erste erfolgreiche Start irgendetwas
anlegt oder initialisiert, so dass es danach dann auch via systemd
funktioniert.

Ich habe nur spontan keine Idee, was dies im Kontext von ntpd sein
könnte.

systemd selbst führt "/etc/init.d/ntp start" ja auch aus, nur eben nicht
direkt via der Session des eingeloggten Benutzers, sondern via
"systemctl", welcher dann den systemd (PID 1) anweist, das Init-Script
zu starten, also "über Bande", aber am Ende wird dennoch der gleiche
Code ausgeführt.

pec...@gmail.com

unread,
Dec 25, 2017, 7:49:23 AM12/25/17
to
I had the problem that on my RasPi 3B (Ubuntu Mate 16.04 LTS) the NTPD did not start after reboot. I am no Linux expert but I tried to find the reason using a lot of links in Google. Late in the morning I found your thread here and at the end I detected the failure:
The script NTPD is missing after reboot the X-right and can therefore not be executed. I corrected this in /etc/init.d/ntp and now it works still for several reboots. For my opinion there must be a system failure behind and you have probably the possibility to check this or initiate the correction.

Please look on my work protocol under http://www.oe1gpa.at/download/ntp.error.log (txt file).

With kind regards
and best wishes for 2018
Gerald Pechoc
0 new messages