3

I used to have a config for openvpn. After upgrading to 18.04 it started behaving differently in relation to systemd, my syslog gets continuously spammed with connection attempts:

ovpn-login[5191]: Options error: In [CMD-LINE]:1: Error opening configuration file: /etc/openvpn/login.conf
ovpn-login[5191]: Use --help for more information.
systemd[1]: openvpn@login.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: openvpn@login.service: Failed with result 'exit-code'.

The login.conf does not exist and should not exist - I want to clean this up and get rid of the entry so it stops trying to connect to a service that doesn't exist.

I've tried systemctl kill openvpn@login.service, systemctl disable openvpn@login.service both with systemctl daemon-reload afterwards to no avail.

However, there is no file that matches openvpn@login.service anywhere, it is templated from /lib/systemd/system/openvpn-client@.service.

Presumably I need to keep that file around should I want to add some VPN configs in the future. I did try removing it and doing systemctl daemon-reload as per an answer elsewhere on StackExchange, again, to no avail.

How do I get rid of this spurious systemd configuration entry?


Edit: even after apt purge openvpn and trying to remove all traces it still has:

openvpn@login.service: Failed to schedule restart job: Unit openvpn@login.service not found.

Where is it picking this up from?

3 Answers 3

2

Check the /etc/default/openvpn file to see if you've got it in the AUTOSTART section, eg. AUTOSTART="login". If not, the default is "all" in your openvpn path, eg. /etc/openvpn/. Any .conf file in that directory will trigger an attempt at starting that specifically named service. For example, /etc/openvpn/login.conf.

I just had this exact same problem happen to me with my upgrade to 18.04. All of a sudden it tried to start every .conf file in my openvpn directory as an openvpn tunnel.

If your auth-user-pass in your vpn config file just so happens to be pointing to login.config, you'll need to rename that to something like login.secret to keep this from happening. Or just name the AUTOSTART='myvpn' in /etc/default/openvpn to match your myvpn.conf for your vpn connection in /etc/openvpn/.

0

Bounced into same issue, found zero reference to that service anywhere in the system. I switched to different OpenVPN config so also made a new service for that and wanted to get rid of the previous one.

As stated disable didn't have any effect and I did not find any evidence of it by fulltext or other search on the system. My guess is, it's maybe somewhere in systemd binary magic world.

I ended up masking it and it seems to at least help that it's not being triggered and started.

sudo systemctl mask openvpn@login.service

-1

You want:

systemctl stop openvpn@login.service
systemctl disable openvpn@login.service

The stop is to halt the current error, and the disable is so that it doesn't auto start on a reboot/system daemon reload.

I've confirmed this works:

Oct 31 13:46:36 raspberrypi systemd[1]: openvpn@server.service: Service RestartSec=5s expired, scheduling restart.
Oct 31 13:46:36 raspberrypi systemd[1]: openvpn@server.service: Scheduled restart job, restart counter is at 101.
Oct 31 13:46:36 raspberrypi systemd[1]: Stopped OpenVPN connection to server.
Oct 31 13:46:36 raspberrypi systemd[1]: Starting OpenVPN connection to server...
Oct 31 13:46:36 raspberrypi ovpn-server[4085]: Options error: In [CMD-LINE]:1: Error opening configuration file: /etc/openvpn/server.conf
Oct 31 13:46:36 raspberrypi ovpn-server[4085]: Use --help for more information.
Oct 31 13:46:36 raspberrypi systemd[1]: openvpn@server.service: Main process exited, code=exited, status=1/FAILURE
Oct 31 13:46:36 raspberrypi systemd[1]: openvpn@server.service: Failed with result 'exit-code'.
Oct 31 13:46:36 raspberrypi systemd[1]: Failed to start OpenVPN connection to server.
Oct 31 13:46:41 raspberrypi systemd[1]: Stopped OpenVPN connection to server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.