From: Michael Tremer Date: Wed, 29 Jun 2011 18:02:31 +0000 (+0200) Subject: openvpnctrl: Remove PID file after an openvpn process was killed. X-Git-Tag: v2.9-core53~29^2~3^2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d4c8b6bec26d2b45112e129f99921558058c4b18;p=people%2Fms%2Fipfire-2.x.git openvpnctrl: Remove PID file after an openvpn process was killed. --- diff --git a/src/misc-progs/openvpnctrl.c b/src/misc-progs/openvpnctrl.c index 1a40c9a612..ddda6125d2 100644 --- a/src/misc-progs/openvpnctrl.c +++ b/src/misc-progs/openvpnctrl.c @@ -466,6 +466,10 @@ void killNet2Net(char *name) { fprintf(stderr, "Killing PID %d.\n", pid); kill(pid, SIGTERM); + char command[STRING_SIZE]; + snprintf(command, STRING_SIZE - 1, "/bin/rm -f %s", pidfile); + executeCommand(command); + exit(0); }