Summary: | [PATCH] net-mgmt/nagios4: use same lock_file as in nagios.in | ||||||
---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Vinícius Zavam <egypcio> | ||||
Component: | Individual Port(s) | Assignee: | Mathieu Arnold <mat> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Some People | Keywords: | patch | ||||
Priority: | --- | Flags: | bugzilla:
maintainer-feedback?
(mat) |
||||
Version: | Latest | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
URL: | https://reviews.freebsd.org/D12716 | ||||||
Attachments: |
|
Description
Vinícius Zavam
2017-10-18 12:14:30 UTC
Aplied patch in a jail should work as follows. root@zim:~ # jexec 11amd64-svn-n env -i TERM=$TERM /usr/bin/login -fp root root@11amd64-svn:~ # uname -a FreeBSD 11amd64-svn 11.1-RELEASE-p1 FreeBSD 11.1-RELEASE-p1 amd64 root@11amd64-svn:~ # pkg info -x nagios nagios-plugins-2.2.1_5,1 nagios4-4.3.4_1,1 root@11amd64-svn:~ # cd /usr/local/etc/nagios/ root@11amd64-svn:/usr/local/etc/nagios # mv cgi.cfg-sample cgi.cfg root@11amd64-svn:/usr/local/etc/nagios # mv nagios.cfg-sample nagios.cfg root@11amd64-svn:/usr/local/etc/nagios # mv resource.cfg-sample resource.cfg root@11amd64-svn:/usr/local/etc/nagios # cd objects/ root@11amd64-svn:/usr/local/etc/nagios/objects # mv commands.cfg-sample commands.cfg root@11amd64-svn:/usr/local/etc/nagios # mv contacts.cfg-sample contacts.cfg root@11amd64-svn:/usr/local/etc/nagios # mv localhost.cfg-sample localhost.cfg root@11amd64-svn:/usr/local/etc/nagios # mv printer.cfg-sample printer.cfg root@11amd64-svn:/usr/local/etc/nagios # mv switch.cfg-sample switch.cfg root@11amd64-svn:/usr/local/etc/nagios # mv templates.cfg-sample templates.cfg root@11amd64-svn:/usr/local/etc/nagios # mv timeperiods.cfg-sample timeperiods.cfg root@11amd64-svn:/usr/local/etc/nagios # mv windows.cfg-sample windows.cfg root@11amd64-svn:/usr/local/etc/nagios/objects # sysrc nagios_enable=YES nagios_enable: -> YES root@11amd64-svn:/usr/local/etc/nagios/objects # service nagios start Performing sanity check of nagios configuration: OK Starting nagios. root@11amd64-svn:/usr/local/etc/nagios/objects # cat /var/spool/nagios/nagios.log [1508329034] Nagios 4.3.4 starting... (PID=21839) [1508329034] Local time is Wed Oct 18 12:17:14 UTC 2017 [1508329034] LOG VERSION: 2.0 [1508329034] qh: Socket '/var/spool/nagios/rw/nagios.qh' successfully initialized [1508329034] qh: core query handler registered [1508329034] nerd: Channel hostchecks registered successfully [1508329034] nerd: Channel servicechecks registered successfully [1508329034] nerd: Channel opathchecks registered successfully [1508329034] nerd: Fully initialized and ready to rock! [1508329034] wproc: Successfully registered manager as @wproc with query handler [1508329034] wproc: Registry request: name=Core Worker 21840;pid=21840 [1508329034] wproc: Registry request: name=Core Worker 21844;pid=21844 [1508329034] wproc: Registry request: name=Core Worker 21842;pid=21842 [1508329034] wproc: Registry request: name=Core Worker 21845;pid=21845 [1508329034] wproc: Registry request: name=Core Worker 21841;pid=21841 [1508329034] wproc: Registry request: name=Core Worker 21843;pid=21843 [1508329034] Successfully launched command file worker with pid 21846 Added to Phabricator (https://reviews.freebsd.org/D12716). (In reply to Vinícius Zavam from comment #2) More details about what this patch does, you can find on review D12716. - Problem Description There's a conflict between the lockfile used on the installed nagios.cfg sample, and the Nagios' rc script (etc/rc.d/nagios). They are using a different lockfile, making it impossible to the Nagios' user/daemon to identify the running process, and properly lock it. - Suggestion to Solve the Problem Build Nagios using " --with-lockfile=${NAGIOSDIR}/nagios.lock " Doing it will bring the same lockfile to either the rc scrip t and the installed nagios.cfg sample. A commit references this bug: Author: mat Date: Tue Nov 7 15:47:55 UTC 2017 New revision: 453665 URL: https://svnweb.freebsd.org/changeset/ports/453665 Log: Set the correct lockfile in nagios.cfg-sample. PR: 223087 Submitted by: Vin?cius Zavam Sponsored by: Absolight Changes: head/net-mgmt/nagios4/Makefile |