Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#23473 - [ntp] /etc/rc.d/ntpd creates an empty PID file

Attached to Project: Arch Linux
Opened by Anders Bergh (anders) - Monday, 28 March 2011, 08:57 GMT
Last edited by Andrea Scarpino (BaSh) - Sunday, 03 April 2011, 17:45 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Kevin Piche (kpiche)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

When running '/etc/rc.d/ntpd start' it creates an empty PID file /var/run/ntpd.pid.


Additional info:
* package version(s)

ntp 4.2.6.p3-1

One could replace the following:
PID=`pidof -o %PPID /usr/bin/ntpd`
echo $PID > /var/run/ntpd.pid

with:
PID=$!
echo $PID > /var/run/ntpd.pid

I tried it and it works, but I dunno if it's the best way.
This task depends upon

Closed by  Andrea Scarpino (BaSh)
Sunday, 03 April 2011, 17:45 GMT
Reason for closing:  Fixed
Additional comments about closing:  ntp 4.2.6.p3-3
Comment by Anders Bergh (anders) - Monday, 28 March 2011, 08:59 GMT
Scratch that suggestion - it does not work. It writes the wrong PID. Sleep deprived! Sorry
Comment by Anders Bergh (anders) - Tuesday, 29 March 2011, 18:17 GMT
  • Field changed: Percent Complete (100% → 0%)
still broken:


[anders@onyx ~]$ ps aux | grep ntpd
anders 28770 0.0 0.1 3968 832 pts/0 S+ 19:12 0:00 grep ntpd
[anders@onyx ~]$ sudo /etc/rc.d/ntpd start
:: Starting NTP Daemon [DONE]
[anders@onyx ~]$ cat /var/run/ntpd.pid
3175
[anders@onyx ~]$ ps aux | grep 3175
anders 28792 0.0 0.1 3968 828 pts/0 S+ 19:12 0:00 grep 3175

[anders@onyx ~]$ ps aux | grep ntpd
root 28785 0.0 0.3 4648 1708 ? Ss 19:12 0:00 /usr/bin/ntpd -g
Comment by Andrea Scarpino (BaSh) - Tuesday, 29 March 2011, 18:18 GMT
works for me.

However the script needs to be improved, then I re-opened this.
Comment by Anders Bergh (anders) - Wednesday, 30 March 2011, 04:02 GMT
I find it strange that it works for you. I tried on two different servers.

My ntpd.conf:

server ntp1.x.x
server ntp2.x.x

restrict 127.0.0.1
restrict -6 ::1

driftfile /var/lib/ntp/ntp.drift
Comment by Anders Bergh (anders) - Wednesday, 30 March 2011, 05:16 GMT
The right way to fix this is by using the ntpd -p parameter, like so:

ntpd -p /var/run/ntpd.pid

Loading...