Comment 22 for bug 1771650

Revision history for this message
Danil Gerun (danil625) wrote :

I also came across this issue.
This is a not quite obvious thing in the default installation (I mean the @-services).

As far as I could get it (and found in internets), the service relies on the init-script:
/etc/init.d/openvpn

which only starts the found .conf files if the AUTOSTART var = "all":
    if test -z "$AUTOSTART" -o "x$AUTOSTART" = "xall" ; then
      # all VPNs shall be started automatically
      for CONFIG in `cd $CONFIG_DIR; ls *.conf 2> /dev/null`; do
        NAME=${CONFIG%%.conf}
        start_vpn
      done

BUT /etc/default/openvpn has this:
#AUTOSTART="all"
#AUTOSTART="none"

The AUTOSTART is not defined anywhere. Fix me if I'm wrong.

In order to fix it as much closer to "default options" as possible, I installed from the OpenVPN repo, which (surpsise) has this in the init-script:

===
# Source defaults file; edit that file to configure this script.
AUTOSTART="all"
STATUSREFRESH=10
OMIT_SENDSIGS=0
if test -e /etc/default/openvpn ; then
  . /etc/default/openvpn
fi
===

So this var is actually pre-defined, according to the "defaults"-file description (see below).

I'd actually really call it a bug, since the "defaults" file contains:
# Start only these VPNs automatically via init script.
# Allowed values are "all", "none" or space separated list of
# names of the VPNs. If empty, "all" is assumed.

The last sentence..