Bug 1035758

Summary: openvpn init script adds '--daemon' preventing to use this option in config file
Product: [Fedora] Fedora EPEL Reporter: Marcin Marzec <m.marzec>
Component: openvpnAssignee: David Sommerseth <dazo>
Status: CLOSED CANTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: el6CC: dazo, gwync, huzaifas, steve
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-01 13:16:27 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:

Description Marcin Marzec 2013-11-28 11:52:44 UTC
Description of problem:
In openvpn init script openvpn is called with option '--daemon' without extra args. This prevents adding daemon option in configuration.

After putting daemon option in config file and starting service there is warning message log:

WARNING: Multiple --daemon directives specified, ignoring --daemon some-name. (Note that initscripts sometimes add their own --daemon directive.)


This is part from openvpn documentation that explains --daemon option:
"
--daemon [progname]
Become a daemon after all initialization functions are completed. This option will cause all message and error output to be sent to the syslog file (such as /var/log/messages), except for the output of scripts and ifconfig commands, which will go to /dev/null unless otherwise redirected. The syslog redirection occurs immediately at the point that --daemon is parsed on the command line even though the daemonization point occurs later. If one of the --log options is present, it will supercede syslog redirection.
The optional progname parameter will cause OpenVPN to report its program name to the system logger as progname. This can be useful in linking OpenVPN messages in the syslog file with specific tunnels. When unspecified, progname defaults to "openvpn".

When OpenVPN is run with the --daemon option, it will try to delay daemonization until the majority of initialization functions which are capable of generating fatal errors are complete. This means that initialization scripts can test the return status of the openvpn command for a fairly reliable indication of whether the command has correctly initialized and entered the packet forwarding event loop.
"


So I see no reason to preventing to set this option in configs.





Version-Release number of selected component (if applicable):
el6, f18, master
Basicly this occurs both in sysvinit scripts for el6 and in systemd scripts on master branch.


Steps to Reproduce:
1. Create openvpn server serrvice with config file in /etc/openvpn/
2. Configure this service with putting 'daemon some-name' in config file.
3. Start this openvpn service

Actual results:
WARNING: Multiple --daemon directives specified, ignoring --daemon some-name. (Note that initscripts sometimes add their own --daemon directive.)


Expected results:
openvpn service logs to syslog with proper configured daemon name


Additional info:

Comment 1 David Sommerseth 2018-03-01 13:16:27 UTC
--daemon is now (as of openvpn-2.4.x) ignored due to the systemd integration.  It results in a NOOP when OpenVPN is started via systemctl.

And due to the much improved systemd integration, the new
openvpn-{client,server}@.service units which gives direct access to individual logs for each configuration via journalctl, I consider this ticket no longer valid.

If you still need logs via syslog, please try to use --syslog some-identifier instead of --daemon some-identifier.

Closing this as CANTFIX, as this is not something can or should try to fix any longer.