diff --git a/openvpn.changes b/openvpn.changes index b764ee2..6e6681e 100644 --- a/openvpn.changes +++ b/openvpn.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Oct 28 12:13:45 CET 2008 - mt@suse.de + +- Fixed init script to handle pid files correctly (bnc#435421). + ------------------------------------------------------------------- Thu May 29 15:16:03 CEST 2008 - mt@suse.de diff --git a/openvpn.init b/openvpn.init index 2326601..132ec7a 100644 --- a/openvpn.init +++ b/openvpn.init @@ -76,10 +76,20 @@ case "$1" in /sbin/modprobe tun &>/dev/null for conf in $confdir/*.conf; do - pidfile=$(basename ${conf%%.conf}).pid + pidfile=$piddir/$(basename "${conf%%.conf}").pid + if [ -e "$pidfile" ]; then + killproc -p "$pidfile" -USR2 $openvpn + s=$? + case $s in + 0) continue ;; # no an error + 7) rm -f "$pidfile" ;; # not running + *) ret=false ; continue ;; + esac + fi + $openvpn --daemon \ - --writepid $piddir/$pidfile \ - --config $conf \ + --writepid "$pidfile" \ + --config "$conf" \ --cd $confdir \ || ret=false done @@ -95,7 +105,7 @@ case "$1" in ## set echo the echo return value. for i in $piddir/*.pid; do - killproc -p $i -TERM $openvpn || ret=false + killproc -p "$i" $openvpn || ret=false done # Remember status and be verbose @@ -125,15 +135,15 @@ case "$1" in # Remember status and be quiet rc_status ;; - reload) + reload|force-reload) for i in $piddir/*.pid; do - killproc -p $i -HUP $openvpn || ret=false + killproc -p "$i" -HUP $openvpn || ret=false done rc_status -v ;; reopen) for i in $piddir/*.pid; do - killproc -p $i -USR1 $openvpn || ret=false + killproc -p "$i" -USR1 $openvpn || ret=false done rc_status -v ;; @@ -142,7 +152,7 @@ case "$1" in running=false for i in $piddir/*.pid; do running=true - killproc -p $i -USR2 $openvpn || { rv=$?; ret=false; } + killproc -p "$i" -USR2 $openvpn || { rv=$?; ret=false; } done if $running; then $ret diff --git a/openvpn.spec b/openvpn.spec index f2eeddb..6453a48 100644 --- a/openvpn.spec +++ b/openvpn.spec @@ -2,9 +2,16 @@ # spec file for package openvpn (Version 2.0.9) # # Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. -# This file and all modifications and additions to the pristine -# package are under the same license as the package itself. # +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + # Please submit bugfixes or comments via http://bugs.opensuse.org/ # @@ -20,7 +27,7 @@ AutoReqProv: on PreReq: %insserv_prereq %fillup_prereq %endif Version: 2.0.9 -Release: 93 +Release: 142 Summary: Full-featured SSL VPN solution using a TUN/TAP Interface Source: http://openvpn.net/release/openvpn-%{version}.tar.gz Source1: http://openvpn.net/signatures/openvpn-%{version}.tar.gz.asc @@ -215,6 +222,8 @@ if ! test -f /.buildenv; then rm -rf $RPM_BUILD_ROOT; fi %{plugin_libdir}/openvpn-auth-pam.so %changelog +* Tue Oct 28 2008 mt@suse.de +- Fixed init script to handle pid files correctly (bnc#435421). * Thu May 29 2008 mt@suse.de - Added $time $named to Should-Start in the init script to avoid time related certificate errors and name resolving problems.