bug#44261: running a daemon with userns in relocateble pack breaks

2020-10-27 Thread Jan Nieuwenhuizen
Hi! As mentioned on IRC, running a daemon from a guix relocatable pack on a foreign distro using the user namespace feature is troublesome: it looks as if the daemon "loses" (its view of) the file-system once the parent process that creates the daemon exits. I'm attatching a package description f

bug#44261: running a daemon with userns in relocateble pack breaks

2020-10-27 Thread Jan Nieuwenhuizen
Jan Nieuwenhuizen writes: Hi! I tried the hint from Ludovic to use MS_PRIVATE in the attached patch and that works for me; not sure if we want a test and even less sure how to write that... Janneke >From fd3104608c3fa6a2375b6c7df0862e5479976b39 Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieu

bug#44261: running a daemon with userns in relocateble pack breaks

2020-10-30 Thread Ludovic Courtès
Hello! As discussed on IRC, my initial advice about MS_PRIVATE was misguided. The real issue is the “rm_rf (new_root);” call, which removes the root directory and thus leaves child processes (the daemon) with nothing. The attached patch adds a test loosely based on yours and a fix for that. The

bug#44261: running a daemon with userns in relocateble pack breaks

2020-10-30 Thread Jan Nieuwenhuizen
Ludovic Courtès writes: Hi! > As discussed on IRC, my initial advice about MS_PRIVATE was misguided. > The real issue is the “rm_rf (new_root);” call, which removes the root > directory and thus leaves child processes (the daemon) with nothing. Yes, I'm not entirely sure what I thought to see ye

bug#44261: running a daemon with userns in relocateble pack breaks

2020-10-31 Thread Ludovic Courtès
Hi, Jan Nieuwenhuizen skribis: > Ludovic Courtès writes: [...] >> The attached patch adds a test loosely based on yours and a fix for >> that. The fix (for the “userns” engine) is to make NEW_ROOT a tmpfs, >> such that upon completion, all we need to do is to unmount it and remove >> it; it l

bug#44261: running a daemon with userns in relocateble pack breaks

2020-10-31 Thread Jan Nieuwenhuizen
Ludovic Courtès writes: Hello, > Jan Nieuwenhuizen skribis: > >> Ludovic Courtès writes: > > [...] > >>> If you confirm that it works for you and looks reasonable, we can apply >>> it. >> >> Yes, this works. The test and also my reproducer now work fine. > > Thanks for checking, I pushed the fi