Open FerdinandSu opened 2 years ago
I met the same issue as #17, since my wsl is using 'root' as default user.
It's caused by 00-wsl2-systemd:94
exec /usr/bin/nsenter --mount --pid --target "$SYSTEMD_PID" -- su - "$SUDO_USER"
that, variable "SUDO_USER" is empty when using root.
So I added line 17 SUDO_USER="root" to the file, and it seems to be working now (partially).
SUDO_USER="root"
However, gpg-agent.sh:12 caused another issue: the wslvar 'ProgramFiles(x86)' useage, which is actually invalid:
wslvar 'ProgramFiles(x86)'
It seems that wslvar imports an raw $env:ProgramFiles(x86) usage.
wslvar
$env:ProgramFiles(x86)
What's more, I do think most people may prefer to use git's gpg (Git\usr\bin\gpg.exe)?
Actually, after changing gpg-agent.sh:12 to
ln -sf "$(wslpath "$(wslvar 'ProgramFiles')/Git/usr/bin/gpg.exe")" "$HOME/.wsl-cmds/gpg"
It works quite well. Such change is not included in this pull request.
I met the same issue as #17, since my wsl is using 'root' as default user.
It's caused by 00-wsl2-systemd:94
that, variable "SUDO_USER" is empty when using root.
So I added line 17
SUDO_USER="root"
to the file, and it seems to be working now (partially).However, gpg-agent.sh:12 caused another issue: the
wslvar 'ProgramFiles(x86)'
useage, which is actually invalid:It seems that
wslvar
imports an raw$env:ProgramFiles(x86)
usage.What's more, I do think most people may prefer to use git's gpg (Git\usr\bin\gpg.exe)?