unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: guix-devel <guix-devel@gnu.org>
Subject: Re: System log (syslogd) for the Shepherd
Date: Tue, 13 Aug 2024 15:55:40 +0200	[thread overview]
Message-ID: <87mslga5nn.fsf@gnu.org> (raw)
In-Reply-To: <87a5ianad0.fsf@gnu.org> ("Ludovic Courtès"'s message of "Sun, 21 Jul 2024 15:27:39 +0200")

Hello!

Ludovic Courtès <ludo@gnu.org> skribis:

> I recently pushed a ‘wip-syslogd’ branch in the Shepherd, which should
> be ready to merge in ‘devel’ in the coming days.  It implements an
> in-process “system log” service that does the same job as good’ol
> syslogd as currently used in Guix System (info "(inetutils) syslogd
> invocation").

This is now part of the ‘devel’ branch.  This is pretty much the last
feature I wanted to have for 1.0.

If you want to use this new ‘system-log’ service instead of syslogd,
here’s how you can change your system configuration:

--8<---------------cut here---------------start------------->8---
(define system-log-service-type
  (shepherd-service-type
   'shepherd-system-log
   (const (shepherd-service
           (documentation "Shepherd's built-in system log (syslogd).")
           (provision '(system-log syslogd))
           (modules '((shepherd service system-log)))
           (free-form #~(system-log-service))))
   #t
   (description
    "Shepherd's built-in system log (syslogd).")))

(operating-system
  ;; …
  (services (cons* (service system-log-service-type)
                   ;; …
                   (modify-services %desktop-services
                     ;; …
                     (delete syslog-service-type))))) ;replaced by the Shepherd's
--8<---------------cut here---------------end--------------->8---

You need to be using the Shepherd from the ‘devel’ branch of course; see
the instructions in the Shepherd’s ‘README’ for this.

Once running, it gives something like this:

--8<---------------cut here---------------start------------->8---
$ sudo /run/current-system/profile/bin/herd status syslogd
Status of system-log:
  It is running since Sun 11 Aug 2024 11:23:40 PM CEST (40 hours ago).
  Running value is "#<system-log 7fc04762de00>".
  It is enabled.
  Provides: system-log syslogd.
  Will not be respawned.
  Log files: /var/log/messages /dev/tty12 /var/log/debug /var/log/secure.

Recent messages:
  2024-08-13 14:47:29 localhost shepherd[1]: service names: 72; heap: 36.89 MiB; file descriptors: 47
  2024-08-13 15:00:00 localhost shepherd[1]: Timer 'gc' spawned process 16427.
  2024-08-13 15:00:00 localhost shepherd[1]: Registering new logger for gc.
  2024-08-13 15:00:00 localhost shepherd[1]: [guix] guix gc: already 10699.16 MiBs available on /gnu/store, nothing to do
  2024-08-13 15:00:00 localhost shepherd[1]: Process 16427 of timer 'gc' terminated with status 0 after 0 seconds.
  2024-08-13 15:07:29 localhost shepherd[1]: service names: 72; heap: 36.89 MiB; file descriptors: 47
  2024-08-13 15:27:29 localhost shepherd[1]: service names: 72; heap: 36.89 MiB; file descriptors: 47
  2024-08-13 15:47:29 localhost shepherd[1]: service names: 72; heap: 36.89 MiB; file descriptors: 47
  2024-08-13 15:50:53 localhost sudo:     ludo : TTY=pts/0 ; PWD=/home/ludo/src/guix ; USER=root ; COMMAND=/run/current-system/profile/bin/herd status syslogd
  2024-08-13 15:50:53 localhost sudo: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000)
--8<---------------cut here---------------end--------------->8---

And it’s now integrated with the new ‘log-rotation’ service:

--8<---------------cut here---------------start------------->8---
$ sudo herd files log-rotation
/var/log/mcron.log      mcron
/var/log/messages       system-log
/dev/tty12      system-log
/var/log/debug  system-log
/var/log/secure system-log
/var/log/guix-publish.log       guix-publish
/var/log/avahi-daemon.log       avahi-daemon
/var/log/dbus-daemon.log        dbus-system
/var/log/ntpd.log       ntpd
/var/log/guix-daemon.log        guix-daemon
--8<---------------cut here---------------end--------------->8---

Ludo’.


  reply	other threads:[~2024-08-13 13:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-21 13:27 System log (syslogd) for the Shepherd Ludovic Courtès
2024-08-13 13:55 ` Ludovic Courtès [this message]
2024-08-23 19:08   ` Felix Lechner via Development of GNU Guix and the GNU System distribution.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mslga5nn.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).