]> git.ipfire.org Git - thirdparty/openvpn.git/commit
openvpnserv: Add support for multi-instances
authorSimon Rozman <simon@rozman.si>
Sun, 3 Dec 2017 21:16:54 +0000 (22:16 +0100)
committerGert Doering <gert@greenie.muc.de>
Mon, 4 Dec 2017 17:58:54 +0000 (18:58 +0100)
commit8a52d07c844d718c7032c4936e0c43f0e3e6033d
tree6d3ec7a8e19d714e1bd0ea806add1e61879dcee9
parent6232c7b3827f90d9b25135c523703204bc2095c0
openvpnserv: Add support for multi-instances

While openvpn.exe can run multiple concurrent processes, openvpnserv.exe
is usually only one single globally unique running process.

This patch extends openvpnserv.exe to support multiple service instances
in parallel allowing side-by-side OpenVPN installations.

Alternate instances must be installed as `SERVICE_WIN32_OWN_PROCESS`
(Type 0x10) and must use the newly introduced service command line
parameter:
-instance <name> <id>
<name> can be `automatic` or `interactive`.

- The service settings will be loaded from `HKLM\Software\OpenVPN<id>`
  registry key.

- The automatic service will use `openvpn<id>_exit_1` exit event.

- The interactive service will accept requests on
  `\\.\pipe\openvpn<id>\service` named pipe, and run IPC with
  openvpn.exe on `\\.\pipe\openvpn<id>\service_<pid>`.

This patch preserves backward compatibility, by defaulting to
`SERVICE_WIN32_SHARE_PROCESS` and `<empty string>` as service ID.

Acked-by: Selva Nair <selva.nair@gmail.com>
Message-Id: <20171203211654.1044-1-simon@rozman.si>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg16002.html

Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit f3fec49b1c916a701058ef2445b4c07005c30673)
src/openvpnserv/automatic.c
src/openvpnserv/common.c
src/openvpnserv/interactive.c
src/openvpnserv/service.c
src/openvpnserv/service.h