Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1444601

Summary: OpenVPN fails to launch due to missing /var/run directory
Product: [Fedora] Fedora EPEL Reporter: Dan Tucny <d>
Component: openvpnAssignee: David Sommerseth <dazo>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: epel7CC: dazo, fkooman, gholms, huzaifas, mauricio.teixeira, steve
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: openvpn-2.4.2-2.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-16 13:55:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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):
2.4.1-2.el7

How reproducible:
Very

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: main process exited, code=exited, status=1/FAILURE
systemd[1]: Failed to start OpenVPN service for ovashrai4.
systemd[1]: Unit openvpn-server entered failed state.
systemd[1]: openvpn-server 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.