Hello community, here is the log from the commit of package openvpn for openSUSE:Factory checked in at 2012-09-21 14:52:24 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/openvpn (Old) and /work/SRC/openSUSE:Factory/.openvpn.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "openvpn", Maintainer is "[email protected]" Changes: -------- --- /work/SRC/openSUSE:Factory/openvpn/openvpn.changes 2012-08-23 15:30:29.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.openvpn.new/openvpn.changes 2012-09-21 14:52:26.000000000 +0200 @@ -1,0 +2,8 @@ +Thu Sep 20 10:50:23 UTC 2012 - [email protected] + +- Fixed openvpn init script to not map reopen to reload so the + reopen code is without any effect (bnc#781106). +- Added requested OPENVPN_AUTOSTART variable allowing to provide + an optional list of config names started by default (bnc#692440). + +------------------------------------------------------------------- New: ---- openvpn.sysconfig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ openvpn.spec ++++++ --- /var/tmp/diff_new_pack.ZtdFM0/_old 2012-09-21 14:52:30.000000000 +0200 +++ /var/tmp/diff_new_pack.ZtdFM0/_new 2012-09-21 14:52:30.000000000 +0200 @@ -33,6 +33,7 @@ Source3: openvpn.README.SUSE Source4: client-netconfig.up Source5: client-netconfig.down +Source6: openvpn.sysconfig Patch1: %{name}-2.1-plugin-man.dif Patch2: %{name}-2.1-plugin-build.dif Patch3: openvpn-2.1-systemd-passwd.patch @@ -194,12 +195,16 @@ done # we install docs via spec into _defaultdocdir/name/management-notes.txt rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/{OpenVPN,%name} +# the /etc/sysconfig/openvpn template +install -d -m0755 %{buildroot}/var/adm/fillup-templates +install -m0600 $RPM_SOURCE_DIR/openvpn.sysconfig \ + %{buildroot}/var/adm/fillup-templates/sysconfig.openvpn %clean if ! test -f /.buildenv; then rm -rf $RPM_BUILD_ROOT; fi %post -%{?fillup_and_insserv:%fillup_and_insserv -f} +%{?fillup_and_insserv:%fillup_and_insserv} %preun %{?stop_on_removal:%stop_on_removal openvpn} @@ -228,6 +233,7 @@ %dir %{_libdir}/%{name} %dir %{plugin_dir} %dir %{plugin_libdir} +/var/adm/fillup-templates/sysconfig.openvpn %files down-root-plugin %defattr(-,root,root) ++++++ openvpn.init ++++++ --- /var/tmp/diff_new_pack.ZtdFM0/_old 2012-09-21 14:52:30.000000000 +0200 +++ /var/tmp/diff_new_pack.ZtdFM0/_new 2012-09-21 14:52:30.000000000 +0200 @@ -24,9 +24,8 @@ # Description: Start OpenVPN tunnel ### END INIT INFO -# we don't use any... -# test -s /etc/sysconfig/openvpn && \ -# . /etc/sysconfig/openvpn +test -s /etc/sysconfig/openvpn && \ + . /etc/sysconfig/openvpn DAEMON="OpenVPN" openvpn=/usr/sbin/openvpn @@ -73,6 +72,16 @@ action="$1" ; shift config="$1" ; shift +autostart_filter() +{ + test "x$config" != "x" && return 0 + test "x$OPENVPN_AUTOSTART" = "x" && return 0 + for n in ${OPENVPN_AUTOSTART} ; do + test "x$n" = "x$1" && return 0 + done + return 1 +} + case "$action" in start) /sbin/modprobe tun &>/dev/null @@ -81,6 +90,7 @@ for conf in $confdir/${config:-*}.conf ; do test -f "$conf" || continue name=$(basename "${conf%%.conf}") + autostart_filter "$name" || continue pidfile="$piddir/${name}.pid" echo -n "Starting $DAEMON [$name] " @@ -164,14 +174,30 @@ restart) ## Stop the service and regardless of whether it was ## running or not, start it again. - $0 stop ${config:+"$config"} - sleep 3 - $0 start ${config:+"$config"} + # When nothing is running, start specified config or + # the defult (autostart) set. Otherwise we stop the + # specified one or all that are currently running. + # Then start specified one or all that were running + # before and have a config. Makes sense? :-) + name="" + list=($config) + for pidfile in $piddir/${config:-*}.pid; do + test -f "$pidfile" || continue + name=$(basename "${pidfile%%.pid}") + $0 stop "$name" + rc_status + test "x$name" = "x$config" && continue # in list + test -f "$confdir/${name}.conf" && list+=("$name") + done + + test "x$name" = x || sleep 3 # for what was this needed? + + $0 start "${list[@]}" # Remember status and be quiet rc_status ;; - reopen|reload|force-reload) + reload|force-reload) for pidfile in $piddir/${config:-*}.pid; do test -f "$pidfile" || continue name=$(basename "${pidfile%%.pid}") @@ -219,6 +245,7 @@ for conf in $confdir/${config:-*}.conf ; do test -f "$conf" || continue name=$(basename "${conf%%.conf}") + autostart_filter "$name" || continue pidfile="$piddir/${name}.pid" if test ! -f "$pidfile" ; then ++++++ openvpn.sysconfig ++++++ ## Type: list("",) ## Default: "" # # Allows to specify an optional white-list of config names to start # in /etc/init.d/openvpn. # # Unlisted config names can be still started using the explicit name, # e.g. "/etc/init.d/openvpn start tun0" will start openvpn for the # "/etc/openvpn/tun0.conf" config file. # # Setting the variable to e.g. "foo bar" will cause the start of the # "/etc/openvpn/foo.conf" and "/etc/openvpn/bar.conf" config files. # When empty, the init script will start all existing config files. # OPENVPN_AUTOSTART="" -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
