]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Remove --writepid file on program exit.
authorGert Doering <gert@greenie.muc.de>
Tue, 7 Jul 2020 08:42:20 +0000 (10:42 +0200)
committerGert Doering <gert@greenie.muc.de>
Tue, 7 Jul 2020 09:51:34 +0000 (11:51 +0200)
commit008ec688d06101c0307e6d17a0239b134355dca4
treedde3ab658e1eaed954072b74301d23087a0a776a
parenta5e6f2d217309969a835f21b73b4dc0fbc70c4aa
Remove --writepid file on program exit.

For whatever reason, we never removed the pid file on program exit.

Not only this is unclean, but it also makes testing for "I want this
test case to FAIL" in t_client.sh more annoying to code for "is the
OpenVPN process still around?"...

Do not unlink the file if chroot() is active (might be outside the
chroot arena - testing for realpath etc. is left for someone else).

v2: make this work on M_FATAL exit, by unlinking from openvpn_exit() in
error.h - this requires moving write_pid() to init.c so module hierarchy
is maintained and introducing a static variable to save the PID file
name (otherwise it is no longer available when the top level GC is gone).

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Antonio Quartulli <antonio@openvpn.net>
Message-Id: <20200707084220.45753-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg20224.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/error.c
src/openvpn/init.c
src/openvpn/init.h
src/openvpn/openvpn.c