unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* home-syncthing-service-type wants /root paths, yet syncthing can work
@ 2024-01-05 14:05 Sébastien Lerique
  2024-01-06 12:39 ` Tomas Volf
  0 siblings, 1 reply; 3+ messages in thread
From: Sébastien Lerique @ 2024-01-05 14:05 UTC (permalink / raw)
  To: help-guix, guix-devel

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? In case it's 
useful, the system config is 
<https://gitlab.com/wehlutyk/guix-config/-/blob/master/config.scm>, and 
the versions:

sl@beoga ~> guix describe
Generation 3	Jan 03 2024 23:08:17	(current)
   guix 7b0863f
     repository URL: https://git.savannah.gnu.org/git/guix.git
     branch: master
     commit: 7b0863f07a113caef26fea13909bd97d250b629e
   guix-science 4e7057c
     repository URL: https://github.com/guix-science/guix-science.git
     branch: master
     commit: 4e7057ceafba901f619bac068c74c6df158fd4ec
   nonguix 8956906
     repository URL: https://gitlab.com/nonguix/nonguix
     branch: master
     commit: 8956906f6bed6709e71f0c26ed6a3620f40dc487

Best to all, and thanks for any answer!
Sébastien


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: home-syncthing-service-type wants /root paths, yet syncthing can work
  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
  2024-01-09 22:58   ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Tomas Volf @ 2024-01-06 12:39 UTC (permalink / raw)
  To: Sébastien Lerique; +Cc: help-guix, guix-devel

[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: home-syncthing-service-type wants /root paths, yet syncthing can work
  2024-01-06 12:39 ` Tomas Volf
@ 2024-01-09 22:58   ` Ludovic Courtès
  0 siblings, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2024-01-09 22:58 UTC (permalink / raw)
  To: Sébastien Lerique; +Cc: help-guix, guix-devel

Hi,

Tomas Volf <~@wolfsden.cz> skribis:

> 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))))

Agreed.  Sébastien, could you confirm and send a patch?

Thanks,
Ludo’.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-01-09 22:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2024-01-09 22:58   ` Ludovic Courtès

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).