expressvpn: fix daemon not able to modify resolv.conf (#379943)

* fix(expressvpn): daemon not able to modify resolv.conf

* update expressvpndFHS wrapper pname

* remove unnecessary copying of hosts's resolv.conf
This commit is contained in:
e2r2fx
2025-03-18 15:41:51 +01:00
committed by GitHub
parent 48eb2dcd9e
commit a3383f5fdb
+10 -2
View File
@@ -49,13 +49,21 @@ let
};
expressvpndFHS = buildFHSEnv {
inherit pname version;
inherit version;
pname = "expressvpnd";
# When connected, it directly creates/deletes resolv.conf to change the DNS entries.
# Since it's running in an FHS environment, it has no effect on actual resolv.conf.
# Hence, place a watcher that updates host resolv.conf when FHS resolv.conf changes.
# Mount the host's resolv.conf to the container's /etc/resolv.conf
runScript = writeScript "${pname}-wrapper" ''
cp /host/etc/resolv.conf /etc/resolv.conf;
mkdir -p /host/etc
[ -e /host/etc/resolv.conf ] || touch /host/etc/resolv.conf
mount --bind /etc/resolv.conf /host/etc/resolv.conf
mount -o remount,rw /host/etc/resolv.conf
trap "umount /host/etc/resolv.conf" EXIT
while inotifywait /etc 2>/dev/null;
do
cp /etc/resolv.conf /host/etc/resolv.conf;