On 13-11-26 10:00 AM, Simon Deziel wrote:
> Hi Stephen and Alberto,
> 
> On 13-11-26 07:47 AM, Alberto Gonzalez Iniesta wrote:
>> On Thu, Nov 07, 2013 at 09:46:24PM -0800, Stephen Gildea wrote:
>>> Package: openvpn
>>> Version: 2.3.2-5
>>> Tags: patch
>>>
>>> This patch moves all openvpn /var/run files down into a subdirectory.
>>> This change is in support of running openvpn in a chroot: it allows
>>> that subdirectory to be moved into the chroot tree and still be
>>> soft-linked from the real /var/run (and thus visible to this script).
>>>
>>> This patch is a subset of the patch in bug 614036.  I hope this small
>>> and more focused patch will be easier to review and that you will thus
>>> be able to apply it now.  Although it is a trivial change, this patch
>>> is invasive in that it touches lines throughout the script.  Getting
>>> it merged upstream would greatly ease the burden of carrying forward
>>> the patch in 614036 until you have a chance to consider its more
>>> complicated behavior.
>>
>> Hi Stephen,
>>
>> Thanks for your patches. I'll be happy to apply 729030's patch as soon
>> as I get a clean upgrade path. Changing the location of pid files in the
>> init script while VPNs are running will not work well, and that will
>> happen in the first upgrade of the package with this patch applied.
> 
> I applied this patch while I had 6 VPN clients running. To cope with the
> pid/status files relocation I did this:
> 
> # Create destination dir
> mkdir /var/run/openvpn
> 
> # Move .pid and .status files
> for f in $(ls /var/run/openvpn.*.pid /var/run/openvpn.*.status
> 2>/dev/null); do
>   mv "$f" "/var/run/openvpn/$(basename $f | sed 's/^openvpn\.//')"
> done
> 
> # Fix sendsigs.omit.d links
> for f in /var/run/openvpn/*.pid; do
>   b="$(basename $f)"
>   [ -e "/run/sendsigs.omit.d/openvpn.$b" ] || \
>     ln -sf "$f" "/run/sendsigs.omit.d/openvpn.$b"
> done

I hit send too quickly. The part handling sendsigs.omit.d links is wrong
as it would link all the pids, not just fix the broken links. Here's a
good version:

# Fix sendsigs.omit.d links
for f in /run/sendsigs.omit.d/openvpn.*.pid; do
  [ -e "$f" ] && continue
  b="$(basename $f|sed 's/openvpn\.//')"
  ln -sf "/var/run/openvpn/$b" "/run/sendsigs.omit.d/openvpn.$b"
done

Simon


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to