systemd support [release 3.8.8-2mamba;Fri Dec 26 2014]
This commit is contained in:
parent
92570f0b5c
commit
7e5e491592
9
logrotate.service
Normal file
9
logrotate.service
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Rotate log files
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/usr/sbin/logrotate /etc/logrotate.conf
|
||||||
|
Nice=19
|
||||||
|
IOSchedulingClass=best-effort
|
||||||
|
IOSchedulingPriority=7
|
@ -1,6 +1,6 @@
|
|||||||
Name: logrotate
|
Name: logrotate
|
||||||
Version: 3.8.8
|
Version: 3.8.8
|
||||||
Release: 1mamba
|
Release: 2mamba
|
||||||
Summary: Rotates, compresses, removes and mails system log files
|
Summary: Rotates, compresses, removes and mails system log files
|
||||||
Group: System/Tools
|
Group: System/Tools
|
||||||
Vendor: openmamba
|
Vendor: openmamba
|
||||||
@ -11,14 +11,15 @@ Source0: https://fedorahosted.org/releases/l/o/logrotate/logrotate-%{versi
|
|||||||
Source1: %{name}.conf
|
Source1: %{name}.conf
|
||||||
Source2: %{name}.cron
|
Source2: %{name}.cron
|
||||||
Source3: %{name}-init
|
Source3: %{name}-init
|
||||||
|
Source4: %{name}.timer
|
||||||
|
Source5: %{name}.service
|
||||||
License: GPL
|
License: GPL
|
||||||
## AUTOBUILDREQ-BEGIN
|
## AUTOBUILDREQ-BEGIN
|
||||||
BuildRequires: glibc-devel
|
BuildRequires: glibc-devel
|
||||||
BuildRequires: libpopt-devel
|
BuildRequires: libpopt-devel
|
||||||
BuildRequires: libselinux-devel
|
BuildRequires: libselinux-devel
|
||||||
## AUTOBUILDREQ-END
|
## AUTOBUILDREQ-END
|
||||||
Requires(pre): initscripts
|
Requires(post):systemd
|
||||||
Requires(post):chkconfig
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -40,25 +41,33 @@ Install the logrotate package if you need a utility to deal with the log files o
|
|||||||
make install PREFIX=%{buildroot} MANDIR=%{_mandir}
|
make install PREFIX=%{buildroot} MANDIR=%{_mandir}
|
||||||
|
|
||||||
install -D -m 644 %{S:1} %{buildroot}%{_sysconfdir}/logrotate.conf
|
install -D -m 644 %{S:1} %{buildroot}%{_sysconfdir}/logrotate.conf
|
||||||
install -D -m 755 %{S:2} %{buildroot}%{_sysconfdir}/cron.daily/logrotate
|
#install -D -m 755 %{S:2} %{buildroot}%{_sysconfdir}/cron.daily/logrotate
|
||||||
install -D -m 744 %{S:3} %{buildroot}%{_initrddir}/logrotate
|
#install -D -m 744 %{S:3} %{buildroot}%{_initrddir}/logrotate
|
||||||
|
install -D -m 644 %{S:4} %{buildroot}%{_unitdir}/logrotate.timer
|
||||||
|
install -D -m 644 %{S:5} %{buildroot}%{_unitdir}/logrotate.service
|
||||||
install -d %{buildroot}%{_sysconfdir}/logrotate.d/
|
install -d %{buildroot}%{_sysconfdir}/logrotate.d/
|
||||||
install -d %{buildroot}/var/lib
|
install -d %{buildroot}/var/lib
|
||||||
touch %{buildroot}/var/lib/logrotate.status
|
touch %{buildroot}/var/lib/logrotate.status
|
||||||
|
install -d %{buildroot}%{_unitdir}/multi-user.target.wants
|
||||||
|
|
||||||
%post
|
%post
|
||||||
if [ $1 -ge 1 ]; then
|
if [ $1 -ge 1 ]; then
|
||||||
# new install
|
systemctl -q daemon-reload
|
||||||
chkconfig --add logrotate
|
systemctl -q enable logrotate.timer
|
||||||
|
systemctl -q start logrotate.timer
|
||||||
fi
|
fi
|
||||||
exit 0
|
:
|
||||||
|
|
||||||
%preun
|
%postun
|
||||||
if [ $1 -eq 0 ]; then
|
if [ $1 -eq 0 ]; then
|
||||||
# erase
|
systemctl -q disable logrotate.tiemr
|
||||||
chkconfig --del logrotate
|
|
||||||
fi
|
fi
|
||||||
exit 0
|
:
|
||||||
|
|
||||||
|
%posttrans
|
||||||
|
# clean old sysv broken links
|
||||||
|
find /etc/rc[0-6].d/ -type l -xtype l -exec rm -f {} \;
|
||||||
|
:
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
|
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
|
||||||
@ -67,14 +76,17 @@ exit 0
|
|||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%{_sbindir}/logrotate
|
%{_sbindir}/logrotate
|
||||||
%dir %{_sysconfdir}/logrotate.d
|
%dir %{_sysconfdir}/logrotate.d
|
||||||
%{_sysconfdir}/cron.daily/logrotate
|
|
||||||
%config(noreplace) %{_sysconfdir}/logrotate.conf
|
%config(noreplace) %{_sysconfdir}/logrotate.conf
|
||||||
%config(noreplace) %{_localstatedir}/lib/logrotate.status
|
%config(noreplace) %{_localstatedir}/lib/logrotate.status
|
||||||
%{_initrddir}/logrotate
|
%{_unitdir}/logrotate.service
|
||||||
|
%{_unitdir}/logrotate.timer
|
||||||
%{_mandir}/man5/*
|
%{_mandir}/man5/*
|
||||||
%{_mandir}/man8/*
|
%{_mandir}/man8/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Dec 26 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 3.8.8-2mamba
|
||||||
|
- systemd support
|
||||||
|
|
||||||
* Mon Nov 03 2014 Automatic Build System <autodist@mambasoft.it> 3.8.8-1mamba
|
* Mon Nov 03 2014 Automatic Build System <autodist@mambasoft.it> 3.8.8-1mamba
|
||||||
- automatic update by autodist
|
- automatic update by autodist
|
||||||
|
|
||||||
|
11
logrotate.timer
Normal file
11
logrotate.timer
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Daily rotation of log files
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnCalendar=daily
|
||||||
|
AccuracySec=12h
|
||||||
|
Persistent=true
|
||||||
|
Unit=timer.service
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Loading…
Reference in New Issue
Block a user