all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tomas Volf <~@wolfsden.cz>
To: "Sébastien Lerique" <sl@eauchat.org>
Cc: help-guix@gnu.org, guix-devel@gnu.org
Subject: Re: home-syncthing-service-type wants /root paths, yet syncthing can work
Date: Sat, 6 Jan 2024 13:39:45 +0100	[thread overview]
Message-ID: <ZZlKEbqGHHYN9k9n@ws> (raw)
In-Reply-To: <0e58fe8b715dc6f4b0ddef3819a5222d@eauchat.org>

[-- Attachment #1: Type: text/plain, Size: 1539 bytes --]

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2024-01-06 12:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-05 14:05 home-syncthing-service-type wants /root paths, yet syncthing can work Sébastien Lerique
2024-01-06 12:39 ` Tomas Volf [this message]
2024-01-09 22:58   ` Ludovic Courtès

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

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

  git send-email \
    --in-reply-to=ZZlKEbqGHHYN9k9n@ws \
    --to=~@wolfsden.cz \
    --cc=guix-devel@gnu.org \
    --cc=help-guix@gnu.org \
    --cc=sl@eauchat.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 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.