Bug 1035758 - openvpn init script adds '--daemon' preventing to use this option in config file
Summary: openvpn init script adds '--daemon' preventing to use this option in config file
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: openvpn
Version: el6
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: David Sommerseth
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-28 11:52 UTC by Marcin Marzec
Modified: 2018-03-01 13:16 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-01 13:16:27 UTC
Type: Bug


Attachments (Terms of Use)

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.


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