Send daemon logs to a dedicated file and add logrotate templates

tags/0.0.1
Daniel Berteaud 12 years ago
parent d1369db297
commit a99711dd02
  1. 1
      createlinks
  2. 2
      root/etc/e-smith/templates/etc/fail2ban/fail2ban.conf/10All
  3. 8
      root/etc/e-smith/templates/etc/logrotate.d/fail2ban/10All
  4. 4
      smeserver-fail2ban.spec

@ -5,6 +5,7 @@ use esmith::Build::CreateLinks qw(:all);
templates2events("/etc/rc.d/init.d/masq", "fail2ban-update");
templates2events("/etc/fail2ban/jail.conf", "fail2ban-conf");
templates2events("/etc/fail2ban/fail2ban.conf", "fail2ban-conf");
templates2events("/etc/logrotate.d/fail2ban", "fail2ban-conf");
safe_symlink("adjust", "root/etc/e-smith/events/fail2ban-update/services2adjust/masq");
safe_symlink("restart", "root/etc/e-smith/events/fail2ban-conf/services2adjust/fail2ban");

@ -1,4 +1,4 @@
[Definition]
loglevel = 3
logtarget = STDOUT
logtarget = /var/log/fail2ban/daemon.log
socket = /var/run/fail2ban/fail2ban.sock

@ -0,0 +1,8 @@
/var/log/fail2ban/*.log \{
missingok
weekly
rotate 24
compress
notifempty
copytruncate
\}

@ -37,9 +37,7 @@ perl createlinks
(cd root ; /usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT)
/bin/rm -f %{name}-%{version}-filelist
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \
--file /var/service/fail2ban/run 'attr(0755,root,root)' \
--file /var/service/fail2ban/log/run 'attr(0755,root,root)' \
--dir /var/log/fail2ban 'attr(0750,smelog,smelog)' \
--dir /var/log/fail2ban 'attr(0750,root,root)' \
> %{name}-%{version}-filelist
%files -f %{name}-%{version}-filelist

Loading…
Cancel
Save