shepherd services with #:log-file overwrite their log file

  • Done
  • quality assurance status badge
Details
3 participants
  • Andreas Enge
  • Danny Milosavljevic
  • Ludovic Courtès
Owner
unassigned
Submitted by
Andreas Enge
Severity
normal

Debbugs page

Andreas Enge wrote 7 years ago
Cuirass service does not rotate its logs
(address . bug-guix@gnu.org)
20180228145039.GA4589@jurong
Hello,

while testing the cuirass service on bayfront, I see the following:

$ ll /var/log/c*
-rw-r--r-- 1 root root 2003521 Feb 28 15:38 /var/log/cuirass.log

I am sure this 2MB file was about 14MB big this morning, and indeed
any information dating from before this morning, when I rebooted the
machine and thus restarted the service, has gone.

Notice also that there are no numbered files cuirass.log.1 etc..

Andreas
Danny Milosavljevic wrote 7 years ago
(name . Andreas Enge)(address . andreas@enge.fr)(address . 30649@debbugs.gnu.org)
20180228174823.5fec105f@scratchpost.org
Hi Andreas,

On Wed, 28 Feb 2018 15:50:39 +0100
Andreas Enge <andreas@enge.fr> wrote:

Toggle quote (9 lines)
> $ ll /var/log/c*
> -rw-r--r-- 1 root root 2003521 Feb 28 15:38 /var/log/cuirass.log
>
> I am sure this 2MB file was about 14MB big this morning, and indeed
> any information dating from before this morning, when I rebooted the
> machine and thus restarted the service, has gone.
>
> Notice also that there are no numbered files cuirass.log.1 etc..

The simplest and best way to fix that is to make cuirass use syslog.

Not every program has to have its own private logging implementation,
log rotator, log filterting, log rate limiter, kitchen sink etc.

src/cuirass/logging.scm is prepared somewhat for this possiblity[2], but it
doesn't yet log to syslog.

There are guile syslog bindings[1] and we should use them and then apply a
two-line patch to src/cuirass/logging.scm .

[2] Replace current-logging-procedure
Ludovic Courtès wrote 7 years ago
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
87371j69fm.fsf@gnu.org
Danny Milosavljevic <dannym@scratchpost.org> skribis:

Toggle quote (25 lines)
> Hi Andreas,
>
> On Wed, 28 Feb 2018 15:50:39 +0100
> Andreas Enge <andreas@enge.fr> wrote:
>
>> $ ll /var/log/c*
>> -rw-r--r-- 1 root root 2003521 Feb 28 15:38 /var/log/cuirass.log
>>
>> I am sure this 2MB file was about 14MB big this morning, and indeed
>> any information dating from before this morning, when I rebooted the
>> machine and thus restarted the service, has gone.
>>
>> Notice also that there are no numbered files cuirass.log.1 etc..
>
> The simplest and best way to fix that is to make cuirass use syslog.
>
> Not every program has to have its own private logging implementation,
> log rotator, log filterting, log rate limiter, kitchen sink etc.
>
> src/cuirass/logging.scm is prepared somewhat for this possiblity[2], but it
> doesn't yet log to syslog.
>
> There are guile syslog bindings[1] and we should use them and then apply a
> two-line patch to src/cuirass/logging.scm .

Indeed. I wonder why we don’t have a Gamma package yet!

Ludo’.
Ludovic Courtès wrote 7 years ago
(name . Andreas Enge)(address . andreas@enge.fr)(address . 30649@debbugs.gnu.org)
87y3jb4utx.fsf@gnu.org
Andreas Enge <andreas@enge.fr> skribis:

Toggle quote (5 lines)
> while testing the cuirass service on bayfront, I see the following:
>
> $ ll /var/log/c*
> -rw-r--r-- 1 root root 2003521 Feb 28 15:38 /var/log/cuirass.log

The cuirass service in GuixSD explicitly extends rottlog so that this
file is rotated on a weekly basis. Perhaps you just need to wait a
little longer?

Ludo’.
Ludovic Courtès wrote 7 years ago
(name . Andreas Enge)(address . andreas@enge.fr)(address . 30649@debbugs.gnu.org)
87tvtz4usi.fsf@gnu.org
ludo@gnu.org (Ludovic Courtès) skribis:

Toggle quote (11 lines)
> Andreas Enge <andreas@enge.fr> skribis:
>
>> while testing the cuirass service on bayfront, I see the following:
>>
>> $ ll /var/log/c*
>> -rw-r--r-- 1 root root 2003521 Feb 28 15:38 /var/log/cuirass.log
>
> The cuirass service in GuixSD explicitly extends rottlog so that this
> file is rotated on a weekly basis. Perhaps you just need to wait a
> little longer?

I confirm that rotation works as expected on berlin.

Ludo’.
Andreas Enge wrote 7 years ago
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 30649@debbugs.gnu.org)
20180301164310.GA13951@jurong
On Thu, Mar 01, 2018 at 05:35:54PM +0100, Ludovic Courtï¿œs wrote:
Toggle quote (4 lines)
> The cuirass service in GuixSD explicitly extends rottlog so that this
> file is rotated on a weekly basis. Perhaps you just need to wait a
> little longer?

The problem is not that the file grows too large.

The problem was that after rebooting the server, the file was *replaced*
with newly written content. Maybe the problem is not rotation, but opening
a file in "write" instead of "append" mode...

Andreas
Ludovic Courtès wrote 7 years ago
control message for bug #30649
(address . control@debbugs.gnu.org)
874llz4grw.fsf@gnu.org
retitle 30649 shepherd services with #:log-file overwrite their log file
Ludovic Courtès wrote 7 years ago
Re: bug#30649: Cuirass service does not rotate its logs
(name . Andreas Enge)(address . andreas@enge.fr)(address . 30649-done@debbugs.gnu.org)
87606ehbtq.fsf@gnu.org
Andreas Enge <andreas@enge.fr> skribis:

Toggle quote (11 lines)
> On Thu, Mar 01, 2018 at 05:35:54PM +0100, Ludovic Courtès wrote:
>> The cuirass service in GuixSD explicitly extends rottlog so that this
>> file is rotated on a weekly basis. Perhaps you just need to wait a
>> little longer?
>
> The problem is not that the file grows too large.
>
> The problem was that after rebooting the server, the file was *replaced*
> with newly written content. Maybe the problem is not rotation, but opening
> a file in "write" instead of "append" mode...

Oh indeed, that’s a different thing.

This is fixed by Shepherd commit
7b4c88bac70f0bad82ef70fd5b682a49bc227478, thanks!

Ludo’.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 30649@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 30649
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help