Github messages for voidlinux
 help / color / mirror / Atom feed
From: bahamas10 <bahamas10@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] New package: nagios-4.4.6
Date: Sun, 22 Nov 2020 02:01:49 +0100	[thread overview]
Message-ID: <20201122010149.9_uyXfvI2gAqLtiOCLf4BgHwCmxVQFPT4rdRZyzCIfI@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-23249@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1357 bytes --]

There is an updated pull request by bahamas10 against master on the void-packages repository

https://github.com/bahamas10/void-packages nagios
https://github.com/void-linux/void-packages/pull/23249

New package: nagios-4.4.6
`nrpe` and `monitoring-plugins` are already available as packages... this changes adds the nagios core itself into the set of available packages.

4.4.6 is the latest release available.

### Testing

I built the package and installed it with:

```
./xbps-src -f pkg nagios
xi nagios
```

I then enabled the service:

```
ln -s /etc/sv/nagios /var/service
```

And verified it was running with:

```
$ sudo cat /var/service/nagios/supervise/pid
30982
$ nagiostats 

Nagios Stats 4.4.6
Copyright (c) 2003-2008 Ethan Galstad (www.nagios.org)
Last Modified: 2020-04-28
License: GPL

CURRENT STATUS DATA
------------------------------------------------------
Status File:                            /var/nagios/status.dat
Status File Age:                        0d 0h 0m 3s
Status File Version:                    4.4.6

Program Running Time:                   0d 0h 0m 3s
Nagios PID:                             30982

```

Notice the PID in the `nagiostats` output matches the PID according to runit.

A patch file from https://github.com/void-linux/void-packages/pull/23249.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-nagios-23249.patch --]
[-- Type: text/x-diff, Size: 7694 bytes --]

From 1edd4f11bf73ecc96bc55eb709e3a1982125a330 Mon Sep 17 00:00:00 2001
From: Dave Eddy <dave@daveeddy.com>
Date: Fri, 26 Jun 2020 16:12:12 -0400
Subject: [PATCH 1/3] New package: nagios-4.4.6

---
 srcpkgs/nagios/files/nagios/run |  3 ++
 srcpkgs/nagios/template         | 64 +++++++++++++++++++++++++++++++++
 2 files changed, 67 insertions(+)
 create mode 100644 srcpkgs/nagios/files/nagios/run
 create mode 100644 srcpkgs/nagios/template

diff --git a/srcpkgs/nagios/files/nagios/run b/srcpkgs/nagios/files/nagios/run
new file mode 100644
index 00000000000..9ac567a9028
--- /dev/null
+++ b/srcpkgs/nagios/files/nagios/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+chown -R _nagios:_nagios /var/nagios
+exec nagios /etc/nagios/nagios.cfg 2>&1
diff --git a/srcpkgs/nagios/template b/srcpkgs/nagios/template
new file mode 100644
index 00000000000..d63cef9bb23
--- /dev/null
+++ b/srcpkgs/nagios/template
@@ -0,0 +1,64 @@
+# Template file for 'nagios'
+pkgname=nagios
+version=4.4.6
+revision=1
+build_style=gnu-configure
+
+_nagios_user="_nagios"
+_nagios_group="_nagios"
+_instdir="/usr/share/nagios"
+_bindir="/usr/bin"
+_vardir="/var/nagios"
+_confdir="/etc/nagios"
+_httpdconfdir="/etc/webapps/$pkgname/"
+_checkresultdir="/var/nagios/spool/checkresults"
+_cgibindir="/usr/libexec/nagios/cgi"
+
+configure_args="
+	--with-nagios-user=$_nagios_user
+	--with-nagios-group=$_nagios_group
+	--prefix=$_instdir
+	--bindir=$_bindir
+	--localstatedir=$_vardir
+	--sysconfdir=$_confdir
+	--with-httpd-conf=$_httpdconfdir
+	--with-checkresultdir=$_checkresultdir
+	--with-cgibindir=$_cgibindir
+	--enable-embedded-perl"
+make_build_args="all"
+make_install_args="
+	prefix=$_instdir
+	BINDIR=$_bindir
+	LOGDIR=$_vardir
+	CFGDIR=$_confdir
+	HTTPD_CONF=$_httpdconfdir
+	CHECKRESULTDIR=$_checkresultdir
+	CGIDIR=$_cgibindir
+	install install-config"
+
+makedepends="perl unzip"
+make_dirs="/etc/nagios 0775 _nagios _nagios"
+conf_files="/etc/nagios/nagios.cfg"
+
+short_desc="Nagios Core"
+maintainer="Dave Eddy <dave@daveeddy.com>"
+license="GPL-2.0-or-later"
+
+homepage="https://github.com/NagiosEnterprises/nagioscore"
+changelog="${homepage}/blob/master/Changelog"
+distfiles="${homepage}/releases/download/${pkgname}-${version}/${pkgname}-${version}.tar.gz"
+
+checksum=ab0d5a52caf01e6f4dcd84252c4eb5df5a24f90bb7f951f03875eef54f5ab0f4
+system_accounts="${_nagios_user}"
+
+post_install() {
+	# these dirs are wiped away by the void post install hooks since they are empty
+	vmkdir "$_vardir/rw"
+	vmkdir "$_vardir/spool/check/results"
+
+	# nagios has these set as 770 by default
+	chmod 755 "$DESTDIR/$_bindir/nagios"
+	chmod 755 "$DESTDIR/$_bindir/nagiostats"
+
+	vsv nagios
+}

From 6529f6464ede402bf633c6e307225f77e82e0d31 Mon Sep 17 00:00:00 2001
From: Dave Eddy <dave@daveeddy.com>
Date: Mon, 29 Jun 2020 13:53:40 -0400
Subject: [PATCH 2/3] updates based on review

---
 srcpkgs/nagios/files/nagios/run |  1 -
 srcpkgs/nagios/template         | 49 ++++++++++++++-------------------
 2 files changed, 21 insertions(+), 29 deletions(-)

diff --git a/srcpkgs/nagios/files/nagios/run b/srcpkgs/nagios/files/nagios/run
index 9ac567a9028..4d0c73dfaf0 100644
--- a/srcpkgs/nagios/files/nagios/run
+++ b/srcpkgs/nagios/files/nagios/run
@@ -1,3 +1,2 @@
 #!/bin/sh
-chown -R _nagios:_nagios /var/nagios
 exec nagios /etc/nagios/nagios.cfg 2>&1
diff --git a/srcpkgs/nagios/template b/srcpkgs/nagios/template
index d63cef9bb23..62be55d1578 100644
--- a/srcpkgs/nagios/template
+++ b/srcpkgs/nagios/template
@@ -10,37 +10,34 @@ _instdir="/usr/share/nagios"
 _bindir="/usr/bin"
 _vardir="/var/nagios"
 _confdir="/etc/nagios"
-_httpdconfdir="/etc/webapps/$pkgname/"
+_httpdconfdir="/etc/webapps/nagios/"
 _checkresultdir="/var/nagios/spool/checkresults"
 _cgibindir="/usr/libexec/nagios/cgi"
 
 configure_args="
-	--with-nagios-user=$_nagios_user
-	--with-nagios-group=$_nagios_group
-	--prefix=$_instdir
-	--bindir=$_bindir
-	--localstatedir=$_vardir
-	--sysconfdir=$_confdir
-	--with-httpd-conf=$_httpdconfdir
-	--with-checkresultdir=$_checkresultdir
-	--with-cgibindir=$_cgibindir
-	--enable-embedded-perl"
+ --with-nagios-user=$_nagios_user
+ --with-nagios-group=$_nagios_group
+ --prefix=$_instdir
+ --bindir=$_bindir
+ --localstatedir=$_vardir
+ --sysconfdir=$_confdir
+ --with-httpd-conf=$_httpdconfdir
+ --with-checkresultdir=$_checkresultdir
+ --with-cgibindir=$_cgibindir
+ --enable-embedded-perl"
 make_build_args="all"
-make_install_args="
-	prefix=$_instdir
-	BINDIR=$_bindir
-	LOGDIR=$_vardir
-	CFGDIR=$_confdir
-	HTTPD_CONF=$_httpdconfdir
-	CHECKRESULTDIR=$_checkresultdir
-	CGIDIR=$_cgibindir
-	install install-config"
-
-makedepends="perl unzip"
-make_dirs="/etc/nagios 0775 _nagios _nagios"
+make_install_args="install install-config"
+
+hostmakedepends="perl unzip"
+make_dirs="
+$_confdir 0775 _nagios _nagios
+$_vardir 0755 _nagios _nagios
+$_vardir/rw 0755 _nagios _nagios
+$_vardir/spool 0755 _nagios _nagios
+$_vardir/spool/checkresults 0755 _nagios _nagios"
 conf_files="/etc/nagios/nagios.cfg"
 
-short_desc="Nagios Core"
+short_desc="Nagios Core monitoring and alerting engine"
 maintainer="Dave Eddy <dave@daveeddy.com>"
 license="GPL-2.0-or-later"
 
@@ -52,10 +49,6 @@ checksum=ab0d5a52caf01e6f4dcd84252c4eb5df5a24f90bb7f951f03875eef54f5ab0f4
 system_accounts="${_nagios_user}"
 
 post_install() {
-	# these dirs are wiped away by the void post install hooks since they are empty
-	vmkdir "$_vardir/rw"
-	vmkdir "$_vardir/spool/check/results"
-
 	# nagios has these set as 770 by default
 	chmod 755 "$DESTDIR/$_bindir/nagios"
 	chmod 755 "$DESTDIR/$_bindir/nagiostats"

From 1fcb7bb49a539998318d401f79ca60a4f159eec5 Mon Sep 17 00:00:00 2001
From: Dave Eddy <dave@daveeddy.com>
Date: Sat, 21 Nov 2020 20:01:50 -0500
Subject: [PATCH 3/3] round of changes

---
 srcpkgs/nagios/template | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/srcpkgs/nagios/template b/srcpkgs/nagios/template
index 62be55d1578..9726fd19150 100644
--- a/srcpkgs/nagios/template
+++ b/srcpkgs/nagios/template
@@ -6,35 +6,31 @@ build_style=gnu-configure
 
 _nagios_user="_nagios"
 _nagios_group="_nagios"
-_instdir="/usr/share/nagios"
-_bindir="/usr/bin"
 _vardir="/var/nagios"
 _confdir="/etc/nagios"
-_httpdconfdir="/etc/webapps/nagios/"
+_webdir="/usr/share/nagios"
 _checkresultdir="/var/nagios/spool/checkresults"
 _cgibindir="/usr/libexec/nagios/cgi"
 
 configure_args="
  --with-nagios-user=$_nagios_user
  --with-nagios-group=$_nagios_group
- --prefix=$_instdir
- --bindir=$_bindir
  --localstatedir=$_vardir
  --sysconfdir=$_confdir
  --with-httpd-conf=$_httpdconfdir
  --with-checkresultdir=$_checkresultdir
  --with-cgibindir=$_cgibindir
+ --with-webdir=$_webdir
  --enable-embedded-perl"
 make_build_args="all"
 make_install_args="install install-config"
 
 hostmakedepends="perl unzip"
 make_dirs="
-$_confdir 0775 _nagios _nagios
-$_vardir 0755 _nagios _nagios
-$_vardir/rw 0755 _nagios _nagios
-$_vardir/spool 0755 _nagios _nagios
-$_vardir/spool/checkresults 0755 _nagios _nagios"
+$_vardir 0770 _nagios _nagios
+$_vardir/rw 0770 _nagios _nagios
+$_vardir/spool 0770 _nagios _nagios
+$_vardir/spool/checkresults 0770 _nagios _nagios"
 conf_files="/etc/nagios/nagios.cfg"
 
 short_desc="Nagios Core monitoring and alerting engine"
@@ -49,7 +45,9 @@ checksum=ab0d5a52caf01e6f4dcd84252c4eb5df5a24f90bb7f951f03875eef54f5ab0f4
 system_accounts="${_nagios_user}"
 
 post_install() {
-	# nagios has these set as 770 by default
+	# nagios has these set as 770 by default (owner and group are both
+	# "root").  Leaving these as 770 and executing nagios as root results
+	# in an error.
 	chmod 755 "$DESTDIR/$_bindir/nagios"
 	chmod 755 "$DESTDIR/$_bindir/nagiostats"
 

  parent reply	other threads:[~2020-11-22  1:01 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-23249@inbox.vuxu.org>
2020-07-09 15:59 ` [PR REVIEW] " sgn
2020-07-09 16:00 ` sgn
2020-07-09 16:02 ` sgn
2020-07-09 16:03 ` sgn
2020-07-09 16:03 ` sgn
2020-07-09 18:12 ` bahamas10
2020-07-09 18:16 ` bahamas10
2020-07-09 18:16 ` bahamas10
2020-07-09 18:17 ` bahamas10
2020-07-09 18:17 ` bahamas10
2020-07-09 21:27 ` bahamas10
2020-07-09 21:27 ` bahamas10
2020-07-09 21:41 ` bahamas10
2020-07-10  0:06 ` sgn
2020-07-10  0:12 ` sgn
2020-07-10  0:14 ` sgn
2020-07-10  0:15 ` sgn
2020-07-10  0:21 ` sgn
2020-07-10 17:00 ` bahamas10
2020-07-10 17:00 ` bahamas10
2020-07-10 17:03 ` bahamas10
2020-07-10 17:04 ` bahamas10
2020-07-10 17:06 ` bahamas10
2020-07-10 23:12 ` [PR REVIEW] " sgn
2020-07-10 23:15 ` sgn
2020-07-12  0:29 ` bahamas10
2020-07-12  0:36 ` bahamas10
2020-07-12  0:39 ` bahamas10
2020-10-31  5:26 ` sgn
2020-11-22  1:01 ` bahamas10 [this message]
2020-11-22  1:02 ` bahamas10
2020-11-22  1:24 ` ericonr
2020-11-22  1:38 ` [PR PATCH] [Updated] " bahamas10
2022-04-17  2:06 ` github-actions
2022-05-01  2:13 ` [PR PATCH] [Closed]: " github-actions

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201122010149.9_uyXfvI2gAqLtiOCLf4BgHwCmxVQFPT4rdRZyzCIfI@z \
    --to=bahamas10@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).