help-guix
[Top][All Lists]
Advanced

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

Re: home-syncthing-service-type wants /root paths, yet syncthing can wor


From: Tomas Volf
Subject: Re: home-syncthing-service-type wants /root paths, yet syncthing can work
Date: Sat, 6 Jan 2024 13:39:45 +0100

Hi,

On 2024-01-05 15:05:38 +0100, Sébastien Lerique wrote:
> Hi Guix! And dear helpers and devs,
>
> I'm running into a weird failure of home-syncthing-service-type.
>
> Running syncthing manually from the terminal works fine (here's an example
> log: <https://pastebin.com/1dLMKkyK>).
>
> So I Ctrl-C syncthing, then add home-syncthing-service-type to my
> home-configuration 
> <https://gitlab.com/wehlutyk/guix-config/-/blob/master/home-configuration.scm>
> (bottom lines).
>
> After restarting, home-syncthing-service-type fails synchronizing because it
> bases all user folders inside /root, to which it doesn't have writing
> rights. This happens whether all syncthing configurations in
> `.local/state/syncthing` had been removed in the meantime or not. Here's a
> log: <https://pastebin.com/14LwbvRn>
>
> Could this be a bug? A mistake in the configuration files?

After some digging in the source code, I managed to pinpoint the cause.  Your
configuration does not set user nor home, which causes Guix to call (getpw #f).
That returns the root user.  I would say this is a bug.  The code probably
should be something like this (untested):

    (or #$home (passwd:dir (getpw (if (and #$home-service? (not #$user)) 
(getuid) #$user))))

For your immediate problem, explicitly setting the (home) field in the
syncthing-configuration should help.  I think.

Have a nice day,
Tomas Volf

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

Attachment: signature.asc
Description: PGP signature


reply via email to

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