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