[vpnc-devel] Support for /sbin/netconfig under OpenSuse 11.1 for maintaining resolv.conf file
Mike Kienenberger
mkienenb at gmail.com
Mon Mar 16 22:43:44 CET 2009
I added support for OpenSuse 11.1's netconfig system for managing
resolv.conf as modify_resolvconf no longer exists.
One bug which I hit, and which has already been reported to Novell, is
that netconfig gives dynamically-assigned nameserver entries lower
priority than the statically-assigned ones, so if you have three
statically-assigned dns entries, your dynamically-assigned ones will
not take affect. There's a simple one-line change to fix that issue
in the bug report:
https://bugzilla.novell.com/show_bug.cgi?id=485793
Here's a patch to vpn-script.in to add netconfig support. I've also
included it as a txt attachment.
--- /usr/src/packages/BUILD/vpnc-0.5.3/vpnc-script.in 2008-11-19
15:55:51.000000000 -0500
+++ /etc/vpnc/vpnc-script 2009-03-16 17:40:33.000000000 -0400
@@ -76,6 +76,9 @@
if [ -x /sbin/resolvconf ]; then # Optional tool on Debian, Ubuntu, Gentoo
MODIFYRESOLVCONF=modify_resolvconf_manager
RESTORERESOLVCONF=restore_resolvconf_manager
+elif [ -x /sbin/netconfig ]; then # tool on Suse after 11.1
+ MODIFYRESOLVCONF=modify_resolvconf_suse_netconfig
+ RESTORERESOLVCONF=restore_resolvconf_suse_netconfig
elif [ -x /sbin/modify_resolvconf ]; then # Mandatory tool on Suse
earlier than 11.1
MODIFYRESOLVCONF=modify_resolvconf_suse
RESTORERESOLVCONF=restore_resolvconf_suse
@@ -344,6 +347,25 @@
esac
fi
}
+# === resolv.conf handling via /sbin/netconfig (Suse 11.1)
=====================
+
+# Suse provides a script that modifies resolv.conf. Use it because it will
+# restart/reload all other services that care about it (e.g. lwresd).
[unclear if this is still true, but probably --mlk]
+
+modify_resolvconf_suse_netconfig()
+{
+ /sbin/netconfig modify -s vpnc -i "$TUNDEV" <<-EOF
+ INTERFACE='$TUNDEV'
+ DNSSERVERS='$INTERNAL_IP4_DNS'
+ DNSDOMAIN='$CISCO_DEF_DOMAIN'
+ EOF
+}
+# Restore resolv.conf to old contents on Suse
+restore_resolvconf_suse_netconfig()
+{
+ /sbin/netconfig remove -s vpnc -i "$TUNDEV"
+}
+
# === resolv.conf handling via /sbin/modify_resolvconf (Suse)
=====================
# Suse provides a script that modifies resolv.conf. Use it because it will
-------------- next part --------------
--- /usr/src/packages/BUILD/vpnc-0.5.3/vpnc-script.in 2008-11-19 15:55:51.000000000 -0500
+++ /etc/vpnc/vpnc-script 2009-03-16 17:40:33.000000000 -0400
@@ -76,6 +76,9 @@
if [ -x /sbin/resolvconf ]; then # Optional tool on Debian, Ubuntu, Gentoo
MODIFYRESOLVCONF=modify_resolvconf_manager
RESTORERESOLVCONF=restore_resolvconf_manager
+elif [ -x /sbin/netconfig ]; then # tool on Suse after 11.1
+ MODIFYRESOLVCONF=modify_resolvconf_suse_netconfig
+ RESTORERESOLVCONF=restore_resolvconf_suse_netconfig
elif [ -x /sbin/modify_resolvconf ]; then # Mandatory tool on Suse earlier than 11.1
MODIFYRESOLVCONF=modify_resolvconf_suse
RESTORERESOLVCONF=restore_resolvconf_suse
@@ -344,6 +347,25 @@
esac
fi
}
+# === resolv.conf handling via /sbin/netconfig (Suse 11.1) =====================
+
+# Suse provides a script that modifies resolv.conf. Use it because it will
+# restart/reload all other services that care about it (e.g. lwresd). [unclear if this is still true, but probably --mlk]
+
+modify_resolvconf_suse_netconfig()
+{
+ /sbin/netconfig modify -s vpnc -i "$TUNDEV" <<-EOF
+ INTERFACE='$TUNDEV'
+ DNSSERVERS='$INTERNAL_IP4_DNS'
+ DNSDOMAIN='$CISCO_DEF_DOMAIN'
+ EOF
+}
+# Restore resolv.conf to old contents on Suse
+restore_resolvconf_suse_netconfig()
+{
+ /sbin/netconfig remove -s vpnc -i "$TUNDEV"
+}
+
# === resolv.conf handling via /sbin/modify_resolvconf (Suse) =====================
# Suse provides a script that modifies resolv.conf. Use it because it will
More information about the vpnc-devel
mailing list