* 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
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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.