daemon: Add a logrotate configuration file.

This commit is contained in:
Tom Goff 2015-12-29 13:50:28 -05:00
parent 52e75bea3b
commit 18039a2564
4 changed files with 28 additions and 1 deletions

View file

@ -75,6 +75,9 @@ EXAMPLE_SERVICES_FILES = \
coreexservicesdir = $(coreexdir)/services coreexservicesdir = $(coreexdir)/services
dist_coreexservices_DATA= $(EXAMPLE_SERVICES_FILES) dist_coreexservices_DATA= $(EXAMPLE_SERVICES_FILES)
LOGROTATE_DIR = $(sysconfdir)/logrotate.d
LOGROTATE_FILE = data/core-daemon.logrotate
# Python package build # Python package build
noinst_SCRIPTS = build noinst_SCRIPTS = build
build: build:
@ -84,6 +87,14 @@ build:
install-exec-hook: install-exec-hook:
$(PYTHON) $(SETUPPY) $(SETUPPYFLAGS) install --prefix=${DESTDIR}/${pyprefix} --install-purelib=${DESTDIR}/${pythondir} --install-platlib=${DESTDIR}/${pyexecdir} --no-compile $(PYTHON) $(SETUPPY) $(SETUPPYFLAGS) install --prefix=${DESTDIR}/${pyprefix} --install-purelib=${DESTDIR}/${pythondir} --install-platlib=${DESTDIR}/${pyexecdir} --no-compile
install-data-local:
$(MKDIR_P) $(DESTDIR)$(LOGROTATE_DIR)
$(INSTALL_DATA) $(LOGROTATE_FILE) \
$(DESTDIR)$(LOGROTATE_DIR)/`basename $(LOGROTATE_FILE) .logrotate`
uninstall-local:
rm -f $(DESTDIR)$(LOGROTATE_DIR)/`basename $(LOGROTATE_FILE) .logrotate`
# Python package uninstall # Python package uninstall
uninstall-hook: uninstall-hook:
rm -f ${pythondir}/core_python-${COREDPY_VERSION}-py${PYTHON_VERSION}.egg-info rm -f ${pythondir}/core_python-${COREDPY_VERSION}-py${PYTHON_VERSION}.egg-info
@ -94,6 +105,7 @@ uninstall-hook:
rmdir -p $(coreexmyservicesdir) || true rmdir -p $(coreexmyservicesdir) || true
rmdir -p $(coreexdir) || true rmdir -p $(coreexdir) || true
rmdir -p $(coreconfdir) || true rmdir -p $(coreconfdir) || true
rmdir -p $(LOGROTATE_DIR) || true
# Python package cleanup # Python package cleanup
clean-local: clean-local:
@ -112,4 +124,4 @@ DISTCLEANFILES = Makefile.in core/*.pyc MANIFEST doc/Makefile.in doc/Makefile \
doc/conf.py core/addons/*.pyc doc/conf.py core/addons/*.pyc
# files to include with distribution tarball # files to include with distribution tarball
EXTRA_DIST = $(SETUPPY) MANIFEST.in CORE.e4p core doc EXTRA_DIST = $(SETUPPY) MANIFEST.in CORE.e4p core doc $(LOGROTATE_FILE)

View file

@ -0,0 +1,13 @@
/var/log/core-daemon.log {
rotate 7
daily
missingok
notifempty
compress
sharedscripts
postrotate
if [ -r /var/run/core-daemon.pid ]; then
kill -USR1 $(cat /var/run/core-daemon.pid) > /dev/null 2>&1
fi
endscript
}

View file

@ -20,3 +20,4 @@
# ATpythondirAT is expanding to ${prefix}/lib/python2.7/dist-packages # ATpythondirAT is expanding to ${prefix}/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages /usr/lib/python2.7/dist-packages
/etc/init.d /etc/init.d
/etc/logrotate.d

View file

@ -302,6 +302,7 @@ sed -i 's/emane_realtime = True/emane_realtime = False/' /etc/core/core.conf
%doc %{_mandir}/man1/netns.1.gz %doc %{_mandir}/man1/netns.1.gz
%doc %{_mandir}/man1/vcmd.1.gz %doc %{_mandir}/man1/vcmd.1.gz
%doc %{_mandir}/man1/vnoded.1.gz %doc %{_mandir}/man1/vnoded.1.gz
/etc/logrotate.d/core-daemon
/etc/systemd/system/core-daemon.service /etc/systemd/system/core-daemon.service
%{python_sitearch}/core_python_netns-1.0-py%{python_version}.egg-info %{python_sitearch}/core_python_netns-1.0-py%{python_version}.egg-info
%{python_sitearch}/netns.so %{python_sitearch}/netns.so