Bug 1444601 - OpenVPN fails to launch due to missing /var/run directory
Summary: OpenVPN fails to launch due to missing /var/run directory
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: openvpn
Version: epel7
Hardware: x86_64
OS: Linux
Target Milestone: ---
Assignee: David Sommerseth
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2017-04-23 04:43 UTC by Dan Tucny
Modified: 2017-05-16 13:55 UTC (History)
6 users (show)

Fixed In Version: openvpn-2.4.2-2.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2017-05-16 13:55:26 UTC

Attachments (Terms of Use)

Description Dan Tucny 2017-04-23 04:43:06 UTC
Description of problem:
When starting openvpn with the new openvpn-server@instance unit on a fresh install, it fails complaining about /run/openvpn-server/status-instance.log not existing.

Indeed the directory /run/openvpn-server does not exist.

After a reboot, the directory has been created.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. yum install openvpn
2. Create openvpn config in /etc/openvpn/server/instance.conf
3. systemctl start openvpn-server@instance
4. journalctl -n 50 -u openvpn-server@instance

Actual results:
systemd[1]: Starting OpenVPN service for ovashrai4...
openvpn[8009]: disabling NCP mode (--ncp-disable) because not in P2MP client or server mode
openvpn[8009]: Options error: --status fails with '/run/openvpn-server/status-ovashrai4.log': No such file or directory
openvpn[8009]: Options error: Please correct these errors.
openvpn[8009]: Use --help for more information.
systemd[1]: openvpn-server@ovashrai4.service: main process exited, code=exited, status=1/FAILURE
systemd[1]: Failed to start OpenVPN service for ovashrai4.
systemd[1]: Unit openvpn-server@ovashrai4.service entered failed state.
systemd[1]: openvpn-server@ovashrai4.service failed.

Expected results:
Initialization Sequence Completed

Additional info:

The issue would appear to be that while /usr/lib/tmpfiles.d/openvpn.conf is packaged that defines this (and the /run/openvpn-client) directory, package install does not trigger their creation.

Possible solution would be to add the following in post-install:
systemd-tmpfiles --create openvpn.conf

Comment 1 Garrett Holmstrom 2017-05-11 20:48:38 UTC
Generally one should include those files in the package itself, such as by creating them in %install like the example in the tmpfiles.d wiki page does.  That helps ensure rpm can track their ownership and makes removal work the way people expect.

Comment 2 Fedora Update System 2017-05-11 21:30:32 UTC
openvpn-2.4.2-2.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-c9f915d837

Comment 3 David Sommerseth 2017-05-11 23:41:30 UTC
A similar fix is coming to F25, F26 and Rawhide as well.

Comment 4 Fedora Update System 2017-05-12 19:56:31 UTC
openvpn-2.4.2-2.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-c9f915d837

Comment 5 Fedora Update System 2017-05-16 13:55:26 UTC
openvpn-2.4.2-2.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.