Commit 76e87f97 authored by Geoff Simmons's avatar Geoff Simmons

RPM installs a logrotate config for the Kafka plugin log.

This requires a user who can write in /var/log. So we now create
user/group trackrdrd at pre-install, and the default config runs
with that user for the child process.
parent bf0efdab
Pipeline #383 skipped
......@@ -13,6 +13,9 @@ mq.config_file = /etc/trackrdr-kafka.conf
# PID file for the management process
pid.file = /var/run/trackrdrd.pid
# Owner of the child process, default nobody
user = trackrdrd
# Varnish instance name, as used in the -n CLI option for varnishd
# and other Varnish binaries
# The config may specify only one of varnish.name or varnish.bindump
......@@ -29,9 +32,6 @@ pid.file = /var/run/trackrdrd.pid
# 'local7'
# syslog.facility = local0
# Owner of the child process
# user = nobody
# How often the management process restarts the worker process after
# abnormal termination
# restarts = 1
......
......@@ -8,6 +8,7 @@
# - trackrdrd tarball (trackrdrd-$VERSION.tar.gz)
# - RPM spec file (trackrdrd.spec)
# - systemd unit file (trackrdrd.service)
# - logrotate config for the Kafka plugin (trackrdr-kafka.logrotate)
# - yum repo config for varnish5@packagecloud (varnishcache_varnish5.repo)
# (see https://packagecloud.io/varnishcache/varnish5/install#manual-rpm)
......@@ -23,6 +24,7 @@ mkdir -p rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
cp /srv/trackrdrd.spec rpmbuild/SPECS
cp /srv/trackrdrd-*.tar.gz rpmbuild/SOURCES
cp /srv/trackrdrd.service rpmbuild/SOURCES
cp /srv/trackrdr-kafka.logrotate rpmbuild/SOURCES
# install epel7 repo
sudo rpm -Uvh \
......
# Log of the tracking reader's Kafka messaging plugin
/var/log/trackrdrd/libtrackrdr-kafka.log {
hourly
size 100M
rotate 5
compress
dateext
notifempty
missingok
copytruncate
}
......@@ -8,14 +8,7 @@ Group: System Environment/Daemons
URL: https://code.uplex.de/uplex-varnish/trackrdrd
Source0: %{name}-%{version}.tar.gz
Source1: trackrdrd.service
#Source2: varnish.sysconfig
#Source3: varnish.logrotate
#Source4: varnish_reload_vcl
#Source5: varnish.params
#Source6: varnish.service
#Source9: varnishncsa.initrc
#Source10: varnishncsa.service
#Source11: find-provides
Source2: trackrdr-kafka.logrotate
# varnish from varnish5 at packagecloud
# zookeeper-native from cloudera-cdh5.repo
......@@ -24,6 +17,7 @@ Requires: librdkafka
Requires: zookeeper-native
Requires: zlib
Requires: pcre
Requires: logrotate
BuildRequires: varnish-devel >= 5.2.0
BuildRequires: pkgconfig
......@@ -84,6 +78,13 @@ chmod o+w %{_builddir}/%{name}-%{version}/src/test
make check
chmod o-w %{_builddir}/%{name}-%{version}/src/test
%pre
getent group trackrdrd >/dev/null || groupadd -r trackrdrd
getent passwd trackrdrd >/dev/null || \
useradd -r -g trackrdrd -s /sbin/nologin \
-c "Tracking Log Reader" trackrdrd
exit 0
%install
make install DESTDIR=%{buildroot}
......@@ -93,6 +94,9 @@ install -D -m 0644 etc/trackrdr-kafka.conf %{buildroot}%{_sysconfdir}/trackrdr-k
install -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/trackrdrd.service
mkdir -p %{buildroot}/var/log/trackrdrd
install -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/trackrdr-kafka
# None of these for fedora/epel
find %{buildroot}/%{_libdir}/ -name '*.la' -exec rm -f {} ';'
find %{buildroot}/%{_libdir}/ -name '*.a' -exec rm -f {} ';'
......@@ -104,12 +108,18 @@ rm -rf %{buildroot}
%defattr(-,root,root,-)
%{_bindir}/*
%{_libdir}/*
%{_var}/log/trackrdrd
%{_mandir}/man3/*.3*
%doc README.rst
#%license LICENSE
%config(noreplace) %{_sysconfdir}/trackrdrd.conf
%config(noreplace) %{_sysconfdir}/trackrdr-kafka.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/trackrdr-kafka
%{_unitdir}/trackrdrd.service
%post
chown trackrdrd:trackrdrd /var/log/trackrdrd
/sbin/ldconfig
%changelog
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment