[ntp:questions] Regarding updation of IP addresses in the ntpd.conf file
unruh
unruh at invalid.ca
Thu Jul 19 12:22:29 UTC 2012
On 2012-07-19, Arpith Nayak <arpithnayak at gmail.com> wrote:
> What I am trying to do is write a program that reads the same .conf file
> used by ntpd and change it based on the user's requirements. I will be
> presenting the user with all the addresses that are stored in the .conf
> file and want to implement functionality in the program to make appropriate
> changes in the .conf file without resorting to ntpq. So to the user it will
> be something like this on the CLI:
> set NTP_Server_x xx.xx.xx.xx<IP addresss>
> Is this possible? How does ntpd read the .conf file and parse the IP
> addresses and drift file location from the file?
By looking for keywords, like "server". But you have stated that your
programming skills are not great. And I would still want to ask-- why do
you want to do this? Why should the user care which servers are being
used? They are apt to be even less knowledgeable than you, so why
present them with options they are incapable of using. And if they are,
they they can always edit their own ntp.conf file. (ntp is a system
resource, not an individual user resource, and thus would anyway demand
root priviledges).
Ie, your request still makes no sense to me.
>
> Regards,
>
> Arpith
>
> On Wed, Jul 18, 2012 at 11:30 PM, Brian Utterback <
> brian.utterback at oracle.com> wrote:
>
>> The ntpq command can already be used to change the set of servers used in
>> real time. You can use ntpq to find the current set of servers. Are you
>> trying to create a program to present a set and allow the users to choose
>> some subset?
>>
>>
>> On 07/18/12 09:00, Arpith Nayak wrote:
>>
>>> Hello to all you mighty programmers, hackers and USENET members,
>>>
>>> I am trying to implement an API for ntpd by which the user can specify
>>> which servers he wants his machine to update time from. The application
>>> however uses a single .conf file. Are there any limits specified for the
>>> addresses that can be given in the .conf file? Also could you please help
>>> me out as to how I can read the IP addresses already present in the .conf
>>> file and how to update these values based on the user's choice? I'm also a
>>> novice to programming, so could you please help me out by not making your
>>> answers too technical?
>>>
>>>
>>> Regards,
>>>
>>> Arpith
>>> ______________________________**_________________
>>> questions mailing list
>>> questions at lists.ntp.org
>>> http://lists.ntp.org/listinfo/**questions<http://lists.ntp.org/listinfo/questions>
>>>
>>
>>
>> --
>> blu
>>
>> Always code as if the guy who ends up maintaining your code will be a
>> violent psychopath who knows where you live. - Martin Golding
>> ------------------------------**------------------------------**
>> -----------|
>> Brian Utterback - Solaris RPE, Oracle Corporation.
>> Ph:603-262-3916, Em:brian.utterback at oracle.com
>>
>>
More information about the questions
mailing list