update-systemd-resolved
update-systemd-resolved copied to clipboard
running the script in docker container
when i tried running this in a container i was blocked by 2 things: 1/ use of logger (that points to /dev/log that does not exist in a container) 2/ use of busctl (which results in Failed to connect to bus: No such file or directory).
i addressed the first by making logger into echo. the second is more complex :)
is there a way to run it in a container? if not - what is the equivalent of "busctl call" when running in a container?
how to reproduce:
start a debian 9 container.
sudo apt update
sudo apt install nano less wget dbus openvpn openvpn-systemd-resolved -y
sudo sed -i -e 's/logger -s --id="$$" -t/echo/g' /etc/openvpn/update-systemd-resolved
create config.ovpn and vpn.login
make sure the config has:
script-security 2
up /etc/openvpn/update-systemd-resolved
down /etc/openvpn/update-systemd-resolved
down-pre
and then
sudo openvpn --config config.ovpn --auth-user-pass vpn.login > openvpn.log 2>&1 &
the result:
update-systemd-resolved -p user.info -- SetLinkDNS(...) Failed to connect to bus: No such file or directory update-systemd-resolved -p user.emerg -- 'busctl' exited with status 1