* Shepherd service logging
@ 2023-12-04 22:50 Ludovic Courtès
2023-12-04 23:35 ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2023-12-04 22:50 UTC (permalink / raw)
To: guix-devel
Hello Guix!
The ‘wip-logging’ branch of the Shepherd contains changes that allow
clients such ‘herd status’ to display recently-logged messages, like
this:
--8<---------------cut here---------------start------------->8---
$ ./herd -s sock status test-logging
Status of test-logging:
It is running since 22:41:51 (7 seconds ago).
Running value is 31389.
It is enabled.
Provides (test-logging).
Requires ().
Will be respawned.
Recent messages:
2023-12-04 22:41:58 logging logging logging logging logging
2023-12-04 22:41:58 logging logging logging logging logging
2023-12-04 22:41:58 logging logging logging logging logging
2023-12-04 22:41:58 logging logging logging logging logging
2023-12-04 22:41:58 logging logging logging logging logging
2023-12-04 22:41:58 logging logging logging logging logging
2023-12-04 22:41:58 logging logging logging logging logging
2023-12-04 22:41:58 logging logging logging logging logging
2023-12-04 22:41:58 logging logging logging logging logging
2023-12-04 22:41:58 logging logging logging logging logging
--8<---------------cut here---------------end--------------->8---
Another *cough* popular service manager provides a facility that looks
like this and I find it convenient.
Internally, shepherd maintains a ring buffer of the last lines printed
by each service. To do that, the first step was to establish a
connection between the “logger” and the service it’s associated with—so
far, the logging mechanism was started by ‘fork+exec-command’, which
doesn’t know what service it’s working for. Loggers are now actors that
services can query to get those last messages.
The changes so far look like this:
627ad75 herd: ‘status’ displays recently-logged messages.
0b44232 service: Communicate recently-logged messages to clients.
823beae service: Associate loggers with services; keep buffer of logged lines.
cc8ea8a service: Built-in logger logs the PID of the service.
088997a service: Thread the current service to actions.
3302861 service: Move line-by-line log reading to a separate fiber.
Thoughts?
I suppose that’s maybe more for the next stable series (1.0!) than for
0.10.x.
Cheers,
Ludo’.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Shepherd service logging
2023-12-04 22:50 Shepherd service logging Ludovic Courtès
@ 2023-12-04 23:35 ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
2023-12-05 15:39 ` Attila Lendvai
0 siblings, 1 reply; 6+ messages in thread
From: Felix Lechner via Development of GNU Guix and the GNU System distribution. @ 2023-12-04 23:35 UTC (permalink / raw)
To: Ludovic Courtès, guix-devel
Hi Ludo'
On Mon, Dec 04 2023, Ludovic Courtès wrote:
> Thoughts?
Thanks for offering a logging facility! I run a custom Guix and would
like to test your changes. Is it enough to switch to your 'wip-logging'
branch in the package declaration? [1] Thanks!
Kind regards
Felix
[1] https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/admin.scm#n376
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Shepherd service logging
2023-12-04 23:35 ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
@ 2023-12-05 15:39 ` Attila Lendvai
2024-04-18 9:43 ` No public interface for shepherd-package (Was: Shepherd service logging) Felix Lechner via Development of GNU Guix and the GNU System distribution.
0 siblings, 1 reply; 6+ messages in thread
From: Attila Lendvai @ 2023-12-05 15:39 UTC (permalink / raw)
To: Felix Lechner; +Cc: Ludovic Courtès, guix-devel
> Thanks for offering a logging facility! I run a custom Guix and would
> like to test your changes. Is it enough to switch to your 'wip-logging'
> branch in the package declaration? [1] Thanks!
AFAIU that will lead to quite some local recompiling that are not necessary. you can just set the shepherd package of the shepherd-root-service-type to a custom package.
e.g. this will use the latest shepherd from the shepherd channel:
(operating-system
...
(essential-services
(modify-services (operating-system-default-essential-services
this-operating-system)
(shepherd-root-service-type
config =>
(shepherd-configuration
(inherit config)
(shepherd (@ (shepherd-package) shepherd)))))))
HTH,
--
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“[A] Computer [programming] language is inherently a pun — [it] needs to be interpreted by both men & machines.”
— Henry Baker
^ permalink raw reply [flat|nested] 6+ messages in thread
* No public interface for shepherd-package (Was: Shepherd service logging)
2023-12-05 15:39 ` Attila Lendvai
@ 2024-04-18 9:43 ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
2024-04-19 20:14 ` No public interface for shepherd-package Ludovic Courtès
0 siblings, 1 reply; 6+ messages in thread
From: Felix Lechner via Development of GNU Guix and the GNU System distribution. @ 2024-04-18 9:43 UTC (permalink / raw)
To: Attila Lendvai; +Cc: Ludovic Courtès, guix-devel
Hi Attila,
On Tue, Dec 05 2023, Attila Lendvai wrote:
> AFAIU that will lead to quite some local recompiling that are not necessary. you can just set the shepherd package of the shepherd-root-service-type to a custom package.
>
> e.g. this will use the latest shepherd from the shepherd channel:
>
> (operating-system
> ...
> (essential-services
> (modify-services (operating-system-default-essential-services
> this-operating-system)
> (shepherd-root-service-type
> config =>
> (shepherd-configuration
> (inherit config)
> (shepherd (@ (shepherd-package) shepherd)))))))
I have been using that code to get access to the timers in the
Shepherd's development branch. Unfortunately, one of my servers can no
longer be reconfigured via 'deploy' or 'system reconfigure'.
Following podiki's and jab's kind advice on IRC yesterday, I recompiled
Guix locally. I also provided all channels locally via -L.
That 'system reconfigure' failed too, however. The error message was:
Module named (shepherd-package) has no public interface.
Is your way of using the latest Shepherd version still recommended, or
should I be doing that differently now? Thanks!
Kind regards
Felix
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: No public interface for shepherd-package
2024-04-18 9:43 ` No public interface for shepherd-package (Was: Shepherd service logging) Felix Lechner via Development of GNU Guix and the GNU System distribution.
@ 2024-04-19 20:14 ` Ludovic Courtès
2024-04-21 16:13 ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2024-04-19 20:14 UTC (permalink / raw)
To: Felix Lechner; +Cc: Attila Lendvai, guix-devel
Hi Felix,
Felix Lechner <felix.lechner@lease-up.com> skribis:
> Following podiki's and jab's kind advice on IRC yesterday, I recompiled
> Guix locally. I also provided all channels locally via -L.
>
> That 'system reconfigure' failed too, however. The error message was:
>
> Module named (shepherd-package) has no public interface.
Is ‘shepherd’ among your channels?
I do something similar to what Attila described, and I have:
--8<---------------cut here---------------start------------->8---
$ guix describe
Generation 299 Apr 08 2024 00:55:02 (current)
shepherd d8d96fc
repository URL: https://git.savannah.gnu.org/git/shepherd.git
branch: devel
commit: d8d96fc28c49c624323b2f9f5cb01c4fc18a4afd
guile db7efa5
repository URL: https://git.savannah.gnu.org/git/guile.git
branch: main
commit: db7efa5d204b2e46ce9eb82f417d8c12d394858d
guix 49f82fc
repository URL: https://git.savannah.gnu.org/git/guix.git
branch: master
commit: 49f82fca4130ffcfb16aa0cf89750ab56fb99ad7
--8<---------------cut here---------------end--------------->8---
Ludo’.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: No public interface for shepherd-package
2024-04-19 20:14 ` No public interface for shepherd-package Ludovic Courtès
@ 2024-04-21 16:13 ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
0 siblings, 0 replies; 6+ messages in thread
From: Felix Lechner via Development of GNU Guix and the GNU System distribution. @ 2024-04-21 16:13 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: Attila Lendvai, guix-devel
On Fri, Apr 19 2024, Ludovic Courtès wrote:
> Is ‘shepherd’ among your channels?
Sorry, it works fine.
My message was borne from a terrible desperation after one of my most
important machines refused to reconfigure for a week. As so often with
technical systems, it was an operator error. [1]
Kind regards
Felix
[1] https://mail.gnu.org/archive/html/guix-devel/2024-04/msg00210.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-04-21 16:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-04 22:50 Shepherd service logging Ludovic Courtès
2023-12-04 23:35 ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
2023-12-05 15:39 ` Attila Lendvai
2024-04-18 9:43 ` No public interface for shepherd-package (Was: Shepherd service logging) Felix Lechner via Development of GNU Guix and the GNU System distribution.
2024-04-19 20:14 ` No public interface for shepherd-package Ludovic Courtès
2024-04-21 16:13 ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).