3

Yesterday I configured OpenVPN on a Ubuntu 18.04 server which seems to work. I can connect no problem and systemctl status openvpn gives me green. However, my syslog is being riddled with errors which seem to relate to a different service than openvpn.service. I am kind of unsettled by this since the server goes into use tomorrow and the only way to get access then is via openvpn.

Here is the syslog:

Jun 22 15:30:41 localhost systemd[1]: [email protected]: Main process e xited, code=exited, status=1/FAILURE
Jun 22 15:30:41 localhost systemd[1]: [email protected]: Failed with re sult 'exit-code'.
Jun 22 15:30:41 localhost systemd[1]: Failed to start OpenVPN connection to multi-user.
Jun 22 15:30:47 localhost systemd[1]: [email protected]: Service hold-off time over, scheduling restart.
Jun 22 15:30:47 localhost systemd[1]: [email protected]: Scheduled restart job, restart counter is at 146.
Jun 22 15:30:47 localhost systemd[1]: Stopped OpenVPN connection to multi-user.
Jun 22 15:30:47 localhost systemd[1]: Starting OpenVPN connection to multi-user...
Jun 22 15:30:47 localhost ovpn-multi-user[3046]: Options error: In [CMD-LINE]:1:Error opening configuration file: /etc/openvpn/multi-user.conf
Jun 22 15:30:47 localhost ovpn-multi-user[3046]: Use --help for more information.
Jun 22 15:30:47 localhost systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
Jun 22 15:30:47 localhost systemd[1]: [email protected]: Failed with result 'exit-code'.
Jun 22 15:30:47 localhost systemd[1]: Failed to start OpenVPN connection to multi-user.
Jun 22 15:30:52 localhost systemd[1]: [email protected]: Service hold-off time over, scheduling restart.
Jun 22 15:30:52 localhost systemd[1]: [email protected]: Scheduled restart job, restart counter is at 147.
Jun 22 15:30:52 localhost systemd[1]: Stopped OpenVPN connection to multi-user.
Jun 22 15:30:52 localhost systemd[1]: Starting OpenVPN connection to multi-user.
1

2 Answers 2

2

I initially worked around the issue by putting the following line in my rc.local:

systemctl stop [email protected]

I finally solved it by disabling the deprecated [email protected], removing all configuration files from the OpenVPN root directory and moving them to the server directory, as well as activating the respective [email protected].

1
  • Good you've fixed it. Don't forget to accept your own answer. Commented Jun 24, 2018 at 17:00
0

Under systemd, at least on Debian (and presumably Ubuntu) each VPN connection (there can be multiple) gets its own service name [email protected]. You should have one per *.conf file in /etc/openvpn/.

The actual openvpn.service is a collection of all of them, to let you easily start/stop/reload all VPNs at once. Getting status on it isn't telling you much useful.

So you need to try systemctl status [email protected] or journalctl [email protected], as it'd appear your VPN is exiting for some reason. Of course, that could be something simple and expected like network issues, remote end disconnected, etc. (OpenVPN can be configured to exit when the VPN goes down.)

You can see all the OpenVPN units using something like systemctl list-units | grep openvpn or probably systemctl show --property ConsistsOf openvpn.service

10
  • Thank you for your reply, good to hear my thoughts went into the right direction. The problem seems to be that something tries to start a openvpn service with the connection name "multi-user" and that doesn't exist. How do I fix this? Commented Jun 22, 2018 at 16:39
  • @AlpayY I'd start by seeing if you accidentally symlinked it into one of the systemd startup directories. E.g., somehow when trying to get your VPN started by multi-user.target. If you're lucky, systemctl show --property WantedBy [email protected] will yield something useful. Or look through the journal. Commented Jun 22, 2018 at 16:41
  • The ouput of that command is WantedBy=multi-user.target. I also see this line at the end of /lib/systemd/system/[email protected]: [Install] WantedBy=multi-user.target So do I just remove it? Just fyi, I didn't touch my openvpn installation apart from creating config files. This is it's default behaviour out of the box. Commented Jun 22, 2018 at 16:44
  • @AlpayY Yes, that install means when you do systemctl enable [email protected], it'll be linked into /etc/systemd/system/multi-user.target.wants/ — I suspect you may have a link there for your non-existent VPN (because you did systemctl enable [email protected]) Commented Jun 22, 2018 at 16:45
  • @AlpayY anyway, systemctl disable [email protected] ought to fix it (and of course reboot your system before shipping it out, just be sure everything is still working) Commented Jun 22, 2018 at 16:46

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.