Opened 6 years ago

Last modified 6 years ago

#826 new Feature Wish

Suggestion: warn when --config is not the first parameter

Reported by: i336_ Owned by:
Priority: minor Milestone:
Component: Configuration Version: OpenVPN 2.3.6 (Community Ed)
Severity: Not set (select this one, unless your'e a OpenVPN developer) Keywords: config directive override warning


Just fixed a fun issue where my --dev setting wasn't "taking" and OpenVPN was still using tun0.

Eventually I figured out that I was doing

openvpn --ping-restart 0 --dev vpn1234 --dev-type tun --config vpn1234.config --management vpn1234.sock unix --nice 19 --ifconfig-noexec --route-noexec

instead of doing

openvpn --config vpn1234.config --ping-restart 0 --dev vpn1234 --dev-type tun --management vpn1234.sock unix --nice 19 --ifconfig-noexec --route-noexec

Suffice to say I now understand why my --ping-restart 0 wasn't working as well!

My suggestion is that, if --config is not the first parameter, a small warning be displayed that notes that directives in the config file may override commandline arguments. I'm sure that in certain circumstances this will be the desired behavior (eg, a script using pre-baked arguments overriden by config files) but I argue that this is not likely to be what most users are looking for, and that those users looking for this behavior will have a reasonable understanding of OpenVPN's configuration and this particular idiosyncrasy.

I'm fine with the fact that things work the way they do; it only took me a little under an hour or so to figure this out as opposed to a whole day, so I'm not overly mad :P

Change History (1)

comment:1 Changed 6 years ago by Selva Nair

In many cases --log (and possibly --cd) should be the first parameter not --config (always the case with connections started by the GUI), so such a warning is often not appropriate. Also multiple --config options are supported, so is --config inside a config file, and all of them cannot be the first option.

Note: See TracTickets for help on using tickets.