wsl2-systemd script 2
This commit is contained in:
@@ -39,7 +39,7 @@ if [ "$ADDITIONALS" == "true" ]; then
|
||||
echo "Additional install has started"
|
||||
sh /additional_install.sh
|
||||
echo "Additional install has finished"
|
||||
else if [ "$WSL2" == "true" ]; then
|
||||
elif [ -n "$WSL_DISTRO_NAME" ]; then
|
||||
echo "WSL2 systemd script has started"
|
||||
sh /wsl2-systemd-script.sh
|
||||
#systemctl
|
||||
|
@@ -648,6 +648,8 @@ if [ "$ANSWER" == "y" ] || [ "$ANSWER" == "Y" ] || [ "$ANSWER" == "" ]; then
|
||||
registry.format.hu/installer-tool
|
||||
fi
|
||||
|
||||
# running on WSL
|
||||
if [ -n "$WSL_DISTRO_NAME" ]; then
|
||||
# enable systemd support on current images
|
||||
echo "Would you like to install and enable systemd support? (Y/n)";
|
||||
read -r ANSWER;
|
||||
@@ -655,13 +657,14 @@ if [ "$ANSWER" == "y" ] || [ "$ANSWER" == "Y" ] || [ "$ANSWER" == "" ] ; then
|
||||
|
||||
# Run installer tool
|
||||
$SUDO_CMD docker run \
|
||||
--env WSL2=true \
|
||||
--env WSL_DISTRO_NAME=$WSL_DISTRO_NAME \
|
||||
--env SUDO_CMD=$SUDO_CMD \
|
||||
--volume $HOME/.ssh/installer:/root/.ssh/id_rsa \
|
||||
--volume /etc/user/:/etc/user/ \
|
||||
--volume /etc/system/:/etc/system/ \
|
||||
registry.format.hu/installer-tool
|
||||
fi;
|
||||
fi;
|
||||
|
||||
shopt -s expand_aliases
|
||||
source $HOME/.bash_aliases
|
||||
|
@@ -57,14 +57,14 @@ $SUDO_CMD apt-get update && $SUDO_CMD apt-get install -yqq daemonize dbus-user-s
|
||||
#$SUDO_CMD cp "$self_dir/enter-systemd-namespace" /enter-systemd-namespace
|
||||
$SUDO_CMD chmod +x /enter-systemd-namespace
|
||||
|
||||
$SUDO_CMD tee /etc/$SUDO_CMDers.d/systemd-namespace >/dev/null <<EOF
|
||||
$SUDO_CMD tee /etc/sudoers.d/systemd-namespace >/dev/null <<EOF
|
||||
Defaults env_keep += WSLPATH
|
||||
Defaults env_keep += WSLENV
|
||||
Defaults env_keep += WSL_INTEROP
|
||||
Defaults env_keep += WSL_DISTRO_NAME
|
||||
Defaults env_keep += PRE_NAMESPACE_PATH
|
||||
Defaults env_keep += PRE_NAMESPACE_PWD
|
||||
%$SUDO_CMD ALL=(ALL) NOPASSWD: /enter-systemd-namespace
|
||||
%sudo ALL=(ALL) NOPASSWD: /enter-systemd-namespace
|
||||
EOF
|
||||
|
||||
if ! grep 'start-systemd-namespace' /etc/bash.bashrc >/dev/null; then
|
||||
|
Reference in New Issue
Block a user