From 8dce6794495e734990897619806aac5fefe8c6d0 Mon Sep 17 00:00:00 2001 From: Thomas Deutschmann Date: Thu, 4 Feb 2021 20:39:03 +0100 Subject: app-admin/rsyslog: add systemd unit Upstream has stopped providing a default unit file since v8.2008.0. Link 1: https://github.com/rsyslog/rsyslog/commit/cfd07503ba055100a84d75d1a78a5c6cceb9fdab Bug: https://bugs.gentoo.org/740262 Package-Manager: Portage-3.0.14, Repoman-3.0.2 Signed-off-by: Thomas Deutschmann --- app-admin/rsyslog/files/rsyslog.service | 20 ++ app-admin/rsyslog/rsyslog-8.2012.0-r1.ebuild | 483 +++++++++++++++++++++++++++ 2 files changed, 503 insertions(+) create mode 100644 app-admin/rsyslog/files/rsyslog.service create mode 100644 app-admin/rsyslog/rsyslog-8.2012.0-r1.ebuild (limited to 'app-admin/rsyslog') diff --git a/app-admin/rsyslog/files/rsyslog.service b/app-admin/rsyslog/files/rsyslog.service new file mode 100644 index 000000000000..c64a9ea122a5 --- /dev/null +++ b/app-admin/rsyslog/files/rsyslog.service @@ -0,0 +1,20 @@ +[Unit] +Description=System Logging Service +Requires=syslog.socket +Documentation=man:rsyslogd(8) +Documentation=man:rsyslog.conf(5) +Documentation=https://www.rsyslog.com/doc/ + +[Service] +Type=notify +ExecStart=/usr/sbin/rsyslogd -n -iNONE +StandardOutput=null +Restart=on-failure + +# Increase the default a bit in order to allow many simultaneous +# files to be monitored, we might need a lot of fds. +LimitNOFILE=16384 + +[Install] +WantedBy=multi-user.target +Alias=syslog.service diff --git a/app-admin/rsyslog/rsyslog-8.2012.0-r1.ebuild b/app-admin/rsyslog/rsyslog-8.2012.0-r1.ebuild new file mode 100644 index 000000000000..52cb79ec9ae0 --- /dev/null +++ b/app-admin/rsyslog/rsyslog-8.2012.0-r1.ebuild @@ -0,0 +1,483 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="7" +PYTHON_COMPAT=( python3_{7..9} ) + +inherit autotools linux-info python-any-r1 systemd + +DESCRIPTION="An enhanced multi-threaded syslogd with database support and more" +HOMEPAGE="https://www.rsyslog.com/" + +if [[ ${PV} == "9999" ]]; then + EGIT_REPO_URI="https://github.com/rsyslog/${PN}.git" + + DOC_REPO_URI="https://github.com/rsyslog/${PN}-doc.git" + + inherit git-r3 +else + KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~x86" + + SRC_URI=" + https://www.rsyslog.com/files/download/${PN}/${P}.tar.gz + doc? ( https://www.rsyslog.com/files/download/${PN}/${PN}-doc-${PV}.tar.gz ) + " +fi + +LICENSE="GPL-3 LGPL-3 Apache-2.0" +SLOT="0" + +IUSE="clickhouse curl dbi debug doc elasticsearch +gcrypt gnutls imhttp" +IUSE+=" impcap jemalloc kafka kerberos kubernetes libressl mdblookup" +IUSE+=" mongodb mysql normalize omhttp omhttpfs omudpspoof +openssl" +IUSE+=" postgres rabbitmq redis relp rfc3195 rfc5424hmac snmp +ssl" +IUSE+=" systemd test usertools +uuid xxhash zeromq" + +RESTRICT="!test? ( test )" + +REQUIRED_USE=" + kubernetes? ( normalize ) + ssl? ( || ( gnutls openssl ) ) +" + +BDEPEND=">=sys-devel/autoconf-archive-2015.02.24 + virtual/pkgconfig + elibc_musl? ( sys-libs/queue-standalone ) + test? ( + jemalloc? ( /dev/null; then + die "certtool not found! Is net-libs/gnutls[tools] is installed?" + fi + + # Make sure the certificates directory exists + local CERTDIR="${EROOT}/etc/ssl/${PN}" + if [[ ! -d "${CERTDIR}" ]]; then + mkdir "${CERTDIR}" || die + fi + einfo "Your certificates will be stored in ${CERTDIR}" + + # Create a default CA if needed + if [[ ! -f "${CERTDIR}/${PN}_ca.cert.pem" ]]; then + einfo "No CA key and certificate found in ${CERTDIR}, creating them for you..." + certtool --generate-privkey \ + --outfile "${CERTDIR}/${PN}_ca.privkey.pem" || die + chmod 400 "${CERTDIR}/${PN}_ca.privkey.pem" + + cat > "${T}/${PF}.$$" <<- _EOF + cn = Portage automated CA + ca + cert_signing_key + expiration_days = 3650 + _EOF + + certtool --generate-self-signed \ + --load-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \ + --outfile "${CERTDIR}/${PN}_ca.cert.pem" \ + --template "${T}/${PF}.$$" || die + chmod 400 "${CERTDIR}/${PN}_ca.privkey.pem" + + # Create the server certificate + echo + einfon "Please type the Common Name of the SERVER you wish to create a certificate for: " + read -r CN + + einfo "Creating private key and certificate for server ${CN}..." + certtool --generate-privkey \ + --outfile "${CERTDIR}/${PN}_${CN}.key.pem" || die + chmod 400 "${CERTDIR}/${PN}_${CN}.key.pem" + + cat > "${T}/${PF}.$$" <<- _EOF + cn = ${CN} + tls_www_server + dns_name = ${CN} + expiration_days = 3650 + _EOF + + certtool --generate-certificate \ + --outfile "${CERTDIR}/${PN}_${CN}.cert.pem" \ + --load-privkey "${CERTDIR}/${PN}_${CN}.key.pem" \ + --load-ca-certificate "${CERTDIR}/${PN}_ca.cert.pem" \ + --load-ca-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \ + --template "${T}/${PF}.$$" &>/dev/null + chmod 400 "${CERTDIR}/${PN}_${CN}.cert.pem" + + else + einfo "Found existing ${CERTDIR}/${PN}_ca.cert.pem, skipping CA and SERVER creation." + fi + + # Create a client certificate + echo + einfon "Please type the Common Name of the CLIENT you wish to create a certificate for: " + read -r CN + + einfo "Creating private key and certificate for client ${CN}..." + certtool --generate-privkey \ + --outfile "${CERTDIR}/${PN}_${CN}.key.pem" || die + chmod 400 "${CERTDIR}/${PN}_${CN}.key.pem" + + cat > "${T}/${PF}.$$" <<- _EOF + cn = ${CN} + tls_www_client + dns_name = ${CN} + expiration_days = 3650 + _EOF + + certtool --generate-certificate \ + --outfile "${CERTDIR}/${PN}_${CN}.cert.pem" \ + --load-privkey "${CERTDIR}/${PN}_${CN}.key.pem" \ + --load-ca-certificate "${CERTDIR}/${PN}_ca.cert.pem" \ + --load-ca-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \ + --template "${T}/${PF}.$$" || die + chmod 400 "${CERTDIR}/${PN}_${CN}.cert.pem" + + rm -f "${T}/${PF}.$$" + + echo + einfo "Here is the documentation on how to encrypt your log traffic:" + einfo " https://www.rsyslog.com/doc/rsyslog_tls.html" +} -- cgit v1.2.3-65-gdbad