diff options
Diffstat (limited to 'app-admin/logcheck')
-rw-r--r-- | app-admin/logcheck/Manifest | 7 | ||||
-rw-r--r-- | app-admin/logcheck/files/logcheck.cron | 11 | ||||
-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.4.3.ebuild | 86 | ||||
-rw-r--r-- | app-admin/logcheck/metadata.xml | 36 |
7 files changed, 161 insertions, 0 deletions
diff --git a/app-admin/logcheck/Manifest b/app-admin/logcheck/Manifest new file mode 100644 index 000000000000..dab2f810bd62 --- /dev/null +++ b/app-admin/logcheck/Manifest @@ -0,0 +1,7 @@ +AUX logcheck.cron 334 BLAKE2B d7c2fbaf80f841af46080d0855d64ac3bcf649930cd8e715d02109b35022326c3a0ce6c966c0d406163324a7abe51c7b3a1b9701136d8bd83889d9b040608a7b SHA512 9e8b70d3c0e04e060af08d1c1497930d56fe0044b0bfbceeeb0a5b43e14d9bbd5e737591a2d47a1993f0430a2533ba3e3e49167922151e89d6e3f4b74f13ca15 +AUX logcheck.service 210 BLAKE2B 9a523099c54580b141b17933bb833f386ed49ed5534374db6ceb6dd1d50762a4b1beb598f5e8674da4574e69504a46aee7f889196510aeaf46b3e7a1c38f6b33 SHA512 4590ed0d08b2fd695382a9236f186de07216013ed7e1be1a417d3c4ea59180b840d8bf5cba7ea321d61ffe7254699213ec13aabb6426bcd320dc9890c7d824f2 +AUX logcheck.timer 140 BLAKE2B eef8f5fb279b417c4ecbbd849a4e01aabf77744deab5fdd574cab6728b8d09046f38f269486e2119bc151b5ace042fce9917f216d30960df92aeee5fb875b48d SHA512 3b1eb31ea97c12021c562813ae94d595f56699ca26d47b04cd0b4ccd67afd17fe977d34958e66a21da69416d24900c4be292a175a66f68f65bba134e7bec21d7 +AUX logcheck.tmpfiles 72 BLAKE2B 025613bfed9705108c89566cb298ea4ae9754bc8c3d34d5aded2fad7fb74c20d437bb1e83cc4aa6f816a8e0035fab26ec6a307922cd1852b6f45af3c2d6c0b21 SHA512 738ae50af504709931fe7e4bdbf4024f095e489bd674d83a63565a07eea4f13945ff8d303d432eb891a1af74ed3711e88e0fce06d846de49e8c1eb7f4911f31d +DIST logcheck-1.4.3.tar.gz 168176 BLAKE2B f319a644afa0de5533e37b288456f35bdc47daa6c76c413dc916d05f162b24467f70d73bba97eb9cdbc162973e9495daa48263d9f04a2f0151f7ddc5b66a6a37 SHA512 c853493d693dd44f477561596be4de1ad74c4b4380f83f86d6204e0de59c7edccdc4c8d6ec53a96f6eefa4d1995910e9e395c7573b0e2ee8f75d632abb104e09 +EBUILD logcheck-1.4.3.ebuild 2067 BLAKE2B 82788f30eafcd4f7767287e9377fdb8d4f5ce0919a99456ad0199a1ef033590a3c3f5d6d117de7cedcb4ead2c3ebc4c181349c051aa6267662c232a73de96fbe SHA512 18313564d3371e97abfb18254e2d6b39857a19bfe8e6f5ab071e4815baf64687179285d4e0e31d004db946d94d23fdd812033d565e0c16f4ffd74fa08525d693 +MISC metadata.xml 1473 BLAKE2B 2604b73278294910db47dbf0731553125548286e2dd82bc3d733564a67f6fef6d522d2ad0be50104778d09fc20751dcc1532fd929157e23d409b999df376084e SHA512 b25aaaf6aedddf70c9d3c098f72f50b5beca2d7e1044627b76d762df69c4b0494b2e72c8a5647323afcbc0abbac8478331004808841d5d42590bb0657d1d732b diff --git a/app-admin/logcheck/files/logcheck.cron b/app-admin/logcheck/files/logcheck.cron new file mode 100644 index 000000000000..091e1bd895b7 --- /dev/null +++ b/app-admin/logcheck/files/logcheck.cron @@ -0,0 +1,11 @@ +#!/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 +sudo -u logcheck nice -n10 /usr/sbin/logcheck 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.4.3.ebuild b/app-admin/logcheck/logcheck-1.4.3.ebuild new file mode 100644 index 000000000000..2465085e8381 --- /dev/null +++ b/app-admin/logcheck/logcheck-1.4.3.ebuild @@ -0,0 +1,86 @@ +# Copyright 1999-2023 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 +" + +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 + + # 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 +} + +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/metadata.xml b/app-admin/logcheck/metadata.xml new file mode 100644 index 000000000000..4ef48a7a9e21 --- /dev/null +++ b/app-admin/logcheck/metadata.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <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> |