Hello community,

here is the log from the commit of package logrotate for openSUSE:Factory 
checked in at 2014-04-04 16:32:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/logrotate (Old)
 and      /work/SRC/openSUSE:Factory/.logrotate.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "logrotate"

Changes:
--------
--- /work/SRC/openSUSE:Factory/logrotate/logrotate.changes      2013-11-14 
10:40:31.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.logrotate.new/logrotate.changes 2014-04-04 
16:32:07.000000000 +0200
@@ -1,0 +2,19 @@
+Thu Apr  3 14:10:21 UTC 2014 - [email protected]
+
+- BuildRequire systemd 197 or later.
+
+-------------------------------------------------------------------
+Wed Apr  2 22:45:56 UTC 2014 - [email protected]
+
+- Migrate from cron to systemd timer units, this is overall 
+  the most important package to migrate since it is one 
+  of the very few base components that hard-require cron.
+
+-------------------------------------------------------------------
+Tue Apr  1 15:11:22 UTC 2014 - [email protected]
+
+- return error when nomissingok is specified and the log path
+  doesn't exist (bnc#871217)
+  * added logrotate-fail_if_ENOENT_and_nomissingok.patch
+
+-------------------------------------------------------------------

New:
----
  logrotate-fail_if_ENOENT_and_nomissingok.patch
  logrotate.service
  logrotate.timer

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ logrotate.spec ++++++
--- /var/tmp/diff_new_pack.2g27N6/_old  2014-04-04 16:32:08.000000000 +0200
+++ /var/tmp/diff_new_pack.2g27N6/_new  2014-04-04 16:32:08.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package logrotate
 #
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -26,22 +26,26 @@
 Group:          System/Base
 Source:         
https://fedorahosted.org/releases/l/o/%{name}/%{name}-%{version}.tar.gz
 Source100:      %{name}-rpmlintrc
+Source101:      %{name}.service
+Source102:      %{name}.timer
 Patch0:         logrotate-3.7.8-suse.patch
 Patch1:         logrotate-3.7.8-conf.patch
 Patch2:         logrotate-3.7.8-autoext.patch
 Patch3:         logrotate-3.7.8-addextension.patch
 Patch4:         logrotate-3.7.8-mess_err.patch
 Patch5:         logrotate-manpage_config_clarification.patch
+Patch6:         logrotate-fail_if_ENOENT_and_nomissingok.patch
 BuildRequires:  acl
 BuildRequires:  libacl-devel
 BuildRequires:  libselinux-devel
 BuildRequires:  popt-devel
+BuildRequires:  pkgconfig(systemd) >= 197
 PreReq:         %fillup_prereq
 PreReq:         /bin/mv
 PreReq:         /bin/rm
-Requires:       cron
 Requires:       xz
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
+%{?systemd_requires}
 
 %description
 The logrotate utility is designed to simplify the administration of log
@@ -59,6 +63,7 @@
 %patch3
 %patch4
 %patch5 -p1
+%patch6 -p1
 
 %build
 make %{?_smp_mflags} CC="%__cc" RPM_OPT_FLAGS="%{optflags}" \
@@ -73,8 +78,13 @@
 mkdir -p %{buildroot}%{_sysconfdir}/{logrotate.d,cron.daily}
 mkdir -p %{buildroot}%{_prefix}/sbin
 install -m 644 examples/logrotate-default 
%{buildroot}%{_sysconfdir}/logrotate.conf
-install -m 755 examples/logrotate.cron 
%{buildroot}%{_sysconfdir}/cron.daily/logrotate
 install -m 644 examples/logrotate.wtmp 
%{buildroot}%{_sysconfdir}/logrotate.d/wtmp
+install -D -m 0644 %{S:101} %{buildroot}%{_unitdir}/%{name}.service
+install -D -m 0644 %{S:102} %{buildroot}%{_unitdir}/%{name}.timer
+
+%pre
+#only the timer can be enabled/disabled/masked !
+%service_add_pre %{name}.service %{name}.timer
 
 %post
 %{remove_and_set MAX_DAYS_FOR_LOG_FILES}
@@ -83,6 +93,14 @@
    mv -v /etc/logrotate.d/aaa_base /etc/logrotate.d.aaa_base.save
 fi
 
+%service_add_post %{name}.service %{name}.timer
+
+%preun
+%service_del_preun %{name}.service %{name}.timer
+
+%postun
+%service_del_postun %{name}.service %{name}.timer
+
 %clean
 rm -rf %{buildroot}
 
@@ -92,8 +110,9 @@
 %{_sbindir}/logrotate
 %{_mandir}/man8/logrotate.8*
 %{_mandir}/man5/logrotate.conf.5*
-%{_sysconfdir}/cron.daily/logrotate
 %config %{_sysconfdir}/logrotate.conf
 %config(noreplace)/etc/logrotate.d/wtmp
+%{_unitdir}/%{name}.service
+%{_unitdir}/%{name}.timer
 
 %changelog

++++++ logrotate-fail_if_ENOENT_and_nomissingok.patch ++++++
Index: logrotate-3.8.7/logrotate.c
===================================================================
--- logrotate-3.8.7.orig/logrotate.c    2014-04-01 18:39:14.294635014 +0200
+++ logrotate-3.8.7/logrotate.c 2014-04-01 18:40:29.613496763 +0200
@@ -795,8 +795,9 @@ int findNeedRotating(struct logInfo *log
                char *ld = ourDirName(log->files[logNum]);
                if (stat(ld, &sb)) {
                        /* If parent directory doesn't exist, it's not real 
error
+                         (unless nomissingok is specified)
                          and rotation is not needed */
-                       if (errno != ENOENT) {
+                       if (errno != ENOENT || (errno == ENOENT && (log->flags 
& LOG_FLAG_MISSINGOK) == 0)) {
                                message(MESS_ERROR, "stat of %s failed: %s\n", 
ld,
                                        strerror(errno));
                                free(ld);
++++++ logrotate.service ++++++
[Unit]
Description=Rotate log files
Documentation=man:logrotate(8) man:logrotate.conf(5)

[Service]
Type=oneshot
ExecStart=/usr/sbin/logrotate /etc/logrotate.conf
Nice=19
IOSchedulingClass=best-effort
IOSchedulingPriority=7
++++++ logrotate.timer ++++++
[Unit]
Description=Daily rotation of log files
Documentation=man:logrotate(8) man:logrotate.conf(5)

[Timer]
OnCalendar=daily
AccuracySec=12h
Persistent=true

[Install]
WantedBy=timers.target--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to