Bug 33216 - ntpdate-debian error after changing time zone - no time server set
ntpdate-debian error after changing time zone - no time server set
Status: RESOLVED WONTFIX
Product: UCS
Classification: Unclassified
Component: System setup
UCS 3.2
Other Linux
: P5 minor (vote)
: ---
Assigned To: UCS maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-08 15:54 CET by Alexander Kläser
Modified: 2018-04-14 13:37 CEST (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kläser univentionstaff 2013-11-08 15:54:17 CET
setup.log reveals the following error message:

> Stopping NTP server: ntpd.
>  8 Nov 23:49:03 ntpdate[23797]: no servers can be used, exiting
> Starting NTP server: ntpd.

> root@master10:/root# grep ntpdate /usr/lib/univention-system-setup/scripts/35_timezone/10timezone
> test -x /usr/sbin/ntpdate-debian && /usr/sbin/ntpdate-debian || true

It seems that a server needs to be given as parameter to ntpdate:

> usage: ntpdate [-46bBdqsuv] [-a key#] [-e delay] [-k file] [-p samples] [-o version#] [-t timeo] server ...
Comment 1 Philipp Hahn univentionstaff 2013-11-08 23:39:03 CET
By default no NTP server is configured:
# ucr search ^timeserver
timeserver3: <empty>
timeserver2: <empty>
timeserver: <empty>
 Usually the master domain controller functions as the time server of a UCS domain. With the variables 'timeserver', 'timeserver2' and 'timeserver3' external NTP servers can be included as time sources.

Because of that no NTP server is written to /etc/default/ntpdate and /etc/ntp.conf. Because of that ntpdate just print that message and terminates.


The template /etc/univention/templates/files/etc/default/ntpdate is broken, since it does not set NTPSERVERS when no timeserver is configures, which leads to /usr/sbin/ntpdate-debian failing. Perhaps an "exit 0" could be inserted instead.


Hard-coding a default NTP server is considered a very bad idea; follow the link in Bug #27728 to read on why.
Comment 2 Stefan Gohmann univentionstaff 2013-11-21 07:47:36 CET
(In reply to Philipp Hahn from comment #1)
> The template /etc/univention/templates/files/etc/default/ntpdate is broken,
> since it does not set NTPSERVERS when no timeserver is configures, which
> leads to /usr/sbin/ntpdate-debian failing. Perhaps an "exit 0" could be
> inserted instead.

Why is the template broken? NTPSERVERS must not be set if no timeserver is configured.

I think the system setup timezone script should check if a timeserver is set.
Comment 3 Philipp Hahn univentionstaff 2013-11-21 17:28:14 CET
(In reply to Stefan Gohmann from comment #2)
> (In reply to Philipp Hahn from comment #1)
> > The template /etc/univention/templates/files/etc/default/ntpdate is broken,
> > since it does not set NTPSERVERS when no timeserver is configures, which
> > leads to /usr/sbin/ntpdate-debian failing. Perhaps an "exit 0" could be
> > inserted instead.
> 
> Why is the template broken? NTPSERVERS must not be set if no timeserver is
> configured.
> 
> I think the system setup timezone script should check if a timeserver is set.

/etc/default/ntpdate is sourced directly by ntpdate-debian, which expects the NTPSERVERS variable to be set to at least one server.
The default Debian configuration does that and uses [0-3].debian.pool.ntp.org, which they're allowed to so since they own the debian.pool.ntp.org zone and are thus able to control it. Other vendors MUST NOT use random NTP servers without asking the owner, as this causes at least two major network incidents in the past (details are linked in Bug #27728)

The UCS template breaks the contract and does not set NTPSERVERS, which causes ntpdate-debian to fail with the error message mentioned in comment 0.

So one can argue that either ntpdate-debian should detect the case that NTPSERVERS is not set, or that UCS is at fault to not set that variable to at least one server. As UCS is modifying the configuration file, it's breaking the previously well configured service and thus - at least for me - is the one doing something wrong.
Comment 4 Stefan Gohmann univentionstaff 2013-11-21 20:02:45 CET
(In reply to Philipp Hahn from comment #3)
> (In reply to Stefan Gohmann from comment #2)
> > (In reply to Philipp Hahn from comment #1)
> > > The template /etc/univention/templates/files/etc/default/ntpdate is broken,
> > > since it does not set NTPSERVERS when no timeserver is configures, which
> > > leads to /usr/sbin/ntpdate-debian failing. Perhaps an "exit 0" could be
> > > inserted instead.
> > 
> > Why is the template broken? NTPSERVERS must not be set if no timeserver is
> > configured.
> > 
> > I think the system setup timezone script should check if a timeserver is set.
> 
> /etc/default/ntpdate is sourced directly by ntpdate-debian, which expects
> the NTPSERVERS variable to be set to at least one server.

OK, I think we should simple check if an ntpserver is configured otherwise we should not call ntpdate-debian. As you said we can't add pool.ntp.org.
Comment 5 Stefan Gohmann univentionstaff 2017-06-16 20:38:00 CEST
This issue has been filed against UCS 3. UCS 3 is out of the normal maintenance and many UCS components have vastly changed in UCS 4.

If this issue is still valid, please change the version to a newer UCS version otherwise this issue will be automatically closed in the next weeks.
Comment 6 Stefan Gohmann univentionstaff 2017-08-08 07:11:10 CEST
This issue has been filed against UCS 3.2.

UCS 3.2 is out of maintenance and many UCS components have vastly changed in later releases. Thus, this issue is now being closed.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or reopen this issue. In this case please provide detailed information on how this issue is affecting you.