File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -225,7 +225,6 @@ def is_running(self):
225225 @rtype: bool
226226 """
227227 pid = self .__read_pidfile ()
228- # TODO: Add in check for the pid file exists but the process is not running.
229228 return pid is not None
230229
231230 def fail_if_already_running (self ):
@@ -270,15 +269,11 @@ def stop_daemon(self, quiet):
270269 @param quiet: If True, the only error information will be printed to stdout and stderr.
271270 """
272271 # Get the pid from the pidfile
273- try :
274- pf = file (self .pidfile , 'r' )
275- pid = int (pf .read ().strip ())
276- pf .close ()
277- except IOError :
278- pid = None
272+ pid = self .__read_pidfile ()
279273
280274 if not pid :
281- message = "The agent does not appear to be running. pidfile %s does not exist.\n "
275+ message = ("The agent does not appear to be running. pidfile %s does not exist or listed process"
276+ " is not running.\n " )
282277 sys .stderr .write (message % self .pidfile )
283278 return 0 # not an error in a restart
284279
You can’t perform that action at this time.
0 commit comments