mirror of
https://github.com/containers/podman.git
synced 2025-06-17 23:20:59 +08:00
Fix WSL systemd detection
[NO NEW TESTS NEEDED] Signed-off-by: Frederik Boster <frederik@boster.de>
This commit is contained in:
@ -69,12 +69,6 @@ chown [USER]:[USER] /home/[USER]/.config
|
|||||||
const sudoers = `%wheel ALL=(ALL) NOPASSWD: ALL
|
const sudoers = `%wheel ALL=(ALL) NOPASSWD: ALL
|
||||||
`
|
`
|
||||||
|
|
||||||
const bootstrap = `#!/bin/bash
|
|
||||||
ps -ef | grep -v grep | grep -q systemd && exit 0
|
|
||||||
nohup unshare --kill-child --fork --pid --mount --mount-proc --propagation shared /lib/systemd/systemd >/dev/null 2>&1 &
|
|
||||||
sleep 0.1
|
|
||||||
`
|
|
||||||
|
|
||||||
const wslmotd = `
|
const wslmotd = `
|
||||||
You will be automatically entered into a nested process namespace where
|
You will be automatically entered into a nested process namespace where
|
||||||
systemd is running. If you need to access the parent namespace, hit ctrl-d
|
systemd is running. If you need to access the parent namespace, hit ctrl-d
|
||||||
@ -82,7 +76,13 @@ or type exit. This also means to log out you need to exit twice.
|
|||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
const sysdpid = "SYSDPID=`ps -eo cmd,pid | grep -m 1 ^/lib/systemd/systemd | awk '{print $2}'`"
|
const sysdpid = "SYSDPID=`ps --no-headers -C systemd --format exe,pid | grep -m 1 ^/usr/lib/systemd/systemd | awk '{print $2}'`"
|
||||||
|
|
||||||
|
const bootstrap = "#!/bin/bash\n" + sysdpid + `
|
||||||
|
[ -n "$SYSDPID" ] && exit 0
|
||||||
|
nohup unshare --kill-child --fork --pid --mount --mount-proc --propagation shared /usr/lib/systemd/systemd >/dev/null 2>&1 &
|
||||||
|
sleep 0.1
|
||||||
|
`
|
||||||
|
|
||||||
const profile = sysdpid + `
|
const profile = sysdpid + `
|
||||||
if [ ! -z "$SYSDPID" ] && [ "$SYSDPID" != "1" ]; then
|
if [ ! -z "$SYSDPID" ] && [ "$SYSDPID" != "1" ]; then
|
||||||
|
Reference in New Issue
Block a user