Hi all,

The script set_dns.sh was modified


@@ -1,6 +1,6 @@
 #!/bin/bash
 # Copyright (c) 1999-2017, Parallels International GmbH
-# Copyright (c) 2017-2019 Virtuozzo International GmbH. All rights reserved. +# Copyright (c) 2017-2023 Virtuozzo International GmbH. All rights reserved.
 #
 # This file is part of OpenVZ libraries. OpenVZ is free software; you can
 # redistribute it and/or modify it under the terms of the GNU Lesser General
@@ -44,6 +44,11 @@
         if [ -e "$RESOLVCONF" ]; then
             cfgfile=$RESOLVCONF
             [ "${VE_STATE}" = "running" ] && post_configure_cmd='resolvconf -u'
+            if  [ "${VE_STATE}" = "starting" ] &&
+                [ -e /etc/systemd/system/systemd-resolved.service ] &&
+                [ $(readlink /etc/systemd/system/systemd-resolved.service) == '/dev/null' ]; then +                grep -qF -- "resolvconf -u" "/etc/rc.local" || echo "resolvconf -u" >> "/etc/rc.local"
+            fi
         fi
     fi

@@ -59,7 +64,7 @@
             put_param2 "${cfgfile}" search "${search}"
         fi
     fi
-    if [ -n "${server}" ]; then
+    if [ -n "${server}" -a ! -L "${cfgfile}" ]; then
         [ -f "${cfgfile}" ] || touch "${cfgfile}"
         ${CP} ${cfgfile} ${cfgfile}.$$ || error "Can't copy file $cfgfile" $VZ_FS_NO_DISK_SPACE
         sed "/nameserver.*/d" ${cfgfile} > ${cfgfile}.$$
@@ -129,12 +134,14 @@
     [ -n "$NAMESERVER" -o  -n "$SEARCHDOMAIN" ] && netconfig -v update -m dns-resolver
 }

-if [ -e /etc/systemd/system/dbus-org.freedesktop.resolve1.service ]; then
-    set_resolved "${NAMESERVER}" "${SEARCHDOMAIN}"
+if  [ -e /etc/systemd/system/dbus-org.freedesktop.resolve1.service ] &&
+    [ -e /etc/systemd/system/systemd-resolved.service ] &&
+    [ $(readlink /etc/systemd/system/systemd-resolved.service) != '/dev/null' ]; then
+    set_resolved "${NAMESERVER}" "${SEARCHDOMAIN}"
 elif [ -e /sbin/netconfig -a -e /etc/sysconfig/network/config ]; then
-    set_network_config
+    set_network_config
 else
-    set_resolvconf "${NAMESERVER}" "${SEARCHDOMAIN}"
+    set_resolvconf "${NAMESERVER}" "${SEARCHDOMAIN}"
 fi

 exit 0


# uname -a
Linux - 3.10.0-1160.80.1.vz7.191.4 #1 SMP Thu Dec 15 20:31:06 MSK 2022 x86_64 x86_64 x86_64 GNU/Linux

# rpm -qf /usr/libexec/libvzctl/dists/scripts/set_dns.sh
libvzctl-7.0.730-1.vz7.x86_64

cd /usr/src/

wget https://download.openvz.org/virtuozzo/updates/7.0/source/SRPMS/l/libvzctl-7.0.730-1.vz7.src.rpm

rpm -ivh libvzctl-7.0.730-1.vz7.src.rpm

cat /root/rpmbuild/SPECS/libvzctl.spec


...

%changelog
* Wed Mar 08 2023 Aleksandr Leskin <[email protected]> <mailto:[email protected]> 7.0.730
 - scripts: do not update resolv.conf file if it is symlink #PSBM-146148

* Tue Mar 07 2023 Aleksandr Leskin <[email protected]> <mailto:[email protected]> 7.0.729
 - scripts: restore previous functionality for resolvconf #PSBM-145766

...



I rollbacked to the first I had, and it is ok now...

Please, could you check ?

Why did you need to change the script ?


Regards,


--
Aurélien GUERSON
_______________________________________________
Users mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/users

Reply via email to