Bug 82859 - /etc/init.d/ntpd restart tries to kill wrong process
Bug#: 82859 Product:  Gentoo Linux Version: unspecified Platform: x86
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: vapier@gentoo.org Reported By: pwsoft@syntiac.com
Component: Applications
URL: 
Summary: /etc/init.d/ntpd restart tries to kill wrong process
Keywords:  
Status Whiteboard: 
Opened: 2005-02-21 12:11 0000
Description:   Opened: 2005-02-21 12:11 0000
athlon1800 peter # /etc/init.d/ntpd restart
 * Stopping ntpd ...
start-stop-daemon: warning: failed to kill 347: No such process
1 pids were not killed
No process in pidfile `/var/run/ntpd.pid' found running; none killed.
 * Failed to stop ntpd                                                                 [ !! ]
 * Starting ntpd ...                                                                   [ ok ]

Apperently ntpd was no longer running. Looking at the logging might show the reason it is not running.
athlon1800 peter # cat /var/log/ntp.log
21 Feb 19:27:31 ntpd[347]: synchronized to 132.163.4.101, stratum 1
21 Feb 19:27:31 ntpd[347]: time correction of 4079 seconds exceeds sanity limit (1000); set clock manually to the correct UTC time.

Which I find ok, but I don't like it tries to kill 347 if this is no longer the ntp process. What happens if this pid is used for something else by the time I do a restart?

Reproducible: Didn't try
Steps to Reproduce:
1. distroy local time
2. wait for ntpd to complain in the log
3. /etc/init.d/ntpd restart

Actual Results:  
See details 

Expected Results:  
ntpd should delete the /var/run/ntpd.pid file when it discovers an error and 
terminates itself (just a guess)

------- Comment #1 From SpanKY 2005-08-19 21:09:20 0000 -------
fixed in cvs