Problem starting openvpn-client@service.service

Need help configuring your VPN? Just post here and you'll get that help.

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

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
cliffhanger
OpenVpn Newbie
Posts: 6
Joined: Thu Dec 06, 2018 9:43 am

Problem starting openvpn-client@service.service

Post by cliffhanger » Thu Dec 06, 2018 4:18 pm

Hello

I'm new to the forum and a newbie to VPN's - bear with me.

I've just installed the latest Openvpn on Ubuntu 16.04 using systemd. Two questions to start:

1) Do I need to start the server service to setup a simple VPN through a provider or whatever?

2) I assume the client service has to be running, at startup, to setup a VPN using a connection manager like Connman or Networkmanger?

I assumed that 2) is true and enabled the service, but get the following errors(journalctl -xe):

openvpn-client@service.service - OpenVPN tunnel for service
Loaded: loaded (/lib/systemd/system/openvpn-client@.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2018-12-06 15:58:28 GMT; 8s ago
Docs: man:openvpn(8)
https://community.openvpn.net/openvpn/w ... n24ManPage
https://community.openvpn.net/openvpn/wiki/HOWTO
Process: 9018 ExecStart=/usr/sbin/openvpn --suppress-timestamps --nobind --config %i.conf (code=exited, status=210/CHROOT)
Main PID: 9018 (code=exited, status=210/CHROOT)

Dec 06 15:58:28 cliffhangers systemd[1]: Starting OpenVPN tunnel for service...
Dec 06 15:58:28 cliffhangers systemd[9018]: openvpn-client@service.service: Failed at step CHROOT spawning /usr/sbin/openvpn: No such file or directory
Dec 06 15:58:28 cliffhangers systemd[1]: openvpn-client@service.service: Main process exited, code=exited, status=210/CHROOT
Dec 06 15:58:28 cliffhangers systemd[1]: Failed to start OpenVPN tunnel for service.
Dec 06 15:58:28 cliffhangers systemd[1]: openvpn-client@service.service: Unit entered failed state.
Dec 06 15:58:28 cliffhangers systemd[1]: openvpn-client@service.service: Failed with result 'exit-code'

Any ideas here?

I thought this might have been connected to the 'spawn' package. But it seems not. If I run '/usr/sbin/openvpn' from the command line it's functional.

Thanks

Cliff

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Problem starting openvpn-client@service.service

Post by TinCanTech » Fri Dec 07, 2018 2:08 pm

cliffhanger wrote:
Thu Dec 06, 2018 4:18 pm
(code=exited, status=210/CHROOT)
I expect you have not chroot'ed correctly, it's tricky to get right and I have never even tried while using systemd.

cliffhanger
OpenVpn Newbie
Posts: 6
Joined: Thu Dec 06, 2018 9:43 am

Re: Problem starting openvpn-client@service.service

Post by cliffhanger » Fri Dec 07, 2018 8:59 pm

Thanks for getting back. This is the .conf file under/etc/openvpn:


remote vpn-se8.privatevpn.com 1194 udp
nobind
dev tun

# Options
tun-ipv6
remote-cert-tls server
client
comp-lzo
persist-key
persist-tun
verb 3

# Crypto
cipher AES-128-CBC
auth SHA256
auth-user-pass /etc/openvpn/privatvpn.login
script-security 2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf

# Cert

I assume Chroot is not connected to this? Is this an openvpn problem or systemd?

thanks

Cliff

cliffhanger
OpenVpn Newbie
Posts: 6
Joined: Thu Dec 06, 2018 9:43 am

Re: Problem starting openvpn-client@service.service

Post by cliffhanger » Sat Dec 08, 2018 2:44 pm

The other thing is why chroot, which I use quite often in a year, would be involved in trying to get a vpn up?

Cliff

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Problem starting openvpn-client@service.service

Post by TinCanTech » Sat Dec 08, 2018 3:04 pm

Perhaps your openvpn client log will have some information.

I am using openvpn on ubuntu 16.04 in exactly the same way as you and it is working for me.

cliffhanger
OpenVpn Newbie
Posts: 6
Joined: Thu Dec 06, 2018 9:43 am

Re: Problem starting

Post by cliffhanger » Sat Dec 22, 2018 10:06 pm

Hi

Well stupid me. The problem was the dir placing. Should have been /etc/openvpn/client NOT /etc/openvpn.

I now get

openvpn-client@service.service - OpenVPN tunnel for service
Loaded: loaded (/lib/systemd/system/openvpn-client@.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2018-12-22 21:54:55 GMT; 2s ago
Docs: man:openvpn(8)
https://community.openvpn.net/openvpn/w ... n24ManPage
https://community.openvpn.net/openvpn/wiki/HOWTO
Process: 8821 ExecStart=/usr/sbin/openvpn --suppress-timestamps --nobind --config %i.conf (code=exited, status=1/FAILURE)
Main PID: 8821 (code=exited, status=1/FAILURE)

Dec 22 21:54:55 cliffhangers systemd[1]: Starting OpenVPN tunnel for service...
Dec 22 21:54:55 cliffhangers openvpn[8821]: Options error: In [CMD-LINE]:1: Error opening configuration file: service.conf
Dec 22 21:54:55 cliffhangers openvpn[8821]: Use --help for more information.
Dec 22 21:54:55 cliffhangers systemd[1]: openvpn-client@service.service: Main process exited, code=exited, status=1/FAILURE
Dec 22 21:54:55 cliffhangers systemd[1]: Failed to start OpenVPN tunnel for service.
Dec 22 21:54:55 cliffhangers systemd[1]: openvpn-client@service.service: Unit entered failed state.
Dec 22 21:54:55 cliffhangers systemd[1]: openvpn-client@service.service: Failed with result 'exit-code'

I have a 'conf' file from my provider which works if started manually. How do i get the client service to see this? The 'openvpn-client@service' file is now pointing to the right directory.

thanks

Cliff

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Problem starting openvpn-client@service.service

Post by TinCanTech » Sun Dec 23, 2018 1:19 am

Can you run your openvpn config file without using systemd ?

Something like:

Code: Select all

me@home: /root # cd /etc/openvpn/client
me@home: /etc/openvpn/client # openvpn service.conf

cliffhanger
OpenVpn Newbie
Posts: 6
Joined: Thu Dec 06, 2018 9:43 am

Re: Problem starting openvpn-client@service.service

Post by cliffhanger » Sun Dec 30, 2018 8:32 pm

Yes and get a connection. It's the 'openvpn-client@service' file that is the problem.

Thanks

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Problem starting openvpn-client@service.service

Post by TinCanTech » Mon Dec 31, 2018 5:23 pm

TinCanTech wrote:
Sun Dec 23, 2018 1:19 am
Can you run your openvpn config file without using systemd ?
cliffhanger wrote:
Sun Dec 30, 2018 8:32 pm
Yes and get a connection
OK.
cliffhanger wrote:
Sat Dec 22, 2018 10:06 pm
Options error: In [CMD-LINE]:1: Error opening configuration file: service.conf
The file name is incorrect ..

cliffhanger
OpenVpn Newbie
Posts: 6
Joined: Thu Dec 06, 2018 9:43 am

Re: Problem starting openvpn-client@service.service

Post by cliffhanger » Wed Jan 02, 2019 7:43 am

Thanks but I don't have a file called service.conf and when I rename the current configuration file to 'service' it makes no difference. Cliff

csadam
OpenVpn Newbie
Posts: 1
Joined: Mon Aug 24, 2020 12:05 pm

Re: Problem starting openvpn-client@service.service

Post by csadam » Mon Aug 24, 2020 12:17 pm

Hi cliffhanger!

I've wasted some time today with the same problem on Ubuntu 20. Finally I've found the solution.
There are a lot of systemd magic happening in the background and I've not found any documentation of these OpenVPN related services.
So I can't explain how it works....
But the solution is to start the service like this:

Code: Select all

sudo systemctl start openvpn@client
where the "client" is the .conf file name in /etc/openvpn.
You can use any name for the .conf file, just use the same name after the @ in the command.

Alternatively, you can use the

Code: Select all

sudo systemctl start openvpn-client@client
The difference is that it tries to find the config file in '/etc/openvpn/client'. Also this service is disabled by default on Ubuntu 20.

User avatar
Pippin
Forum Team
Posts: 1201
Joined: Wed Jul 01, 2015 8:03 am
Location: irc://irc.libera.chat:6697/openvpn

Re: Problem starting openvpn-client@service.service

Post by Pippin » Mon Aug 24, 2020 12:48 pm

I gloomily came to the ironic conclusion that if you take a highly intelligent person and give them the best possible, elite education, then you will most likely wind up with an academic who is completely impervious to reality.
Halton Arp

Post Reply