Skip to contentSkip to conversation

Writing an OpenVPN-specific NSSM configuration frontend?

Openvpn-devel Samuli Seppänen 2 participants 3 messages Jun 24, 2015 – Jun 29, 2015

lore
Share & tools
lore
#0 lore raw

Hi,

There is a question at the end, so scroll down if you're impatient :). Anyways, some of you may know I've been looking into NSSM:

<http://nssm.cc>

The idea is to use NSSM to replace the OpenVPN Service Wrapper ("openvpnserv.exe") which is buggy, unmaintained, causes all sorts of issues and seems disintegrate more and more with every new Windows release.

NSSM on is actively maintained[1] general purpose service manager which can launch an arbitrary program and restart it if it crashes. NSSM registers itself as a Windows service and manages a set of services, which can be arbitrary programs. In our case nssm.exe would run a command such as this:

..\bin\openvpn.exe --config default.ovpn

The working directory would be set to C:\Program Files\OpenVPN\config. Should an OpenVPN process die, nssm.exe would respawn it immediately. Note that each OpenVPN connection is monitored separately.

For the corporate use-case simply bundling nssm.exe along with instructions and maybe a simple template script would suffice:

<https://community.openvpn.net/openvpn/wiki/IntegratingOpenvpnWithNssm>

However, in the general case we have a problem. OpenVPN connections can be added and removed by the user at a whim, so the user has to be able to configure nssm.exe him/herself at any time. All we'd really need is a GUI similar to this:

---
"OpenVPN connections to launch and monitor automatically on boot:"

[x] foo
[x] bar
[ ] def
---

Checking or unchecking a checkbox would simply run nssm.exe with appropriate command-line parameters. If the user needs more fine-grained control over nssm.exe's behavior he/she can resort to using nssm.exe's GUI or command-line.

After several hours of research I'm leaning towards one of these options:

1) An interactive batch file

This would do the trick, but would be fairly crude and unsophisticated. Powershell would be way better, but Windows Vista (not EOL until 2017) does not have it installed by default.

2) Simple C# GUI application

Write a real C# application would be way more work than #1, but still not a huge task. In addition this application could be later extended for other tasks such as turning on/off openvpnserv.exe and adding/removing tap-windows adapters.

---

Any other suggestions on how to solve this issue? Am I overlooking some obvious? And most importantly: does anyone feel like participating in this fun Windows development adventure? :P

Best regards,

Signature · 7 lines
Samuli Seppänen
Community Manager
OpenVPN Technologies, Inc

irc freenode net: mattock

[1] That said, according Git logs the project is maintained by a single person.
#1 lore raw
Quoted 17 lines · Samuli Seppänen

Hi,

There is a question at the end, so scroll down if you're impatient :). Anyways, some of you may know I've been looking into NSSM:

<http://nssm.cc>

The idea is to use NSSM to replace the OpenVPN Service Wrapper ("openvpnserv.exe") which is buggy, unmaintained, causes all sorts of issues and seems disintegrate more and more with every new Windows release.

NSSM on is actively maintained[1] general purpose service manager which can launch an arbitrary program and restart it if it crashes. NSSM registers itself as a Windows service and manages a set of services, which can be arbitrary programs. In our case nssm.exe would run a command such as this:

Quoted 4 lines

..\bin\openvpn.exe --config default.ovpn

The working directory would be set to C:\Program Files\OpenVPN\config.

If changing the OpenVPN Windows stuff, please also support having config files under user's profile directory, not only in the system-wide config-directory.

-- Pasi

#2 lore raw
Quoted 19 lines · Samuli Seppänen
Quoted 17 lines

Hi,

There is a question at the end, so scroll down if you're impatient :). Anyways, some of you may know I've been looking into NSSM:

<http://nssm.cc>

The idea is to use NSSM to replace the OpenVPN Service Wrapper ("openvpnserv.exe") which is buggy, unmaintained, causes all sorts of issues and seems disintegrate more and more with every new Windows release.

NSSM on is actively maintained[1] general purpose service manager which can launch an arbitrary program and restart it if it crashes. NSSM registers itself as a Windows service and manages a set of services, which can be arbitrary programs. In our case nssm.exe would run a command such as this:

Quoted 9 lines
Quoted 4 lines

..\bin\openvpn.exe --config default.ovpn

The working directory would be set to C:\Program Files\OpenVPN\config.

If changing the OpenVPN Windows stuff, please also support having config files under user's profile directory, not only in the system-wide config-directory.

-- Pasi

Hi,

Nssm.exe does not seem to care at all where the configuration files are located. It just launches processes and monitors them.

Signature · 5 lines
Samuli Seppänen
Community Manager
OpenVPN Technologies, Inc

irc freenode net: mattock