wsl2-systemd scripts rename
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$1" != "--force" ]; then
|
||||
if [ -f /start-systemd-namespace ]; then
|
||||
if [ -f /usr/local/bin/start-systemd-namespace.sh ]; then
|
||||
echo "It appears you have already installed the systemd hack."
|
||||
echo "To forcibly reinstall, run this script with the \`--force\` parameter."
|
||||
exit
|
||||
@@ -55,7 +55,7 @@ $SUDO_CMD apt-get update && $SUDO_CMD apt-get install -yqq daemonize dbus-user-s
|
||||
|
||||
#$SUDO_CMD cp "$self_dir/start-systemd-namespace" /start-systemd-namespace
|
||||
#$SUDO_CMD cp "$self_dir/enter-systemd-namespace" /enter-systemd-namespace
|
||||
$SUDO_CMD chmod +x /enter-systemd-namespace
|
||||
$SUDO_CMD chmod +x /usr/local/bin/enter-systemd-namespace.sh
|
||||
|
||||
$SUDO_CMD tee /etc/sudoers.d/systemd-namespace >/dev/null <<EOF
|
||||
Defaults env_keep += WSLPATH
|
||||
@@ -64,11 +64,11 @@ Defaults env_keep += WSL_INTEROP
|
||||
Defaults env_keep += WSL_DISTRO_NAME
|
||||
Defaults env_keep += PRE_NAMESPACE_PATH
|
||||
Defaults env_keep += PRE_NAMESPACE_PWD
|
||||
%sudo ALL=(ALL) NOPASSWD: /enter-systemd-namespace
|
||||
%sudo ALL=(ALL) NOPASSWD: /usr/local/bin/enter-systemd-namespace.sh
|
||||
EOF
|
||||
|
||||
if ! grep 'start-systemd-namespace' /etc/bash.bashrc >/dev/null; then
|
||||
$SUDO_CMD sed -i 2a"# Start or enter a PID namespace in WSL2\nsource /start-systemd-namespace\n" /etc/bash.bashrc
|
||||
$SUDO_CMD sed -i 2a"# Start or enter a PID namespace in WSL2\nsource /usr/loca/bin/start-systemd-namespace.sh\n" /etc/bash.bashrc
|
||||
fi
|
||||
|
||||
$SUDO_CMD rm -f /etc/systemd/user/sockets.target.wants/dirmngr.socket
|
||||
|
Reference in New Issue
Block a user