OpenVPN as a service config problem

This forum is for general conversation and user-user networking.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
rostfrei
OpenVpn Newbie
Posts: 3
Joined: Mon Nov 07, 2011 10:57 am

OpenVPN as a service config problem

Post by rostfrei » Mon Nov 07, 2011 11:08 am

Hello!

I have two sub folders in the C:\Program Files (x86)\OpenVPN\config folder. In each of sub folders there is .ovpn config file and connection certificates. I can connect/disconnect vpns with OpenVPN GUI without a problem and separate log files are created for every config file. I don't want to do this manually anymore so I want to create vpn connections automatically with OpenVPN as a service. OpenVPN service is started without a problem, but nothing happens and no logs are created. Some trial and error gave me a hint that service does not handle sub folders in the C:\Program Files (x86)\OpenVPN\config folder config folder. If I put .ovpn config files in the root of the C:\Program Files (x86)\OpenVPN\config folder, it starts to work. But I really don't want to do this. Is there some way to fix the problem? Why does it work with GUI program, but not with OpenVPN as a service?

Thank you for all your help and suggestions,
Marko Kukovec

User avatar
maikcat
Forum Team
Posts: 4200
Joined: Wed Jan 12, 2011 9:23 am
Location: Athens,Greece
Contact:

Re: OpenVPN as a service config problem

Post by maikcat » Mon Nov 07, 2011 12:25 pm

quote from installation notes

The openvpnserv.exe program (the service wrapper) gets several string parameters from the registry which can be modified by the user. If you change any of these parameters, you should be able to upgrade OpenVPN to a new version without the installer overwriting your changes:

HKEY_LOCAL_MACHINE\SOFTWARE\OpenVPN

config_dir
configuration file directory to scan, defaults to "\Program Files\OpenVPN\config"
config_ext
file extension on configuration files, defaults to "ovpn"
exe_path
path to openvpn.exe, defaults to "\Program Files\OpenVPN\bin\openvpn.exe"
log_dir
log file directory, defaults to "\Program Files\OpenVPN\log"
log_append
if set to "1", multiple instantiations of an OpenVPN process will append onto the same log file, if set to "0" (default), each new instantiation will truncate the previous log file
priority
the windows priority class for each instantiated OpenVPN process, can be one of:

* "IDLE_PRIORITY_CLASS"
* "BELOW_NORMAL_PRIORITY_CLASS"
* "NORMAL_PRIORITY_CLASS" (default)
* "ABOVE_NORMAL_PRIORITY_CLASS"
* "HIGH_PRIORITY_CLASS"

hope that helps

Michael.
Amiga 500 , Zx +2 owner
Long live Dino Dini (Kick off 2 Creator)

Inflammable means flammable? (Dr Nick Riviera,Simsons Season13)

"objects in mirror are losing"

rostfrei
OpenVpn Newbie
Posts: 3
Joined: Mon Nov 07, 2011 10:57 am

Re: OpenVPN as a service config problem

Post by rostfrei » Mon Nov 07, 2011 8:02 pm

I am aware of this info from http://openvpn.net/index.php/open-sourc ... ml?start=1 page, but I can't see how does this info help to solve my problem? I also noticed, that service does not reconnect vpn connections when computer is woken from sleep or hibernate state.

With regards,
Marko Kukovec

User avatar
maikcat
Forum Team
Posts: 4200
Joined: Wed Jan 12, 2011 9:23 am
Location: Athens,Greece
Contact:

Re: OpenVPN as a service config problem

Post by maikcat » Tue Nov 08, 2011 7:33 am

the only *sideeffect* is that all ovpn files must be in the same directory

you can still keep the keys/logs where you want to.

>Why does it work with GUI program, but not with OpenVPN as a service?

maybe because is uses a different binary..

Michael.
Amiga 500 , Zx +2 owner
Long live Dino Dini (Kick off 2 Creator)

Inflammable means flammable? (Dr Nick Riviera,Simsons Season13)

"objects in mirror are losing"

rostfrei
OpenVpn Newbie
Posts: 3
Joined: Mon Nov 07, 2011 10:57 am

Re: OpenVPN as a service config problem

Post by rostfrei » Tue Nov 08, 2011 7:48 am

There are two side effects, files must be in the same directory and no reconnect happens when woken from sleep or hibernate. I gave up on service and solved the problem by creating new string value in

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

value: OpenVpnGUI
value data: "C:\Program Files (x86)\OpenVPN\bin\openvpn-gui-1.0.3.exe" --connect siwim.ovpn --connect svn.ovpn --silent_connection 1 --show_balloon 0

Of course shortcut with the same properties could be added to the 'Startup' directory. It does exactly what I want.

Nonetheless, thank you for your effort!

Marko

Post Reply