Opened 16 years ago

Closed 16 years ago

#2444 closed defect (fixed)

/usr/sbin/ntpd is not running though it's running

Reported by: Steffen Pankratz Owned by: dnicholson@…
Priority: normal Milestone: 6.3
Component: BOOK Version: SVN
Severity: normal Keywords:
Cc:

Description (last modified by ken@…)

Since upgrading to blfs-bootscripts-2re 0071221 the status of the ntp daemon is wrong.

ps aux | grep ntpd
root     16665  0.0  0.0   3740  1260 ?        SNs  21:12   0:00 /usr/sbin/ntpd
/etc/rc.d/init.d/ntp status
/usr/sbin/ntpd is not running.

Also there is no /var/run/ntpd.pid file which maybe the cause of the problem.
Any ideas on this?

Regards
-Steffen

Change History (10)

comment:1 by dnicholson@…, 16 years ago

Owner: changed from blfs-book@… to dnicholson@…
Status: newassigned

Oh, that's my fault. Thanks for reporting that. I added the -p argument to use a pid file, but I forgot that we don't instruct ntpd to use a pid file. There are two ways to change this.

  1. Add -p $pidfile to the ntpd arguments.
  1. Add 'pidfile /var/run/ntpd.pid' to /etc/ntp.conf

comment:2 by bdubbs@…, 16 years ago

Adding 'pidfile /var/run/ntpd.pid' to /etc/ntp.conf seems to be the easier path. I'd vote for that.

comment:3 by Steffen Pankratz, 16 years ago

Thanks this works, I also vote for the second option because if you start ntpd without the init script, you can still use it to get the status and to shut down ntpd properly.

comment:4 by dnicholson@…, 16 years ago

The only problem with the second option is that if you don't use the pidfile directive or you change the location, we don't know about it in the initscript. We could try to scrape the location from ntp.conf in the initscript, but it could be pretty ugly. Something like:

pidfile=$(awk '/pidfile/{if ($1 !~ /^#/) print $2}' /etc/ntp.conf)

comment:5 by Steffen Pankratz, 16 years ago

Following the BLFS instructions a ntp.conf is created, so if you follow the book everything is fine and if you are skilled enough the change something you should know what you are doing :)
Maybe you could add a comment "if you change this ... you have to change this too" or use your solution. I have tested and it works.

comment:6 by dnicholson@…, 16 years ago

In #2408, I think I'm going to back out the pid file changes to the bootscript since it causes some nasty problems. However, I would still like to add the "pidfile" directive to /etc/ntp.conf. At some later point when we can rely on fixed LFS bootscripts, we can add the "-p $pidfile" argument back to the bootscript.

Sound alright?

comment:7 by Steffen Pankratz, 16 years ago

Of course, I fully agree.

in reply to:  6 comment:8 by ken@…, 16 years ago

Description: modified (diff)

Replying to dnicholson@linuxfromscratch.org:

Sound alright?

Very much. I've been seeing ntp begin to start (after I manually removed any stale pid file), and then decide the pid already existed and bail out leaving a new pid. Some of that was on clfs with blfs bootscripts, but I think some was also on LFS. I got as far as identifying it was somewhere in the functions script, and decided to revert the ntp script back to a previous version until I had time to look at it.

comment:9 by ken@…, 16 years ago

Egad! Trac thinks I changed the description - sorry if I did. I blame these (expletive-deleted) apple trackpads and laptop keyboards which can go crazy.

comment:10 by dnicholson@…, 16 years ago

Resolution: fixed
Status: assignedclosed

"Fixed" in r7265 and r7266.

Note: See TracTickets for help on using tickets.