diff options
Diffstat (limited to 'app-admin/logcheck')
-rw-r--r-- | app-admin/logcheck/Manifest | 2 | ||||
-rw-r--r-- | app-admin/logcheck/files/logcheck-r4.cron | 11 | ||||
-rw-r--r-- | app-admin/logcheck/files/logcheck.cron | 15 | ||||
-rw-r--r-- | app-admin/logcheck/files/logcheck.cron.d | 1 | ||||
-rw-r--r-- | app-admin/logcheck/files/logcheck.service | 11 | ||||
-rw-r--r-- | app-admin/logcheck/files/logcheck.timer | 8 | ||||
-rw-r--r-- | app-admin/logcheck/files/logcheck.tmpfiles | 2 | ||||
-rw-r--r-- | app-admin/logcheck/logcheck-1.3.23.ebuild | 65 | ||||
-rw-r--r-- | app-admin/logcheck/logcheck-1.4.3-r2.ebuild | 95 | ||||
-rw-r--r-- | app-admin/logcheck/logcheck-1.4.3-r4.ebuild | 99 | ||||
-rw-r--r-- | app-admin/logcheck/metadata.xml | 35 |
11 files changed, 269 insertions, 75 deletions
diff --git a/app-admin/logcheck/Manifest b/app-admin/logcheck/Manifest index eac23ecf2c31..91a93a36c6bc 100644 --- a/app-admin/logcheck/Manifest +++ b/app-admin/logcheck/Manifest @@ -1 +1 @@ -DIST logcheck_1.3.23.tar.xz 133540 BLAKE2B 7eae2f34027c40d3efc272bc82179962d4a5ba8613e4e6218e9730a0ce3ff00af7e040c0550ac7414ae08191a36bb37ec0358de97367deab48b552782bc25c8e SHA512 635a96c3e0beaf6056e5b96b3bd69134c3330308452e3bcf8cc28cb36365f07806046bf498cbfaf5cfbc38a812eb2723ddf51a16304140e8f7091f1e6005ec4d +DIST logcheck-1.4.3.tar.gz 168176 BLAKE2B f319a644afa0de5533e37b288456f35bdc47daa6c76c413dc916d05f162b24467f70d73bba97eb9cdbc162973e9495daa48263d9f04a2f0151f7ddc5b66a6a37 SHA512 c853493d693dd44f477561596be4de1ad74c4b4380f83f86d6204e0de59c7edccdc4c8d6ec53a96f6eefa4d1995910e9e395c7573b0e2ee8f75d632abb104e09 diff --git a/app-admin/logcheck/files/logcheck-r4.cron b/app-admin/logcheck/files/logcheck-r4.cron new file mode 100644 index 000000000000..1a8809ffe154 --- /dev/null +++ b/app-admin/logcheck/files/logcheck-r4.cron @@ -0,0 +1,11 @@ +#!/bin/sh +# +# To enable sync via cron, execute "runuser -u logcheck touch /etc/logcheck/cron-logcheck-enabled" +if [[ ! -f /etc/logcheck/cron-logcheck-enabled ]]; then + exit +fi +if [ ! -d /var/lock/logcheck ]; then + mkdir -p /var/lock/logcheck + chown logcheck:logcheck /var/lock/logcheck +fi +/sbin/runuser -u logcheck -- nice -n10 /usr/sbin/logcheck "$@" diff --git a/app-admin/logcheck/files/logcheck.cron b/app-admin/logcheck/files/logcheck.cron index 3b3f4fcf62bd..091e1bd895b7 100644 --- a/app-admin/logcheck/files/logcheck.cron +++ b/app-admin/logcheck/files/logcheck.cron @@ -1,10 +1,11 @@ -#!/bin/bash - -set -e - +#!/bin/sh +# +# To enable sync via cron, execute "sudo -u logcheck touch /etc/logcheck/cron-logcheck-enabled" +if [[ ! -f /etc/logcheck/cron-logcheck-enabled ]]; then + exit +fi if [ ! -d /var/lock/logcheck ]; then mkdir -p /var/lock/logcheck + chown logcheck:logcheck /var/lock/logcheck fi -chown -R logcheck:logcheck /var/lock/logcheck - -su -s /bin/bash -c /usr/sbin/logcheck logcheck +sudo -u logcheck nice -n10 /usr/sbin/logcheck diff --git a/app-admin/logcheck/files/logcheck.cron.d b/app-admin/logcheck/files/logcheck.cron.d new file mode 100644 index 000000000000..bd95c1a95b5c --- /dev/null +++ b/app-admin/logcheck/files/logcheck.cron.d @@ -0,0 +1 @@ +@reboot sleep 60; /etc/cron.hourly/logcheck -R diff --git a/app-admin/logcheck/files/logcheck.service b/app-admin/logcheck/files/logcheck.service new file mode 100644 index 000000000000..8d5cd4ac467c --- /dev/null +++ b/app-admin/logcheck/files/logcheck.service @@ -0,0 +1,11 @@ +[Unit] +Description=Mails anomalies in the system logfiles to the administrator + +[Service] +Type=oneshot +ExecStart=/usr/sbin/logcheck +SyslogIdentifier=logcheck +User=logcheck + +[Install] +WantedBy=multi-user.target diff --git a/app-admin/logcheck/files/logcheck.timer b/app-admin/logcheck/files/logcheck.timer new file mode 100644 index 000000000000..db5fc229a16e --- /dev/null +++ b/app-admin/logcheck/files/logcheck.timer @@ -0,0 +1,8 @@ +[Unit] +Description=Mails anomalies in the system logfiles to the administrator + +[Timer] +OnCalendar=hourly + +[Install] +WantedBy=timers.target diff --git a/app-admin/logcheck/files/logcheck.tmpfiles b/app-admin/logcheck/files/logcheck.tmpfiles new file mode 100644 index 000000000000..7d358900103a --- /dev/null +++ b/app-admin/logcheck/files/logcheck.tmpfiles @@ -0,0 +1,2 @@ +# logcheck lock directory +d /var/lock/logcheck 0755 logcheck logcheck - diff --git a/app-admin/logcheck/logcheck-1.3.23.ebuild b/app-admin/logcheck/logcheck-1.3.23.ebuild deleted file mode 100644 index b278d75e832a..000000000000 --- a/app-admin/logcheck/logcheck-1.3.23.ebuild +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 -inherit readme.gentoo-r1 - -DESCRIPTION="Mails anomalies in the system logfiles to the administrator" -HOMEPAGE="https://packages.debian.org/sid/logcheck" -SRC_URI="mirror://debian/pool/main/l/${PN}/${PN}_${PV}.tar.xz" -S="${WORKDIR}/${PN}" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="amd64 ~ppc ~sparc x86" - -DEPEND=" - acct-group/logcheck - acct-user/logcheck -" - -RDEPEND=" - ${DEPEND} - !app-admin/logsentry - app-misc/lockfile-progs - dev-lang/perl - dev-perl/mime-construct - virtual/mailx -" - -DOC_CONTENTS=" - Please read the guide at https://wiki.gentoo.org/wiki/Logcheck - for installation instructions. -" - -src_prepare() { - default - - # Add /var/log/messages support, bug #531524 - echo "/var/log/messages" >> etc/logcheck.logfiles -} - -src_install() { - default - - # Do not install /var/lock, bug #449968 . Use rmdir to make sure - # the directories removed are empty. - rmdir "${ED}/var/lock/logcheck" || die - rmdir "${ED}/var/lock" || die - - keepdir /var/lib/logcheck - - dodoc docs/README.* - doman docs/logtail.8 docs/logtail2.8 - - exeinto /etc/cron.hourly - doexe "${FILESDIR}"/logcheck.cron - - readme.gentoo_create_doc -} - -pkg_postinst() { - chown -R logcheck:logcheck /etc/logcheck /var/lib/logcheck || die - - readme.gentoo_print_elog -} diff --git a/app-admin/logcheck/logcheck-1.4.3-r2.ebuild b/app-admin/logcheck/logcheck-1.4.3-r2.ebuild new file mode 100644 index 000000000000..951cee59aaa5 --- /dev/null +++ b/app-admin/logcheck/logcheck-1.4.3-r2.ebuild @@ -0,0 +1,95 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit readme.gentoo-r1 systemd tmpfiles + +DESCRIPTION="Mails anomalies in the system logfiles to the administrator" +HOMEPAGE="https://logcheck.org/" +SRC_URI="https://salsa.debian.org/debian/logcheck/-/archive/debian/${PV}/logcheck-debian-${PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/${PN}-debian-${PV}" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 ~ppc ~sparc ~x86" +IUSE="cron systemd" +# Test (emake system-test) requires access to system logs +RESTRICT="test" + +DEPEND=" + acct-group/logcheck + acct-user/logcheck[systemd?] +" + +RDEPEND=" + ${DEPEND} + !app-admin/logsentry + app-misc/lockfile-progs + dev-lang/perl + dev-perl/mime-construct + virtual/mailx + cron? ( app-admin/sudo ) +" + +DOC_CONTENTS=" + Please read the guide at https://wiki.gentoo.org/wiki/Logcheck + for installation instructions. +" + +src_prepare() { + default + # Set version from PV, without using dpkg + sed -i -e "s/^VERSION=unknown/VERSION=\"${PV}\"/" "${S}/src/logcheck" || die + + # QA-fix remove call to non existent command | Bug: #911281 + sed -i "/dpkg-parsechangelog/d" "${S}/Makefile" || die + + # Add /var/log/messages to checked logs + echo "/var/log/messages" >> "${S}/etc/logcheck.logfiles.d/syslog.logfiles" || die + + # QA-fix Remove install of empty dirs to be created at runtime + sed -i "/install -d \$(DESTDIR)\/var\/lock\/logcheck/d" "${S}/Makefile" || die + + # Comment systemd journal check if systemd use flag is not set | Bug: #913857 + if ! use systemd; then + sed -i -e "s/^journal/#journal/" "${S}/etc/logcheck.logfiles.d/journal.logfiles" || die + fi +} + +src_install() { + default + + keepdir /var/lib/logcheck + + dodoc docs/README.* + doman docs/logtail.8 docs/logtail2.8 + + if use cron; then + exeinto /etc/cron.hourly + newexe "${FILESDIR}"/${PN}.cron ${PN} + DOC_CONTENTS="${DOC_CONTENTS}\n + \n + Read /etc/cron.hourly/logcheck.cron to activate hourly cron-based check!" + fi + + if use systemd; then + DOC_CONTENTS="${DOC_CONTENTS}\n + \n + To enable the systemd timer, run the following command:\n + systemctl enable --now logcheck.timer" + fi + + systemd_dounit "${FILESDIR}/${PN}."{service,timer} + newtmpfiles "${FILESDIR}/logcheck.tmpfiles" logcheck.conf + + readme.gentoo_create_doc + + fowners -R logcheck:logcheck /etc/logcheck /var/lib/logcheck +} + +pkg_postinst() { + tmpfiles_process logcheck.conf + + readme.gentoo_print_elog +} diff --git a/app-admin/logcheck/logcheck-1.4.3-r4.ebuild b/app-admin/logcheck/logcheck-1.4.3-r4.ebuild new file mode 100644 index 000000000000..0cd2197b813f --- /dev/null +++ b/app-admin/logcheck/logcheck-1.4.3-r4.ebuild @@ -0,0 +1,99 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit readme.gentoo-r1 systemd tmpfiles + +DESCRIPTION="Mails anomalies in the system logfiles to the administrator" +HOMEPAGE="https://logcheck.org/" +SRC_URI="https://salsa.debian.org/debian/logcheck/-/archive/debian/${PV}/logcheck-debian-${PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/${PN}-debian-${PV}" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~sparc ~x86" +IUSE="cron systemd" +# Test (emake system-test) requires access to system logs +RESTRICT="test" + +DEPEND=" + acct-group/logcheck + acct-user/logcheck[systemd?] +" + +RDEPEND=" + ${DEPEND} + !app-admin/logsentry + app-misc/lockfile-progs + dev-lang/perl + dev-perl/mime-construct + virtual/mailx + cron? ( sys-apps/util-linux ) +" + +DOC_CONTENTS=" + Please read the guide at https://wiki.gentoo.org/wiki/Logcheck + for installation instructions. +" + +src_prepare() { + default + # Set version from PV, without using dpkg + sed -i -e "s/^VERSION=unknown/VERSION=\"${PV}\"/" "${S}/src/logcheck" || die + + # QA-fix remove call to non existent command | Bug: #911281 + sed -i "/dpkg-parsechangelog/d" "${S}/Makefile" || die + + # Add /var/log/messages to checked logs + echo "/var/log/messages" >> "${S}/etc/logcheck.logfiles.d/syslog.logfiles" || die + + # QA-fix Remove install of empty dirs to be created at runtime + sed -i "/install -d \$(DESTDIR)\/var\/lock\/logcheck/d" "${S}/Makefile" || die + + # Comment systemd journal check if systemd use flag is not set | Bug: #913857 + if ! use systemd; then + sed -i -e "s/^journal/#journal/" "${S}/etc/logcheck.logfiles.d/journal.logfiles" || die + fi +} + +src_install() { + default + + keepdir /var/lib/logcheck + + dodoc docs/README.* + doman docs/logtail.8 docs/logtail2.8 + + if use cron; then + exeinto /etc/cron.hourly + newexe "${FILESDIR}"/"${PN}"-r4.cron ${PN} + insinto /etc/cron.d + newins "${FILESDIR}"/${PN}.cron.d ${PN} + DOC_CONTENTS="${DOC_CONTENTS}\n + \n + Read /etc/cron.hourly/logcheck.cron to activate hourly cron-based check!\n + \n + To send mail after reboot you should enable the cronjob in /etc/cron.d/logcheck." + fi + + if use systemd; then + DOC_CONTENTS="${DOC_CONTENTS}\n + \n + To enable the systemd timer, run the following command:\n + systemctl enable --now logcheck.timer" + fi + + systemd_dounit "${FILESDIR}/${PN}."{service,timer} + newtmpfiles "${FILESDIR}/logcheck.tmpfiles" logcheck.conf + + readme.gentoo_create_doc + + fowners -R logcheck:logcheck /etc/logcheck /var/lib/logcheck +} + +pkg_postinst() { + tmpfiles_process logcheck.conf + + readme.gentoo_print_elog +} diff --git a/app-admin/logcheck/metadata.xml b/app-admin/logcheck/metadata.xml index 7a38bb900964..4ef48a7a9e21 100644 --- a/app-admin/logcheck/metadata.xml +++ b/app-admin/logcheck/metadata.xml @@ -1,5 +1,36 @@ <?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> - <!-- maintainer-needed --> + <maintainer type="person" proxied="yes"> + <email>foti.giuseppe@gmail.com</email> + <name>Giuseppe Foti</name> + </maintainer> + <maintainer type="project" proxied="proxy"> + <email>proxy-maint@gentoo.org</email> + <name>Proxy Maintainers</name> + </maintainer> + <longdescription lang="en"> + Logcheck is a simple utility which is designed to allow a system administrator to view the logfiles which are produced upon hosts under their control. + It does this by mailing summaries of the logfiles to them, after first filtering out "normal" entries. + Normal entries are entries which match one of the many included regular expression files contain in the database. + </longdescription> + <use> + <flag name="cron">Adds file to enable hourly cron job to run logcheck"</flag> + </use> + <upstream> + <maintainer status="active"> + <name>Mathias Gibbens</name> + <email>gibmat@debian.org</email> + </maintainer> + <maintainer status="active"> + <name>Jose M Calhariz</name> + <email>calhariz@debian.org</email> + </maintainer> + <maintainer status="active"> + <name>Debian logcheck Team</name> + <email>logcheck@packages.debian.org</email> + </maintainer> + <bugs-to>https://bugs.debian.org/logcheck</bugs-to> + <changelog>https://metadata.ftp-master.debian.org/changelogs/main/l/logcheck/unstable_changelog</changelog> + </upstream> </pkgmetadata> |