• Mathieu Arnold's avatar
    MFH: r449332 · 0b48d9e7
    Mathieu Arnold authored
    Fix not starting after crash.
    
    When nrpe quits ungracefully, for example, if the box was rebooted, it
    often does not start because the pid file is still there, and the pid in
    it exists and the pid in it is in use by some other process.
    
    The dubious code is in src/nrpe.c in write_pid_file() around line 1756
    that could be axed.
    
    But I think the easiest way to fix this is with the attached patch.
    precmd is run just before starting the daemon and after checking that it
    is not already running.
    
    With this, it starts just fine, and still refuses to start if it is
    really already running, but starts fine if the pid file contains a pid
    that exists but is not nrpe.
    
    PR:		221740
    Submitted by:	mat
    Approved by:	maintainer timeout, ports-secteam blanket
    Sponsored by:	Absolight
    0b48d9e7