Bug 72110 - redhat-config-time clobbers existing servers in /etc/ntp.conf
redhat-config-time clobbers existing servers in /etc/ntp.conf
Product: Fedora
Classification: Fedora
Component: system-config-date (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Nils Philippsen
Depends On:
  Show dependency treegraph
Reported: 2002-08-21 03:03 EDT by Alexandre Oliva
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-09-05 12:12:01 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
My laptop's /etc/ntp.conf (3.74 KB, text/plain)
2003-12-18 19:40 EST, Alexandre Oliva
no flags Details

  None (edit)
Description Alexandre Oliva 2002-08-21 03:03:50 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020809

Description of problem:
If you have a non-trivial /etc/ntp.conf, that lists a set of alternate servers,
after redhat-config-time, you'll have several lines containing the IP address
specified in redhat-config-time.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.add a number of valid server entries to /etc/ntp.conf, by hand
2.run redhat-config-time
3.list an ntp server

Actual Results:  all `server' lines will be replaced

Expected Results:  I'd prefer that redhat-config-time added some marker to the
line it adds, so that it can safely replace that single line, instead of
clobbering the user set up.  Say:

server <ip or name>  # added by redhat-config-time

Additional info:
Comment 1 Brent Fox 2002-08-27 22:49:59 EDT
Ok, I've modified redhat-config-date in two ways. 

1) The server that you see in the "NTP server" widget will be the first server
that appears in the file.

2) If you change the NTP server, only the first server will be modified.  For
example, if you have in your file:

server   time.nist.gov
server   clock.via.net
server   ntp.lth.se

when you run the program you will see only "time.nist.gov" in the selection
widget.  If you were to change the widget to "timekeeper.isi.edu", for example,
your file would now look like:

server   timekeeper.isi.edu
server   clock.via.net
server   ntp.lth.se

I think this will get most of what you're asking for.  QA, please verify that
this is the behavior with 1.5.2-7.
Comment 2 Alexandre Oliva 2002-08-30 02:23:59 EDT
The change looks reasonable to me.  Thanks!
Comment 3 Brent Fox 2003-05-25 10:30:14 EDT
There is a stack of 64 bugs that have been in Modified state for a long period
of time.  I am closing these as Rawhide now.  If you find that the issue is not
fixed, please reopen this report.
Comment 4 Alexandre Oliva 2003-10-18 14:06:30 EDT
It looks better now, but it still removes any `restrict' entries present in the
file, which renders all the `server' lines it leaves in useless just the same :-(
Comment 5 Brent Fox 2003-12-18 16:17:05 EST
Can you attach the original ntp.conf file that you are using?  That
way I can have the same test case that you are using.  I'll see what I
can do about preserving the restrict lines.
Comment 6 Alexandre Oliva 2003-12-18 19:40:58 EST
Created attachment 96630 [details]
My laptop's /etc/ntp.conf

Here's the requested file.
Comment 7 Brent Fox 2004-03-05 19:15:43 EST
Ok, system-config-date-1.7.2-1 should now preserve all the other
restrict lines.
Comment 8 Alexandre Oliva 2004-03-18 23:02:32 EST
I see it still removes the line:

server     # local clock

Is this intentional?
Comment 9 Brent Fox 2004-03-23 14:04:53 EST
Is it necessary for that line to be preserved?
Comment 10 Alexandre Oliva 2004-04-21 09:11:35 EDT
What if the local host has a reliable clock source?  Taking this out
would break it, I suppose.  Besides, consider that someone might have
a good reason to have kept the line there, maybe even added it after
something else removed it (system-config-time :-); removing it (again)
would probably be wrong.  It's not like the line hurts, is it?
Comment 11 Nils Philippsen 2004-07-21 08:28:35 EDT
Alexandre, does this still happen with a recent system-config-date?
Comment 12 Nils Philippsen 2004-08-17 07:11:58 EDT
Comment 13 Alexandre Oliva 2004-08-18 02:33:55 EDT
Sorry for the delay.  Yes, it still happens.  Here are the changes
system-config-date makes to my ntp.conf:

# diff -U0 ntp.conf.orig ntp.conf
--- ntp.conf.orig       2004-07-15 00:55:28.000000000 -0300
+++ ntp.conf    2004-08-18 03:34:21.650296934 -0300
@@ -2,0 +3 @@
+restrict mask nomodify notrap noquery
@@ -48 +49 @@
-server     # local clock
Comment 14 Nils Philippsen 2004-08-18 04:59:11 EDT
OK. Due to other stuff (bug #115148 for instance) I plan to revamp the
NTP dialog and code a bit. I wanted to let users configure more than
one NTP server anyway, I guess additionally having a checkbox "Use
local time source" wouldn't hurt.
Comment 15 Nils Philippsen 2004-09-05 12:12:01 EDT
Should be fixed in 1.7.5-1.

Note You need to log in before you can comment on or make changes to this bug.