Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

It seems this is a known bug/limitation in the design of the Systemd framework in combination with OpenVPN. Since OpenVPN supports multiple servers, each daemon requires a separate configuration file, which Systemd does not support "out of the box". The solution is to create a /etc/systemd/system/<server>.service file for each openvpn <server>.conf file.

Mine looks like:

[Unit]
Description=OpenVPN Robust And Highly Flexible Tunneling Application On <server>
After=syslog.target network.target

[Service]
Type=forking
PIDFile=/var/run/openvpn/<server>.pid
ExecStart=/usr/sbin/openvpn --daemon --writepid /var/run/openvpn/<server>.pid --cd /etc/openvpn/ --config <server>.conf

[Install]
WantedBy=multi-user.target

Replace <server> with the name of your configuration file.

Then, I simply call:

sudo systemctl enable <server>.service
sudo systemctl start <server>.service

After I rebooted, the service was started automatically.