initial import

This commit is contained in:
2025-06-22 20:39:04 -05:00
commit f8a70886f0
3428 changed files with 302546 additions and 0 deletions

77
monit/PKGBUILD Normal file
View File

@@ -0,0 +1,77 @@
# Maintainer: Jesus E. <heckyel@riseup.net>
pkgname=monit
pkgver=5.32.0
_debver=$pkgver
_debrel=1
pkgrel=2
pkgdesc="Utility for managing and monitoring processes, files, directories and devices on a UNIX system"
arch=('i686' 'x86_64')
url='https://mmonit.com/monit/'
license=('custom:AGPL-3+OpenSSL-Linking-Exception')
depends=('libressl')
makedepends=('quilt')
backup=('etc/monit/monitrc')
source=("https://mmonit.com/$pkgname/dist/${pkgname}-${pkgver}.tar.gz"
"https://deb.debian.org/debian/pool/main/m/monit/monit_${_debver}-${_debrel}~bpo11+1.debian.tar.xz"
"fix-invalid-use-of-vfork.patch"
"fix-monitrc.patch"
"fix-webinterface.patch"
"$pkgname.initd"
"$pkgname.run")
sha512sums=('dcb56bee23c5fef4abe08a2b1633e58b60c8863b335d651d26e87f5306b4f98bd4887d2bf6311c2fc11c9b99eb853226d836b9d212ab65c0f150872c7297e005'
'83b2fbb0b3b741454fdadd02c1eb6ff162e7a1c1c989dfb6316bcfe33f55b43d58570617f542bed329dd32936271098fabfaa7411e4306814f04a875d7acf4b5'
'549fda6dc92c2630152a29f5bb94d29a59abb06300e55eb93ed729758d73ed7dceaa2e9f491c9d33419920aef24c0360f865753be28af13a11216129529611ae'
'89ea3b9405f9cbd1f6b28e2d97bc187ad32c8a8cd16d13ccfa6ecb3700272c936c5289bcba08e2b88035fe621c2b30e94cf8dfff1af94b13f8dbdf944790760f'
'e6537bb48b8ec2e52203727c7483a020c1940ee649ac5a187914da1b72c174b01b8751565f22dbc47fe8f4c068d4c795d14af3056f1e7ff221a460d4cb33a9bd'
'cd44fad84f65071e9f5f1d40c0169bae6fbe245aa106bbfe519f200971e2e7e2b868046ad2e603024d3ed264e45e98d93172f58c390aed883a729984458eb898'
'5086acb1d1171540941219da87af2cd6072281111cddc4077b4ba1a33ee83e0e161adb9b1cc426257ab647fa32580da26b41a3e33eface8e93415410031156aa')
prepare() {
cd "${srcdir}"/$pkgname-$pkgver
if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
# Debian patches
export QUILT_PATCHES=debian/patches
export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
export QUILT_DIFF_ARGS='--no-timestamps'
mv "$srcdir"/debian .
# Doesn't apply
rm -v debian/patches/010_monitrc.patch || true
rm -v debian/patches/020_enable-hurd.patch || true
quilt push -av
fi
patch -Np1 -i ${srcdir}/fix-invalid-use-of-vfork.patch
patch -Np1 -i ${srcdir}/fix-monitrc.patch
patch -Np1 -i ${srcdir}/fix-webinterface.patch
}
build() {
cd "${srcdir}"/$pkgname-$pkgver
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--without-pam
make
}
package() {
cd "${srcdir}"/$pkgname-$pkgver
make DESTDIR="${pkgdir}" install
# initial configuration and data
install -Dm700 monitrc "${pkgdir}"/etc/$pkgname/monitrc
install -d "${pkgdir}"/var/lib/$pkgname
# services
install -Dm755 "${srcdir}"/$pkgname.initd "${pkgdir}"/etc/init.d/$pkgname
install -Dm755 "${srcdir}"/$pkgname.run "${pkgdir}"/etc/sv/$pkgname/run
# license
install -Dm644 COPYING -t "${pkgdir}"/usr/share/licenses/$pkgname
}

View File

@@ -0,0 +1,15 @@
Upstream report: https://bitbucket.org/tildeslash/monit/issues/867/invalid-use-of-vfork-in-command_execute
diff --git a/libmonit/src/system/Command.c b/libmonit/src/system/Command.c
index a17fde4..2c75fe4 100644
--- a/libmonit/src/system/Command.c
+++ b/libmonit/src/system/Command.c
@@ -497,7 +497,7 @@ Process_T Command_execute(T C) {
Process_T P = _Process_new();
int descriptors = System_getDescriptorsGuarded();
_createPipes(P);
- if ((P->pid = vfork()) < 0) {
+ if ((P->pid = fork()) < 0) {
ERROR("Command: fork failed -- %s\n", System_getLastError());
Process_free(&P);
return NULL;

88
monit/fix-monitrc.patch Normal file
View File

@@ -0,0 +1,88 @@
--- a/monitrc 2022-03-23 18:43:07.000000000 +0100
+++ b/monitrc 2024-03-26 16:17:32.926620113 +0100
@@ -16,7 +16,7 @@
##
## Start Monit in the background (run as a daemon):
#
-set daemon 30 # check services at 30 seconds intervals
+set daemon 120 # check services at 120 seconds intervals
# with start delay 240 # optional: delay the first check by 4-minutes (by
# # default Monit check immediately after Monit start)
#
@@ -24,7 +24,7 @@
## Set syslog logging. If you want to log to a standalone log file instead,
## specify the full path to the log file
#
-set log syslog
+set log /var/log/monit.log
#
#
@@ -37,7 +37,7 @@
## Monit instance. The id is generated and stored on first Monit start. By
## default the file is placed in $HOME/.monit.id.
#
-# set idfile /var/.monit.id
+set idfile /var/lib/monit/id
#
## Set the location of the Monit state file which saves monitoring states
## on each cycle. By default the file is placed in $HOME/.monit.state. If
@@ -45,7 +45,7 @@
## the monitoring state across reboots. If it is on temporary filesystem, the
## state will be lost on reboot which may be convenient in some situations.
#
-# set statefile /var/.monit.state
+set statefile /var/lib/monit/state
#
#
@@ -89,25 +89,9 @@
## by using the SLOTS option (if omitted, the queue is limited by space
## available in the back end filesystem).
#
-# set eventqueue
-# basedir /var/monit # set the base directory where events will be stored
-# slots 100 # optionally limit the queue size
-#
-#
-## Send status and events to M/Monit (for more information about M/Monit
-## see https://mmonit.com/). By default Monit registers credentials with
-## M/Monit so M/Monit can smoothly communicate back to Monit and you don't
-## have to register Monit credentials manually in M/Monit. It is possible to
-## disable credential registration using the commented out option below.
-## Though, if safety is a concern we recommend instead using https when
-## communicating with M/Monit and send credentials encrypted. The password
-## should be URL encoded if it contains URL-significant characters like
-## ":", "?", "@". Default timeout is 5 seconds, you can customize it by
-## adding the timeout option.
-#
-# set mmonit http://monit:monit@192.168.1.10:8080/collector
-# # with timeout 30 seconds # Default timeout is 5 seconds
-# # and register without credentials # Don't register credentials
+ set eventqueue
+ basedir /var/lib/monit/events # set the base directory where events will be stored
+ slots 100 # optionally limit the queue size
#
#
## Monit by default uses the following format for alerts if the mail-format
@@ -154,13 +138,13 @@
## commands to a running Monit daemon. See the Monit Wiki if you want to
## enable SSL for the HTTP interface.
#
-set httpd port 2812 and
- use address localhost # only accept connection from localhost (drop if you use M/Monit)
- allow localhost # allow localhost to connect to the server and
- allow admin:monit # require user 'admin' with password 'monit'
- #with ssl { # enable SSL/TLS and set path to server certificate
- # pemfile: /etc/ssl/certs/monit.pem
- #}
+#set httpd port 2812 and
+# use address localhost # only accept connection from localhost
+# allow localhost # allow localhost to connect to the server and
+# allow admin:monit # require user 'admin' with password 'monit'
+# #with ssl { # enable SSL/TLS and set path to server certificate
+# # pemfile: /etc/ssl/certs/monit.pem
+# #}
#
## Monit can perform act differently regarding services previous state when
## going back in duty. By default, Monit will 'start' all services. Monit can

View File

@@ -0,0 +1,37 @@
--- a/src/http/cervlet.c 2022-03-23 18:43:07.000000000 +0100
+++ b/src/http/cervlet.c 2024-03-26 16:12:22.978986766 +0100
@@ -833,7 +833,7 @@
"<table id='nav' width='100%%'>"\
" <tr>"\
" <td width='20%%'><a href='.'>Home</a>&nbsp;&gt;&nbsp;<a href='%s'>%s</a></td>"\
- " <td width='60%%' style='text-align:center;'>Use <a href='https://mmonit.com/'>M/Monit</a> to manage all your Monit instances</td>"\
+ " <td width='60%%' style='text-align:center;'>&nbsp;</td>"\
" <td width='20%%'><p class='right'><a href='_about'>Monit %s</a></td>"\
" </tr>"\
"</table>"\
@@ -847,11 +847,7 @@
StringBuffer_append(res->outputbuffer,
"</center></div></div>"
"<div id='footer'>"
- "Copyright &copy; 2001-2022 <a href=\"http://tildeslash.com/\">Tildeslash</a>. All rights reserved. "
- "<span style='margin-left:5px;'></span>"
- "<a href=\"http://mmonit.com/monit/\">Monit web site</a> | "
- "<a href=\"http://mmonit.com/wiki/\">Monit Wiki</a> | "
- "<a href=\"http://mmonit.com/\">M/Monit</a>"
+ "Monitoring using Monit on Hyperbola GNU/Linux-libre"
"</div></body></html>");
}
@@ -891,12 +887,6 @@
"<br><h1><center><a href='http://mmonit.com/monit/'>"
"monit " VERSION "</a></center></h1>");
StringBuffer_append(res->outputbuffer,
- "<ul>"
- "<li style='padding-bottom:10px;'>Copyright &copy; 2001-2022 <a "
- "href='http://tildeslash.com/'>Tildeslash Ltd"
- "</a>. All Rights Reserved.</li></ul>");
- StringBuffer_append(res->outputbuffer, "<hr size='1'>");
- StringBuffer_append(res->outputbuffer,
"<p>This program is free software; you can redistribute it and/or "
"modify it under the terms of the GNU Affero General Public License version 3</p>"
"<p>This program is distributed in the hope that it will be useful, but "

35
monit/monit.initd Normal file
View File

@@ -0,0 +1,35 @@
#!/sbin/openrc-run
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
name="monit"
description="Monit service supervisor"
: ${monit_config:=${CONF:-/etc/monit/monitrc}}
command="/usr/bin/monit"
command_args="-c ${monit_config}"
pidfile="/run/${RC_SVCNAME}.pid"
extra_commands="configtest"
extra_started_commands="reload"
depend() {
use net
}
configtest() {
/usr/bin/monit -t -c "${monit_config}" 1>/dev/null 2>&1
ret=$?
if [ $ret -ne 0 ]; then
eerror "${RC_SVCNAME} has detected an error in your setup:"
/usr/bin/monit -t "${monit_config}"
fi
return $ret
}
reload() {
ebegin "Reloading monit"
$command -c "${monit_config}" reload >/dev/null 2>&1
eend $?
}

5
monit/monit.run Normal file
View File

@@ -0,0 +1,5 @@
#!/bin/sh
if [ -f /etc/monit/monitrc ]; then
CONF="-c /etc/monit/monitrc"
fi
exec monit -I ${CONF} 2>&1

9
monit/monitrc.patch Normal file
View File

@@ -0,0 +1,9 @@
--- a/monitrc 2022-11-05 02:30:22.067568680 +0100
+++ b/monitrc 2022-11-05 02:31:25.537959598 +0100
@@ -310,6 +310,4 @@
## directories.
#
# include /etc/monit.d/*
-include /etc/monit/conf.d/*
-include /etc/monit/conf-enabled/*
#