Bug 221740 - net-mgmt/nrpe: not starting after crash
Summary: net-mgmt/nrpe: not starting after crash
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Niclas Zeising
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-23 13:05 UTC by Mathieu Arnold
Modified: 2017-09-06 09:28 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (zeising)


Attachments
v1 (634 bytes, patch)
2017-08-23 13:05 UTC, Mathieu Arnold
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu Arnold freebsd_committer freebsd_triage 2017-08-23 13:05:37 UTC
Created attachment 185691 [details]
v1

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.
Comment 1 commit-hook freebsd_committer freebsd_triage 2017-09-06 09:24:56 UTC
A commit references this bug:

Author: mat
Date: Wed Sep  6 09:24:11 UTC 2017
New revision: 449332
URL: https://svnweb.freebsd.org/changeset/ports/449332

Log:
  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
  Sponsored by:	Absolight

Changes:
  head/net-mgmt/nrpe/Makefile
  head/net-mgmt/nrpe/files/nrpe2.in
Comment 2 commit-hook freebsd_committer freebsd_triage 2017-09-06 09:28:00 UTC
A commit references this bug:

Author: mat
Date: Wed Sep  6 09:26:51 UTC 2017
New revision: 449333
URL: https://svnweb.freebsd.org/changeset/ports/449333

Log:
  MFH: r449332

  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

Changes:
_U  branches/2017Q3/
  branches/2017Q3/net-mgmt/nrpe/Makefile
  branches/2017Q3/net-mgmt/nrpe/files/nrpe2.in