[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Logging and guix-home

From: Fredrik Salomonsson
Subject: Logging and guix-home
Date: Sat, 13 Nov 2021 01:45:57 +0000

Hi Guix,

I got a question how to setup logging for daemons that are controlled by
shepherd that guix home creates. First some background info.

I have been slowly migrating my dotfiles from a GNU stow setup to guix
home. I'm currently using guix on a foreign distro that uses systemd.
Where systemd was controlling my user level daemons, e.g. ssh-agent.

But now that I use guix home, I have migrated them to shepherd. With
that I lost the handy logging you get from systemd. To mitigate that for
shepherd I'm right now using the #:log-file parameter, as suggested in
this thread [1], to send the output to a file.


Here's how I've setup the ssh-agent

(define-public services
   (simple-service 'plt-ssh-environment
                   `(("SSH_AUTH_SOCK" . "${XDG_RUNTIME_DIR}/ssh-agent.socket")))
   (simple-service 'plt-ssh-agent
                       (provision '(ssh-agent))
                       (documentation "Run and control ssh key agent.")
                       (start #~(make-forkexec-constructor
                                 `("ssh-agent" "-D" "-a"
                                   ,(format #f "~a/ssh-agent.socket" (getenv 
                                 #:log-file (format #f "~a/ssh-agent.log" 
(getenv "XDG_LOG_HOME"))))
                       (stop #~(make-kill-destructor)))

I do want some better logging, than just dumping to a file, as otherwise
I'll eventual run out of disk space. I have been pretty spoiled with
systemd on that part, and I have very little experience with syslog.
Given that I'm on a foreign distro, I cannot use the syslog-service (as
far as I know). Does anyone have a good idea on how to set this it up?

For example if I setup syslog and put "/dev/log" in the #:log-file
parameter, will it work? 

Or is syslog the wrong thing for user daemon logging? and instead I
should look for something else?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]