openvpn service file missing?

Issues related to applications and software problems
Post Reply
Whoever
Posts: 1361
Joined: 2013/09/06 03:12:10

openvpn service file missing?

Post by Whoever » 2017/04/22 21:54:37

I am a new to systemd, please help me with this issue:
I have a CentOS 7 VM, and installed openvpn from the EPEL repository. I checked that it is using the CentOS7 EPEL repo.

I installed all the configuration files needed for openvpn, but when I try to start it, I get:

Code: Select all

# systemctl start  openvpn.service
Failed to start openvpn.service: Unit not found.

User avatar
TrevorH
Site Admin
Posts: 33218
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: openvpn service file missing?

Post by TrevorH » 2017/04/22 21:59:06

I think it's one of those where you get an openvpn@.service file and you start it by using the name of the config file
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Whoever
Posts: 1361
Joined: 2013/09/06 03:12:10

Re: openvpn service file missing?

Post by Whoever » 2017/04/23 00:33:30

Where do I get the file and then what? I said I am a novice with systemd.

User avatar
jlehtone
Posts: 4530
Joined: 2007/12/11 08:17:33
Location: Finland

Re: openvpn service file missing?

Post by jlehtone » 2017/04/23 11:47:34

A "template" is already in the package.

You simply create a config for a connection.
Let say you have defined connection "foo", i.e. have config file "/etc/openvpn/foo.conf".

Then you start:

Code: Select all

systemctl start  openvpn@foo.service
However, if on GUI, then you can use NetworManager's applet to define a connection and start it too.
That approach does in fact store config for the connection into somewhere else than /etc/openvpn.

Whoever
Posts: 1361
Joined: 2013/09/06 03:12:10

Re: openvpn service file missing?

Post by Whoever » 2017/04/23 15:29:45

jlehtone wrote:A "template" is already in the package.

You simply create a config for a connection.
Let say you have defined connection "foo", i.e. have config file "/etc/openvpn/foo.conf".

Then you start:

Code: Select all

systemctl start  openvpn@foo.service
However, if on GUI, then you can use NetworManager's applet to define a connection and start it too.
That approach does in fact store config for the connection into somewhere else than /etc/openvpn.
Thank you, that worked.

A further question: how do I set environment variables before starting the daemon? Obviously, if I am starting it in a shell, I can set them, but if the system is starting the daemon?

I need to set a couple of environment variable to make openvpn accept md5 certs. Obviously, I really need to regenerate the certs, but until I do this, I need a temporary solution.

User avatar
jlehtone
Posts: 4530
Joined: 2007/12/11 08:17:33
Location: Finland

Re: openvpn service file missing?

Post by jlehtone » 2017/04/23 22:38:39

With systemd?

The configuration can set environment for a service. Preferably with a "drop-in":
https://access.redhat.com/documentation ... nit_Config

Post Reply