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

NTP mit eigenem Server vs. ntp.conf

0 views
Skip to first unread message

Paul Muster

unread,
Feb 6, 2024, 7:50:03 AMFeb 6
to
Hallo,

wie teile ich (m)einem ntpd einen spezifischen Server mit, ohne diesen
in ntp.conf einzutragen?

Aktuell ändere ich die /etc/ntp.conf, was mit bei jedem Upgrade
"vorgehalten" wird ("conf file changed. replace, keep, diff, ...?"). Ein
Verzeichnis /etc/ntp.conf.d/ scheint es nicht zu geben - und selbst
wenn, müsste ich dort die in der Standard-ntp.conf eingetragenen Server
ja irgendwie entfernen/übersteuern (bei einem Cisco-Router würde man 'no
pool 0.debian.pool.ntp.org iburst' konfigurieren...).

Ideen, Vorschläge, Kommentare?

Danke & viele Grüße

Paul

Mike

unread,
Feb 6, 2024, 8:00:04 AMFeb 6
to
Am 06.02.2024 um 13:27 schrieb Paul Muster:
> Hallo,
>
> wie teile ich (m)einem ntpd einen spezifischen Server mit, ohne diesen
> in ntp.conf einzutragen?

Moin,

vielleicht hilfts:

aus https://docs.ntpsec.org/latest/ntp_conf.html

The ntp.conf configuration file is read at initial startup by the
ntpd(8) daemon in order to specify the synchronization sources, modes,
and other related information. Usually, it is installed in the /etc
directory, but could be installed elsewhere (see the daemon’s -c command
line option).

Paul Muster

unread,
Feb 6, 2024, 9:10:04 AMFeb 6
to
Am 06.02.2024 um 13:56 schrieb Mike:
> Am 06.02.2024 um 13:27 schrieb Paul Muster:

>> wie teile ich (m)einem ntpd einen spezifischen Server mit, ohne diesen
>> in ntp.conf einzutragen?

> vielleicht hilfts:
>
> aus https://docs.ntpsec.org/latest/ntp_conf.html
>
> The ntp.conf configuration file is read at initial startup by the
> ntpd(8) daemon in order to specify the synchronization sources, modes,
> and other related information. Usually, it is installed in the /etc
> directory, but could be installed elsewhere (see the daemon’s -c command
> line option).

Ja, nee, nicht so wirklich. Ich möchte ja auf die Änderungen, die die
Paket-eigene ntp.conf mitbringt, nicht _völlig_ verzichten.

Ein Ansatz wäre, wie bei anderen Programmen ein Verzeichnis
/etc/ntp.conf.d/ anzulegen und dieses mittels /includefile/ einzubinden.
Aber:

a) ist im Moment kein solches /includefiles/-Statement in der ntp.conf,
sodass diese Zeile auch wieder Debians conf-file-handling triggern würde

und

b) müsste ich in einer nach /etc/ntp.conf "includeten" Datei die dort
(in /etc/ntp.conf) hinterlegten Server/Pools wieder tilgen (vgl.
Eingangsposting). (Bzw. verhält sich /includefiles/ laut man-page ja
durchaus komplizierter, sodass man die Reihenfolge genau abwägen müsste...)

Schwierig.


mfG Paul

Mike

unread,
Feb 6, 2024, 9:20:03 AMFeb 6
to
Am 06.02.2024 um 15:00 schrieb Paul Muster:
> Am 06.02.2024 um 13:56 schrieb Mike:
>> Am 06.02.2024 um 13:27 schrieb Paul Muster:
>
>>> wie teile ich (m)einem ntpd einen spezifischen Server mit, ohne diesen
>>> in ntp.conf einzutragen?
>
>> vielleicht hilfts:
>>
>> aus https://docs.ntpsec.org/latest/ntp_conf.html
>>
>> The ntp.conf configuration file is read at initial startup by the
>> ntpd(8) daemon in order to specify the synchronization sources, modes,
>> and other related information. Usually, it is installed in the /etc
>> directory, but could be installed elsewhere (see the daemon’s -c command
>> line option).
>
> Ja, nee, nicht so wirklich. Ich möchte ja auf die Änderungen, die die
> Paket-eigene ntp.conf mitbringt, nicht _völlig_ verzichten.
>
> Ein Ansatz wäre, wie bei anderen Programmen ein Verzeichnis
> /etc/ntp.conf.d/ anzulegen und dieses mittels /includefile/ einzubinden.
> Aber:
>
> a) ist im Moment kein solches /includefiles/-Statement in der ntp.conf,
> sodass diese Zeile auch wieder Debians conf-file-handling triggern würde

Also ein Config. Directory ist vorgesehen:

https://docs.ntpsec.org/latest/ntpd.html

Pkt. 7

configuration directory | /etc/ntp.d | -c | conffile

Configuration files are parsed according to the following rules:

1 .The plain config file (normally /etc/ntp.conf but the path can be
overridden by the -c option) is read first if it exists.
2. Then the configuration directory, if it exists, is scanned. Normally
this directory is /etc/ntp.d, but if the -c option is pecified the /etc
will be specified by the directory name of the -c argument.
3. Each file beneath the configuration directory with the extension
".conf" is interpreted. Files are interpreted in ASCII sort order of
their pathnames. Files with other extensions or no extensions are ignored.

> und
>
> b) müsste ich in einer nach /etc/ntp.conf "includeten" Datei die dort
> (in /etc/ntp.conf) hinterlegten Server/Pools wieder tilgen (vgl.
> Eingangsposting). (Bzw. verhält sich /includefiles/ laut man-page ja
> durchaus komplizierter, sodass man die Reihenfolge genau abwägen müsste...)
>
> Schwierig.

Durchaus. Da müsste man mal testen was, wie und ob es überhaupt wie
gewünscht funktioniert.

Ggf. selber was scripten, was du nach einem Update laufen lässt, was dir
die Standard NTP-Server löscht und deinen einbaut. Da gibts Experten für
auf der Liste ;-)

M.

> mfG Paul
>
>

Harald Weidner

unread,
Feb 6, 2024, 9:40:05 AMFeb 6
to
Hallo,

> wie teile ich (m)einem ntpd einen spezifischen Server mit, ohne diesen in
> ntp.conf einzutragen?

> Aktuell ändere ich die /etc/ntp.conf, was mit bei jedem Upgrade
> "vorgehalten" wird ("conf file changed. replace, keep, diff, ...?"). Ein
> Verzeichnis /etc/ntp.conf.d/ scheint es nicht zu geben

Eine Option wäre, von ntpd auf chrony umzusteigen. Da gibt es neben der
globalen Konfigurationsdatei in /etc/chrony/chrony.conf noch die beiden
Unterverzeichnisse conf.d und sources.d. Die "server" bzw. "pool" Statements
gehören in Konfigrationsdateien unterhalb von sources.d.

Gruß, Harald

Stephan Seitz

unread,
Feb 6, 2024, 10:30:04 AMFeb 6
to
Am Di, Feb 06, 2024 at 15:30:46 +0100 schrieb Harald Weidner:
>Eine Option wäre, von ntpd auf chrony umzusteigen. Da gibt es neben der
>globalen Konfigurationsdatei in /etc/chrony/chrony.conf noch die beiden
>Unterverzeichnisse conf.d und sources.d. Die "server" bzw. "pool" Statements
>gehören in Konfigrationsdateien unterhalb von sources.d.

Schon, hat aber am Ende dasgleiche Problem. Die Default-Server stehen in
/etc/chrony/chrony.conf, damit muß er die Datei auch bearbeiten und hat
damit das Problem, daß bei Updates nachgefragt wird, falls sich die Datei
geändert hat.

Aber selbst wenn Debian die Server in das Unterverzeichnis auslagert, muß
OP die Datei anfassen.

Stephan

--
| If your life was a horse, you'd have to shoot it. |

Marc Haber

unread,
Feb 6, 2024, 1:00:04 PMFeb 6
to
On Tue, 6 Feb 2024 13:27:24 +0100, Paul Muster
<exp-3...@news.muster.net> wrote:
>Aktuell ändere ich die /etc/ntp.conf, was mit bei jedem Upgrade
>"vorgehalten" wird ("conf file changed. replace, keep, diff, ...?").

Ja, das ist leider so. Ich würde vermutlich "keep local version" sagen
und es gut sein lassen. Im Zweifel noch die .dpkg-new datei gegen das
normale File diffen und gucken ob sich jenseits der Kommentare was
geändert hat.

"vorgehalten" bekommst Du diesen Dialog auch nur, wenn sich auch im
Paket was geändert hat.

Grüße
Marc
--
----------------------------------------------------------------------------
Marc Haber | " Questions are the | Mailadresse im Header
Rhein-Neckar, DE | Beginning of Wisdom " |
Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fon: *49 6224 1600402

Hans Crauel

unread,
Feb 7, 2024, 8:20:04 PMFeb 7
to
Paul Muster schrieb

> wie teile ich (m)einem ntpd einen spezifischen Server mit, ohne diesen
> in ntp.conf einzutragen?
>
> Aktuell ändere ich die /etc/ntp.conf, was mit bei jedem Upgrade
> "vorgehalten" wird ("conf file changed. replace, keep, diff, ...?"). Ein
> Verzeichnis /etc/ntp.conf.d/ scheint es nicht zu geben - und selbst
> wenn, müsste ich dort die in der Standard-ntp.conf eingetragenen Server
> ja irgendwie entfernen/übersteuern (bei einem Cisco-Router würde man 'no
> pool 0.debian.pool.ntp.org iburst' konfigurieren...).

Ich habe ntpsec, wo es kein /etc/ntp.conf gibt, sondern ein
/etc/netpsec/ntp.conf.

Die man-page von ntpd sagt dazu

| Each file beneath the configuration directory with the
| extension ".conf" is interpreted. Files are interpreted
| in ASCII sort order of their pathnames. Files with other
| extensions or no extensions are ignored.

Damit sollte man in /etc/ntpsec/ etwa ein "mein.conf" (wenn
es vor ntp.conf drankommen soll) oder ein "wein.conf" (für
danach) anlegen können, welches dann von upgrades nicht
angemeckert werden sollte.

Hans

Hans Crauel

unread,
Feb 7, 2024, 8:40:04 PMFeb 7
to
Paul Muster schrieb

> wie teile ich (m)einem ntpd einen spezifischen Server mit, ohne diesen
> in ntp.conf einzutragen?
>
> Aktuell ändere ich die /etc/ntp.conf, was mit bei jedem Upgrade
> "vorgehalten" wird ("conf file changed. replace, keep, diff, ...?"). Ein
> Verzeichnis /etc/ntp.conf.d/ scheint es nicht zu geben - und selbst
> wenn, müsste ich dort die in der Standard-ntp.conf eingetragenen Server
> ja irgendwie entfernen/übersteuern (bei einem Cisco-Router würde man 'no
> pool 0.debian.pool.ntp.org iburst' konfigurieren...).

Ich habe ntpsec, wo es kein /etc/ntp.conf gibt, sondern ein
/etc/netpsec/ntp.conf.

Die man-page von ntpd sagt dazu

| Each file beneath the configuration directory with the
| extension ".conf" is interpreted. Files are interpreted
| in ASCII sort order of their pathnames. Files with other
| extensions or no extensions are ignored.

Damit sollte man in /etc/ntpsec/ ein "mein.conf" (wenn
es vor ntp.conf drankommen soll) oder ein "sein.conf" (für
0 new messages