i want to execute some script after one of my few tunels is up. If i understand things correctly i should create /etc/openvpn/openvpn.TUNELNAME-up.sh, so i did (and i set it execution bit), but the scripts is never executed. i've made a bit of debugging and i've found that it should be executed from /etc/openvpn/up.sh in lines: if [ -n "${SVCNAME}" ]; then # If we have a service specific script, run this now if [ -x /etc/openvpn/"${SVCNAME}"-up.sh ] ; then /etc/openvpn/"${SVCNAME}"-up.sh "$@" fi [...] i've added the following line just before the first 'if' in code above: echo "SVCNAME: ${SVCNAME}" > /tmp/cccc and i get: <root@benek>/etc/openvpn: cat /tmp/cccc SVCNAME: so it seems that this variable is empty here i'm using net-misc/openvpn-2.1_rc9 in ~x86 branch emerge --info: Portage 2.2_rc12 (default/linux/x86/2008.0, gcc-4.3.2, glibc-2.8_p20080602-r0, 2.6.23.1 i686) ================================================================= System uname: Linux-2.6.23.1-i686-Mobile_AMD_Sempron-tm-_Processor_3200+-with-glibc2.0 Timestamp of tree: Thu, 23 Oct 2008 15:15:01 +0000 distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] app-shells/bash: 3.2_p39 dev-java/java-config: 1.3.7, 2.1.6-r1 dev-lang/python: 2.5.2-r8 dev-util/cmake: 2.6.2 sys-apps/baselayout: 2.0.0 sys-apps/openrc: 0.3.0-r1 sys-apps/sandbox: 1.2.18.1-r3 sys-devel/autoconf: 2.13, 2.63 sys-devel/automake: 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1-r1 sys-devel/binutils: 2.18-r3 sys-devel/gcc-config: 1.4.0-r4 sys-devel/libtool: 2.2.6a virtual/os-headers: 2.6.26 ACCEPT_KEYWORDS="x86 ~x86" CBUILD="i686-pc-linux-gnu" CFLAGS="-march=athlon-xp -O2 -pipe -mfpmath=sse -DNDEBUG -DG_DISABLE_ASSERT -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d" CXXFLAGS="-march=athlon-xp -O2 -pipe -mfpmath=sse -DNDEBUG -DG_DISABLE_ASSERT" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs cvs digest distlocks fixpackages parallel-fetch preserve-libs protect-owned sandbox sfperms spinner strict unmerge-orphans userfetch" GENTOO_MIRRORS="#http://gentoo.zie.pg.gda.pl/ http://gentoo.prz.rzeszow.pl http://src.gentoo.pl/distfiles" LANG="en_US" LDFLAGS="-Wl,-O1" LINGUAS="pl" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/home/portage/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/portage/local" SYNC="rsync://gentoo.prz.rzeszow.pl/gentoo-portage" USE="3dnow 3dnowext X a52 aac accessibility acpi aiglx alsa amarok amr apache2 bash-completion bluetooth bzip2 cairo canvas cli cracklib crypt cups curl dbus divx divx4linux dlloader dri dvd dvdr dvdread encode exscalibar extraicons extramodules fbcon ffmpeg fla flac gd gif gimp glitz glut gmedia gpgme gpm gtk gtk2 hal iconv imlib2 isdnlog javascript jikes jpeg jpeg2k kde kdeenablefinal kdexdeltas lcms ldap live loop-aes mad madwifi mailwrapper memlimit midi mmx mmxext moznocompose moznoirc moznomail mp3 mudflap musepack musicbrainz mysql ncurses nls nocardbus nptl nptlonly nsplugin nvidia ogg opengl openmp pam pcre pda perl pmu png ppds pppd python qt3support quicktime rdesktop readline real realmedia reflection samba sasl sdl serial session spl sql sqlite sqlite3 sse sse2 ssl sysfs tcpd theora tiff truetype unicode usb userlocales vcd videos vidix vim vim-with-x vorbis win32codecs wmf wmp x264 x86 xcomposite xml xorg xv xvid zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="kodak" ELIBC="glibc" INPUT_DEVICES="keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="pl" USERLAND="GNU" VIDEO_CARDS="nv nvidia vesa" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Hmmm, this looks related to bug 234667. It appears the init script is now done rather differently, and whilst it exports PEER_DNS, it doesn't seem to export SVCNAME...
Fix in cvs