Signed-off-by: Andreas Zuber <zu...@puzzle.ch>
---
Local-branch: ticket/master/6988
ext/packaging/redhat/puppet-dashboard.logrotate | 10 ++++++++++
ext/packaging/redhat/puppet-dashboard.spec | 1 +
2 files changed, 11 insertions(+), 0 deletions(-)
create mode 100644 ext/packaging/redhat/puppet-dashboard.logrotate
diff --git a/ext/packaging/redhat/puppet-dashboard.logrotate b/ext/packaging/redhat/puppet-dashboard.logrotate
new file mode 100644
index 0000000..dc3cf18
--- /dev/null
+++ b/ext/packaging/redhat/puppet-dashboard.logrotate
@@ -0,0 +1,10 @@
+# Rotate puppet-dashboard logs
+/usr/share/puppet-dashboard/log/*.log {
+ daily
+ missingok
+ rotate 7
+ compress
+ delaycompress
+ notifempty
+ copytruncate
+}
diff --git a/ext/packaging/redhat/puppet-dashboard.spec b/ext/packaging/redhat/puppet-dashboard.spec
index 2a311db..7b3d7be 100644
--- a/ext/packaging/redhat/puppet-dashboard.spec
+++ b/ext/packaging/redhat/puppet-dashboard.spec
@@ -52,6 +52,7 @@ install -Dp -m0644 VERSION $RPM_BUILD_ROOT/%{_datadir}/%{name}/VERSION
# Add sysconfig and init script
install -Dp -m0755 %{confdir}/%{name}.init $RPM_BUILD_ROOT/%{initrddir}/puppet-dashboard
install -Dp -m0644 %{confdir}/%{name}.sysconfig $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/puppet-dashboard
+install -Dp -m0644 %{confdir}/%{name}.logrotate $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/puppet-dashboard
cp -p -r vendor $RPM_BUILD_ROOT/%{_datadir}/%{name}/
--
1.7.3.4
Hi
> +install -Dp -m0644 %{confdir}/%{name}.logrotate
$RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/puppet-dashboard
you should prefix that with the creation of logrotate.d (as usual in
RedHat based spec files deploying logrotate files). So this should look
like:
# install log rotation stuff
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
install -Dp -m0644 %{confdir}/%{name}.logrotate
$RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/puppet-dashboard
Otherwise +1
~pete
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk2dlzMACgkQbwltcAfKi38xywCfWdvdJM54FopikRSbPYtljHPk
AT8An1JuExlCM5+5HFxzbBLSZrqwdi1k
=u/0Y
-----END PGP SIGNATURE-----
Right, otherwise the dir won't exist in the $RPM_BUILD_ROOT and the
install will fail.
R.
Except that it uses the -D option, so it should be alright. From
install(1):
-D create all leading components of DEST except the last, then
copy SOURCE to DEST
--
Todd OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It's always darkest just before it goes pitch black.
-- Demotivators (www.despair.com)
> Except that it uses the -D option, so it should be alright. From
> install(1):
>
> -D create all leading components of DEST except the last, then
> copy SOURCE to DEST
all right, good catch. :)
~pete
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk2e2awACgkQbwltcAfKi3+0uwCePjGNcednyOB8QT26O2HQKKar
354AoKswEoqUyKk3Y4Pd/1F21BX1Hwlo
=7S7o
-----END PGP SIGNATURE-----