Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 1355766

Summary: Logrotate rotates empty files
Product: [Fedora] Fedora Reporter: Artem S. Tashkinov <aros>
Component: logrotateAssignee: Kamil Dudka <kdudka>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 24CC: jkaluza, kdudka
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-12 19:39:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Artem S. Tashkinov 2016-07-12 13:32:06 UTC
I cannot find a single justification for that.

Please stop rotating empty log files.

Comment 1 Kamil Dudka 2016-07-12 13:56:56 UTC
Have you tried the "notifempty" configuration directive?

Comment 2 Artem S. Tashkinov 2016-07-12 14:19:05 UTC
I'm perfectly aware of this option however

1) It's not default
2) Upon system upgrade I have to keep track of changed files and apply changes found in new Fedora releases which is terribly inconvenient

Comment 3 Kamil Dudka 2016-07-12 14:32:41 UTC
(In reply to Artem S. Tashkinov from comment #2)
> I'm perfectly aware of this option however

It was not clear from the summary, neither from comment #0.

> 1) It's not default

Yes, see the documentation.

> 2) Upon system upgrade I have to keep track of changed files and apply
> changes found in new Fedora releases which is terribly inconvenient

As I understand it, it is a reason to *not* change the default.  There will be less changes you need to care about then ;-)

Comment 4 Artem S. Tashkinov 2016-07-12 14:36:06 UTC
(In reply to Kamil Dudka from comment #3)

> > 1) It's not default

> Yes, see the documentation.

It's not default in Fedora. I don't care what the documentation claims or says.

-rw-------. 1 root   root                  0 Jul 12 03:29 maillog
-rw-------. 1 root   root                  0 Jul  4 20:31 maillog-20160712
-rw-------. 1 root   root                  0 Jul 12 03:29 spooler
-rw-------. 1 root   root                  0 Jul  4 20:31 spooler-20160712
-rw-------. 1 root   root                  0 Jul 12 03:29 xferlog
-rw-------. 1 root   root                  0 Jul  4 20:31 xferlog-20160712

Comment 5 Kamil Dudka 2016-07-12 15:02:54 UTC
(In reply to Artem S. Tashkinov from comment #4)
> I don't care what the documentation claims or says.

So you don't.  But it works as documented.  There is no bug to fix actually.

Red Hat Bugzilla is not best channel to communicate such proposals.  You need to convince logrotate's community that switching the default is a good idea first.  Then it will find its way into Fedora as well as other Linux distributions.

Comment 6 Artem S. Tashkinov 2016-07-12 15:10:33 UTC
Logrotate may have their own ideas about empty log files rotation however that doesn't mean that Fedora should leave the defaults on and make the system less neat in the process.

Redhat's bugzilla is a perfect way to discuss such proposals because it's meant for normal people, not for some Unix geeks who seek dubious perfection or pursue some weird ideals.

I've never said anything about "bug" - this is just a sore that needs to be fixed.

I cannot find a single justification for rotating empty files. I can however see several shortcomings: file system degradation, files that serve no purpose, additional CPU resources spent, etc. etc. etc.

If you need a patch from me which you'll include as part of the future lograte releases, I can upload one right away.

I wonder why you're so unwilling to do something which costs almost nothing, yet provides serious benefits.

Comment 7 Kamil Dudka 2016-07-12 19:39:15 UTC
(In reply to Artem S. Tashkinov from comment #6)
> Logrotate may have their own ideas about empty log files rotation however
> that doesn't mean that Fedora should leave the defaults on and make the
> system less neat in the process.

Technically, it is possible to have different default configuration in Fedora than in other Linux distributions but there would need to be a very strong reason to diverge.  Your (IMO weak) arguments are in no way Fedora-specific.

> I cannot find a single justification for rotating empty files.

Let's put it the other way around.  Unless you have a good enough reason for changing the default (and advocate it in front of the community), there is no reason to change the default.

> I can however see several shortcomings: file system degradation

There is no problem with rotating empty log files on modern file systems.

> files that serve no purpose

There is metadata associated with empty files, which can be useful sometimes.

> additional CPU resources spent

Unlikely.  You would need to support this by some statistics.

> etc. etc. etc.

One could find similar (IMO weak) arguments for the current default.  I will not bother with that.

> If you need a patch from me which you'll include as part of the future
> lograte releases, I can upload one right away.
> 
> I wonder why you're so unwilling to do something which costs almost nothing,
> yet provides serious benefits.

It is actually the other way around.  It costs you almost nothing to change your configuration whereas changing the default would affect all other users that do not override the default.  It could surprise them for no real benefit.

Comment 8 Artem S. Tashkinov 2016-07-12 19:56:39 UTC
(In reply to Kamil Dudka from comment #7)

> Technically, it is possible to have different default configuration in Fedora than in other Linux distributions but there would need to be a very strong reason to diverge.  Your (IMO weak) arguments are in no way Fedora-specific.

Have you actually checked on other Linux distros or you're just hypothesizing?

> Let's put it the other way around.  Unless you have a good enough reason for changing the default (and advocate it in front of the community), there is no reason to change the default.

I've already given my arguments. Perhaps you need to reread my previous reply.

> There is no problem with rotating empty log files on modern file systems.

There's a problem with empty files which *serve no purpose*, increase filesystem and FS journal pressure, pollute disc space.

> One could find similar (IMO weak) arguments for the current default.  I will not bother with that

Exactly. You yourself speak for _everyone else_. It's not your distro, it's not your system, and you are nothing more than a stubborn maintainer of this package (maybe others but that's beside the point). Yet you dare speak as the ultimate voice in this matter.

> It costs you almost nothing to change your configuration whereas changing the default would affect all other users that do not override the default.

What if I have a hundred thousand systems? If I'm not mistaken Fedora currently doesn't have any configuration management tools.

Next you're gonna say: write a patch, create your own repo, use it after installation and a whole lot of other BS but I guess you're right: it's your lawn and even idiocy at your lawn is not discouraged, it's actually welcomed.

The resolution will be WONTFIX, not NOTABUG.

Comment 9 Kamil Dudka 2016-07-12 20:35:11 UTC
(In reply to Artem S. Tashkinov from comment #8)
> Have you actually checked on other Linux distros or you're just
> hypothesizing?

I am not aware of any distro defaulting to "notifempty" but the burden is on you to do the research and report possible precedences.

> Exactly. You yourself speak for _everyone else_.

I am not the one who wants to change the default behind the back of users.

> It's not your distro, it's
> not your system, and you are nothing more than a stubborn maintainer of this
> package (maybe others but that's beside the point). Yet you dare speak as
> the ultimate voice in this matter.

No worries.  If you convince the community that changing the default is a good idea and worth the troubles with migrating existing configurations, I will not block your effort.

> What if I have a hundred thousand systems?

Still not a reason to change the default for other users of logrotate.

> If I'm not mistaken Fedora
> currently doesn't have any configuration management tools.
> 
> Next you're gonna say: write a patch, create your own repo, use it after
> installation and a whole lot of other BS but I guess you're right: it's your
> lawn and even idiocy at your lawn is not discouraged, it's actually welcomed.
> 
> The resolution will be WONTFIX, not NOTABUG.

I though you agreed in comment #6 that this was not a bug, but who cares...