Skip to content

Broken with ostree-as-host /var/home #493

Closed

Description

@cgwalters
$ atomic host status
● atomic-ws:atomicws/fedora/x86_64/continuous
       Version: 25.2016.134 (2017-01-10 17:17:46)
    BaseCommit: 9fe637a8723b5637ba2841de4a2a7233840802205e247d0015953c2b53217dd5
        Commit: dbe59630eef865202daf471e1fb3403d15d78c6f8bc25d76ce1a6e09b659600d
        OSName: fedora
      Packages: ansible emacs fuse-sshfs gdb gimp git keepassx krb5-workstation libgit2 libvirt opensc pcsc-lite-ccid powerline strace vagrant-hostmanager vagrant-libvirt vagrant-sshfs virt-manager xchat xsel ykclient ykpers
      Unlocked: development
$ strace -f -e symlink,symlinkat flatpak run org.gnome.Evince
strace: Process 14551 attached
strace: Process 14552 attached
strace: Process 14553 attached
strace: Process 14554 attached
[pid 14553] +++ exited with 0 +++
[pid 14550] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=14553, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
strace: Process 14555 attached
[pid 14555] symlink("usr/bin", "/newroot/bin") = 0
[pid 14555] symlink("var/home", "/newroot/home") = 0
[pid 14555] symlink("usr/lib", "/newroot/lib") = 0
[pid 14555] symlink("usr/lib64", "/newroot/lib64") = 0
[pid 14555] symlink("run/media", "/newroot/media") = 0
[pid 14555] symlink("var/mnt", "/newroot/mnt") = 0
[pid 14555] symlink("var/opt", "/newroot/opt") = 0
[pid 14555] symlink("sysroot/ostree", "/newroot/ostree") = 0
[pid 14555] symlink("var/roothome", "/newroot/root") = 0
[pid 14555] symlink("usr/sbin", "/newroot/sbin") = 0
[pid 14555] symlink("var/srv", "/newroot/srv") = 0
[pid 14555] symlink("sysroot/tmp", "/newroot/tmp") = 0
strace: Process 14556 attached
[pid 14552] +++ exited with 0 +++
[pid 14551] +++ exited with 0 +++
strace: Process 14557 attached
[pid 14557] symlink("../run", "/newroot/var/run") = 0
[pid 14557] symlink("/proc/mounts", "/newroot/etc/mtab") = 0
[pid 14557] symlink("usr/lib", "/newroot/lib") = 0
[pid 14557] symlink("usr/lib64", "/newroot/lib64") = 0
[pid 14557] symlink("usr/bin", "/newroot/bin") = 0
[pid 14557] symlink("usr/sbin", "/newroot/sbin") = 0
[pid 14557] symlink("/run/host/monitor/localtime", "/newroot/etc/localtime") = 0
[pid 14557] symlink("/run/host/monitor/resolv.conf", "/newroot/etc/resolv.conf") = 0
[pid 14557] symlink("../../../.flatpak-info", "/newroot/run/user/1000/flatpak-info") = 0
[pid 14557] symlink("/proc/self/fd/0", "/newroot/dev/stdin") = 0
[pid 14557] symlink("/proc/self/fd/1", "/newroot/dev/stdout") = 0
[pid 14557] symlink("/proc/self/fd/2", "/newroot/dev/stderr") = 0
[pid 14557] symlink("pts/ptmx", "/newroot/dev/ptmx") = 0
[pid 14557] symlink("var/home", "/newroot/home") = -1 EEXIST (File exists)
Can't make symlink at /home: File exists
[pid 14557] +++ exited with 1 +++
[pid 14556] +++ exited with 0 +++
[pid 14550] +++ exited with 1 +++
[pid 14555] +++ exited with 0 +++
+++ exited with 0 +++

Activity

  1. alexlarsson commented on Jan 19, 2017

    @alexlarsson
    Member

    I guess HOME is /home/walters, and /home is a symlink to /var/home ?

  2. cgwalters commented on Jan 19, 2017

    @cgwalters
    CollaboratorAuthor

    Yep.

  3. cgwalters commented on Jan 19, 2017

    @cgwalters
    CollaboratorAuthor

    Now I get:

    flatpak run org.gnome.Evince
    Can't bind mount /oldroot/var/home/walters/.config/dconf on /newroot/home/walters/.config/dconf: Invalid argument
    

    I can take a look at this at some point if you're just doing blind patches.

  4. cgwalters commented on Jan 19, 2017

    @cgwalters
    CollaboratorAuthor

    Hm, confused, I built git master, it still didn't work, added patches to debug, now it works. Removing my patches it still works.

    Here's what I started FWIW

    diff --git a/common/flatpak-run.c b/common/flatpak-run.c
    index fb29c73..7199158 100644
    --- a/common/flatpak-run.c
    +++ b/common/flatpak-run.c
    @@ -3335,22 +3335,23 @@ add_document_portal_args (GPtrArray  *argv_array,
     gchar *
     join_args (GPtrArray *argv_array, gsize *len_out)
     {
    -  gchar *string;
    -  gchar *ptr;
    +  g_autoptr(GString) nulsepbuf = g_string_new (NULL);
    +  g_autoptr(GString) spacesepbuf = g_string_new (NULL);
       gint i;
    -  gsize len = 0;
     
       for (i = 0; i < argv_array->len; i++)
    -    len +=  strlen (argv_array->pdata[i]) + 1;
    +    {
    +      const char *arg = argv_array->pdata[i];
    +      g_string_append (nulsepbuf, arg);
    +      g_string_append_c (nulsepbuf, '\0');
    +      g_string_append (spacesepbuf, arg);
    +      g_string_append_c (spacesepbuf, ' ');
    +    }
     
    -  string = g_new (gchar, len);
    -  *string = 0;
    -  ptr = string;
    -  for (i = 0; i < argv_array->len; i++)
    -    ptr = g_stpcpy (ptr, argv_array->pdata[i]) + 1;
    +  g_debug ("bwrap arg fd: %s", spacesepbuf->str);
     
    -  *len_out = len;
    -  return string;
    +  *len_out = nulsepbuf->len;
    +  return g_string_free (g_steal_pointer (&nulsepbuf), FALSE);
     }
     
     typedef struct {
    @@ -4222,6 +4223,16 @@ flatpak_run_app (const char     *app_ref,
     
       g_ptr_array_add (real_argv_array, NULL);
     
    +  {
    +    g_autoptr(GString) buf = g_string_new ("");
    +    for (guint i = 0; i < argv_array->len; i++)
    +      {
    +        g_string_append (buf, argv_array->pdata[i]);
    +        g_string_append_c (buf, ' ');
    +      }
    +    g_debug ("Running: %s", buf->str);
    +  }
    +
       if ((flags & FLATPAK_RUN_FLAG_BACKGROUND) != 0)
         {
           if (!g_spawn_async (NULL,
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions