* Logging and guix-home
@ 2021-11-13 1:45 Fredrik Salomonsson
2021-11-14 10:55 ` Hartmut Goebel
0 siblings, 1 reply; 3+ messages in thread
From: Fredrik Salomonsson @ 2021-11-13 1:45 UTC (permalink / raw)
To: help-guix
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.
[1] https://lists.gnu.org/archive/html/help-guix/2019-04/msg00178.html
Here's how I've setup the ssh-agent
--8<----------------------------------------------------------------------------
(define-public services
(list
(simple-service 'plt-ssh-environment
home-environment-variables-service-type
`(("SSH_AUTH_SOCK" . "${XDG_RUNTIME_DIR}/ssh-agent.socket")))
(simple-service 'plt-ssh-agent
home-shepherd-service-type
`(
,(shepherd-service
(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 "XDG_RUNTIME_DIR")))
#:log-file (format #f "~a/ssh-agent.log" (getenv "XDG_LOG_HOME"))))
(stop #~(make-kill-destructor)))
))))
---------------------------------------------------------------------------->8--
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?
Thanks
--
s/Fred[re]+i[ck]+/Fredrik/g
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Logging and guix-home
2021-11-13 1:45 Logging and guix-home Fredrik Salomonsson
@ 2021-11-14 10:55 ` Hartmut Goebel
2021-11-20 21:13 ` Fredrik Salomonsson
0 siblings, 1 reply; 3+ messages in thread
From: Hartmut Goebel @ 2021-11-14 10:55 UTC (permalink / raw)
To: Fredrik Salomonsson, help-guix
Am 13.11.21 um 02:45 schrieb Fredrik Salomonsson:
> 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.
Does setting #:log:file to /dev/stdout work for you? ((Just an idea,
I've not tested it)
--
+++hartmut
| Hartmut Goebel | |
| hartmut@goebel-consult.de | www.goebel-consult.de |
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Logging and guix-home
2021-11-14 10:55 ` Hartmut Goebel
@ 2021-11-20 21:13 ` Fredrik Salomonsson
0 siblings, 0 replies; 3+ messages in thread
From: Fredrik Salomonsson @ 2021-11-20 21:13 UTC (permalink / raw)
To: Hartmut Goebel, help-guix
Hi,
Sorry for the radio silence, it's been a busy week.
Hartmut Goebel <hartmut@goebel-consult.de> writes:
> Does setting #:log:file to /dev/stdout work for you? ((Just an idea,
> I've not tested it)
Yes, it has the same behavior as not using #:log:file. And that is to
output everything to the first tty I log into. Which is the behavior I
would like to avoid, it makes the logging ephemeral and also hard to
read. As I have it to automatically spawn sway if I login on tty1.
Right now logging to a file kind of works, as I don't have many user
daemons running (only ssh-agent). And ssh-agent does not output that
much. One downside I don't have any timestamps in the log file or
anything like that.
Gnupg was hard to convert as my foreign distro needs it and it ships
with systemd socket files which are enable by default. And I'm too lazy
to disable those in case I break something on my foreign distro.
So I've put the logging on the backburner. And I'll revisit it once I
have moved all my dotfiles over to guix home.
--
s/Fred[re]+i[ck]+/Fredrik/g
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-11-20 21:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-13 1:45 Logging and guix-home Fredrik Salomonsson
2021-11-14 10:55 ` Hartmut Goebel
2021-11-20 21:13 ` Fredrik Salomonsson
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).