Online Expert Day - HPE Data Storage - Live Now
April 24/25 - Online Expert Day - HPE Data Storage - Live Now
Read more
System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

What is editing /etc/ntp.conf file during a reboot

Omololu Shobayo
Frequent Advisor

What is editing /etc/ntp.conf file during a reboot

The server would delete all entries marked in red after a reboot. The file name is /etc/ntp.conf.

server gpsclock01
server gpsclock02
server gpsclock03
restrict default ignore
restrict 10.82.254.110
restrict 10.116.32.30
restrict 10.69.99.21
server 127.127.1.0 # Local Clock
restrict 127.0.0.0 mask 255.0.0.0
driftfile /etc/ntp.drift
tracefile /etc/ntp.trace

I tried to debug and come to the following conclusion.

The file is being deleted when " init 1" is executed. It is deleted before the first S???? File in /sbin/rc1.d
I diagnosed in maintenance mode and in single user mode to get above information.
I also created a debug file to list the content of /etc/ntp.conf file after every file is executed in /sbin/rc1.d


The question is what commands works on this file /etc/ntp.conf even before init 1. and is there a bug somewhere?
10 REPLIES
Patrick Wallek
Honored Contributor

Re: What is editing /etc/ntp.conf file during a reboot

>>The server would delete all entries marked in red after a reboot

Sorry, but we can't see colors here.

There should not be anything that would touch this file during boot.

You might check your /etc/inittab file and see if there is anything there that may be doing something.

Johnny Damtoft
Regular Advisor

Re: What is editing /etc/ntp.conf file during a reboot

If something or some process is "touching" your ntp.conf file, there could also be a diskspace problem somewhere.

--
Johnny
Omololu Shobayo
Frequent Advisor

Re: What is editing /etc/ntp.conf file during a reboot

Sorry, I pasted it from my messages to HP. The color part are the lines that have restric and all the drift files.

The server does not have any disk issue and I even tried to rearrage the lines to check if the file is being truncated for any reason but the command goes into the file and delete only the restricted entries and drift entries.
Pete Randall
Outstanding Contributor

Re: What is editing /etc/ntp.conf file during a reboot

I would take a look at your own startup processes. From a system standpoint, nothing that I can see touches ntp.conf. Mine, in fact, has been untouched since I last edited it back in 2005.


Pete

Pete
Omololu Shobayo
Frequent Advisor

Re: What is editing /etc/ntp.conf file during a reboot

You are correct, nothing should touch it, but something is touching it. What could lead to something touching it is what I am still looking for. It is being touched before the RC processes. From single user mode, it is fine but immediately I run "init 1", the file is touched. I know that becasue I created a script that checks the content of the file and make sure it runs first on level 1. The script listed edited file immidiately. I must find solution to this ASAP.
Patrick Wallek
Honored Contributor

Re: What is editing /etc/ntp.conf file during a reboot

Did you check /etc/inittab as I suggested? Anything suspicious there?
Omololu Shobayo
Frequent Advisor

Re: What is editing /etc/ntp.conf file during a reboot

I checked inittab, I even replaced the server inittab with the inittab in /usr/newconfig/etc/inittab. it was still having issues.
Patrick Wallek
Honored Contributor

Re: What is editing /etc/ntp.conf file during a reboot

What about /etc/rc.log? Anything interesting there?

Does anything interesting show up if you do:

# grep ntp.conf /sbin/init.d/*

Rita C Workman
Honored Contributor

Re: What is editing /etc/ntp.conf file during a reboot

Not sure exactly what your saying (like Patrick said-we have color).

But the /etc/rc.config.d/netdaemons file is where you set up the time (ntp) and tell your box to start the xntpd (time) daemon on reboot.
When your box reboots it runs /sbin/init.d/xntpd as part of the /sbin/rc2.d startup scripts. And it's this that goes out and reads the ntp.conf file to get things rolling.

I'd check and see if somebody didn't go into a script and do some "tweeking" on one of these system scripts. Hate to say that someone would do that, but I've come across happening. It's a pain to run down.

Hope this helps,
Rita
Bill Hassell
Honored Contributor

Re: What is editing /etc/ntp.conf file during a reboot

Use this command:

ls -lrt /etc/rc.config.d

The files at the bottom of the list are the most recently changed or created files. Unlike any other directory in HP-UX, /etc/rc.config.d must NEVER have junk files, test files or old copies of current files. During bootup, *every* file is run in order to set the start variables. This includes junk files and test files. If this behavior (changed ntp.conf) just started happening, look at the newest files at the bottom of the list. You should also look at the most recently changed files in /sbin/init.d. And look at every "S" link in /sbin/rc0.d and /etc/rc1.d...check the files that they point to.

And of course the easiest way is to locate every file that contains the string /etc/ntp.conf:

grep /etc/ntp.conf /etc/rc.config.d/*
grep /etc/ntp.conf /sbin/rc?.d/*
grep /etc/ntp.conf /sbin/init.d/*


Bill Hassell, sysadmin