ben-grande / qusal

Salt Formulas for Qubes OS.
14 stars 6 forks source link

User and group errors in sys-git dom0 salt #43

Closed kennethrrosen closed 2 months ago

kennethrrosen commented 3 months ago

Commitment

I confirm that I have read the following resources:

Brief summary

When attempting to run sudo qubesctl state.apply sys-git.install-client in dom0 per the documentation, errors related to the placement of dotfiles occur because user user is not available Group user is not available as, I believe, dom0 isn't always simply named user by the user.

Steps to reproduce

Follow instructions to "Dom0 Update with Git". Run sudo qubesctl state.apply sys-git.install-client per instructions.

Expected behavior

Process completes without errors.

Actual behavior

[ERROR   ] User user is not available Group user is not available
[ERROR   ] {'/home/user/.config/git/template/hooks': {'directory': 'new'}}
[ERROR   ] {'/home/user/.config/git/shell': {'directory': 'new'}}
[ERROR   ] {'/home/user/.local/bin': {'directory': 'new'}}
[ERROR   ] {'/home/user/.config/git/shell': {'directory': 'new'}}
[ERROR   ] {'/home/user/.local/bin': {'directory': 'new'}}
[ERROR   ] User user is not available Group user is not available
[ERROR   ] {'/home/user/.local/bin': {'directory': 'new'}}
[ERROR   ] User user is not available Group user is not available
local:
----------
          ID: dotfiles-copy-git-home
    Function: file.recurse
        Name: /home/user
      Result: False
     Comment: User user is not available Group user is not available
     Started: 19:01:25.136938
    Duration: 27.153 ms
     Changes:   
----------
          ID: dotfiles-fix-executables-git-template-dir-home
    Function: file.directory
        Name: /home/user/.config/git/template/hooks
      Result: False
     Comment: No directory to create /home/user/.config/git/template/hooks in
     Started: 19:01:25.164330
    Duration: 2.333 ms
     Changes:   
              ----------
              /home/user/.config/git/template/hooks:
                  ----------
                  directory:
                      new
----------
          ID: dotfiles-fix-executables-git-shell-dir-home
    Function: file.directory
        Name: /home/user/.config/git/shell
      Result: False
     Comment: No directory to create /home/user/.config/git/shell in
     Started: 19:01:25.167138
    Duration: 4.096 ms
     Changes:   
              ----------
              /home/user/.config/git/shell:
                  ----------
                  directory:
                      new
----------
          ID: dotfiles-fix-executables-git-bin-dir-home
    Function: file.directory
        Name: /home/user/.local/bin
      Result: False
     Comment: No directory to create /home/user/.local/bin in
     Started: 19:01:25.174142
    Duration: 2.355 ms
     Changes:   
              ----------
              /home/user/.local/bin:
                  ----------
                  directory:
                      new

----------
          ID: dotfiles-fix-executables-git-shell-dir-skel
    Function: file.directory
        Name: /home/user/.config/git/shell
      Result: False
     Comment: No directory to create /home/user/.config/git/shell in
     Started: 19:01:29.038202
    Duration: 1.826 ms
     Changes:   
              ----------
              /home/user/.config/git/shell:
                  ----------
                  directory:
                      new
----------
          ID: dotfiles-fix-executables-git-bin-dir-skel
    Function: file.directory
        Name: /home/user/.local/bin
      Result: False
     Comment: No directory to create /home/user/.local/bin in
     Started: 19:01:29.040329
    Duration: 1.771 ms
     Changes:   
              ----------
              /home/user/.local/bin:
                  ----------
                  directory:
                      new
----------
          ID: dotfiles-copy-sh-home
    Function: file.recurse
        Name: /home/user/
      Result: False
     Comment: User user is not available Group user is not available
     Started: 19:01:29.042306
    Duration: 4.555 ms
     Changes:   
----------
          ID: dotfiles-fix-executables-sh-dir-home
    Function: file.directory
        Name: /home/user/.local/bin
      Result: False
     Comment: No directory to create /home/user/.local/bin in
     Started: 19:01:29.047105
    Duration: 1.876 ms
     Changes:   
              ----------
              /home/user/.local/bin:
                  ----------
                  directory:
                      new
----------
          ID: dotfiles-copy-x11-home
    Function: file.recurse
        Name: /home/user/
      Result: False
     Comment: User user is not available Group user is not available
     Started: 19:01:34.358719
    Duration: 6.51 ms
     Changes: 

.

ben-grande commented 3 months ago

I see. Use the other update method for now or edit the states to use the correct user home dir.

I will fix it when I have time as this change affects multiple states.

ben-grande commented 2 months ago

I will fix this but multi-user Dom0 won't work. It is also possible to change the default-user preference of a qube to create a different username. This, unfortunately is an edge case also.

ben-grande commented 2 months ago

Please update Qusal and test again and report back. I did quick manual tests only by editing /etc/group manually to reorder the usernames of the qubes group.