Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#37059 - [openvpn] add PIDFile to openvpn@.service

Attached to Project: Arch Linux
Opened by Fabian Stegemann (zetaron) - Wednesday, 25 September 2013, 17:46 GMT
Last edited by Thomas Bächler (brain0) - Saturday, 03 May 2014, 07:08 GMT
Task Type Feature Request
Category Packages: Core
Status Closed
Assigned To Thomas Bächler (brain0)
Architecture All
Severity Very Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
It would be nice, if the openvpn systemd service could create a pid file.

Additional info:
* package version(s): 2.3.2-1

I attached a .service file, which does the magic.
This task depends upon

Closed by  Thomas Bächler (brain0)
Saturday, 03 May 2014, 07:08 GMT
Reason for closing:  Implemented
Comment by Dave Reisner (falconindy) - Wednesday, 25 September 2013, 17:57 GMT
Why? Does systemd pick the wrong MainPID to follow? What does this fix?
Comment by Fabian Stegemann (zetaron) - Thursday, 26 September 2013, 16:43 GMT
No there is no bug, it's more like an enhancement.
In my particular case i had to detect if openvpn is running and if it's in a specific mode (client/server).
The easiest way to do so is to check if the pid file exists in /run.
Therefore my intention was to suggest the extension of the service file to support pid file creation.
Comment by Dave Reisner (falconindy) - Thursday, 26 September 2013, 16:55 GMT
Seems like you could just use systemctl for that....

systemctl is-active openvpn@$template.service
Comment by Michael B. (mgb) - Monday, 14 April 2014, 13:33 GMT
Current unit file implementation is against systemd recomendations (http://www.freedesktop.org/software/systemd/man/daemon.html). See "Integration with Systemd", "Writing Systemd Unit Files":

"If possible, do not use the Type=forking setting in service files. But if you do, make sure to set the PID file path using PIDFile=. See systemd.service(5) for details."

That is just for info. Don't know what happens (actual or in future) if unit file is not implemented as recomended. And don't know what others say about systemd definition of "new style daemons".
Comment by Thomas Bächler (brain0) - Monday, 14 April 2014, 13:42 GMT
This would require that we hardcode the --writepid option. While it should work, that would (as far as I can see) override any --writepid option that a user puts into the configuration file. OpenVPN is always only a single PID, so systemd's GuessMainPID=yes mechanism (enabled by default) work correctly and the main PID is always determined correctly.

I'd much rather have a --systemd option in openvpn so I can use Type=notify - the OpenVPN guys are pretty open to such things IIRC, so maybe I will propose a patch at some point.
Comment by Michael B. (mgb) - Tuesday, 15 April 2014, 14:40 GMT
+1 for doing this upstream.

OpenVPN includes init scripts for "old style init" (e.g. https://github.com/OpenVPN/openvpn/blob/release/2.3/distro/rpm/openvpn.init.d.rhel). So why not include systemd service files in OpenVPN. This is nothing distro specific - from my point of view.





Comment by Thomas Bächler (brain0) - Tuesday, 15 April 2014, 14:49 GMT
I am not only talking about adding a systemd unit upstream, but support for sd_notify in OpenVPN itself, to avoid forking altogether.

Loading...