All of lore.kernel.org
 help / color / mirror / Atom feed
* [Openvpn-devel] PID is deleted unconditionally on exit
@ 2021-05-12 20:02 Matthias May
  2021-06-15 18:39 ` Gert Doering
  2021-06-15 18:44 ` David Sommerseth
  0 siblings, 2 replies; 3+ messages in thread
From: Matthias May @ 2021-05-12 20:02 UTC (permalink / raw)
  To: gert@


[-- Attachment #1.1: Type: text/plain, Size: 948 bytes --]

Hi Gert

We recently updated OpenVPN to 2.5.2 and found that the PID
is since [1] unconditionally deleted when OpenVPN exits.
This breaks OpenVPN in our init.
We relied on this file to get the PID to be able to check if the process actually started,
or something went wrong during init, or to see if the process died sometime later.

One could argue that the absence of the PID file is indication enough that the process
doesn't exist anymore, but that doesn't hold up when there are multiple instances running.

Once the process died we used the PID to look in the syslog for clues as to why the process died,
and present the user with an error message based on that.

Can you please revert this unconditional deletion of the file?
Or do you see any alternative to get the PID of a process that
exits immediately (case of misconfiguration)?

BR
Matthias

[1] https://sourceforge.net/p/openvpn/mailman/message/37055147/




[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Openvpn-devel] PID is deleted unconditionally on exit
  2021-05-12 20:02 [Openvpn-devel] PID is deleted unconditionally on exit Matthias May
@ 2021-06-15 18:39 ` Gert Doering
  2021-06-15 18:44 ` David Sommerseth
  1 sibling, 0 replies; 3+ messages in thread
From: Gert Doering @ 2021-06-15 18:39 UTC (permalink / raw)
  To: Matthias May <matthias.may@; +Cc: openvpn-devel

[-- Attachment #1: Type: text/plain, Size: 2970 bytes --]

Hi,

this also got no answer so far, but deserves one.

On Wed, May 12, 2021 at 10:02:30PM +0200, Matthias May via Openvpn-devel wrote:
> We recently updated OpenVPN to 2.5.2 and found that the PID
> is since [1] unconditionally deleted when OpenVPN exits.

Right.

> This breaks OpenVPN in our init.

Sorry for that.

> We relied on this file to get the PID to be able to check if the process actually started, or something went wrong during init, or to see if the process died sometime later.
> 
> One could argue that the absence of the PID file is indication enough that the process
> doesn't exist anymore, but that doesn't hold up when there are multiple instances running.

I do argue that way, and the "multiple instances running" argument does 
not convince me - if you have multiple instances, they must have unique 
PID files anyway, so you can see if "openvpn_instance4.pid" exists or not.

So, at startup, you can have 3 situations

 - openvpn started normally, PID exists, process exists
 - openvpn exited (planned or error exit), PID does not exist
 - openvpn crashed (core dump-style), PID exists, process does not exist

this is fairly easy to figure out whether a given instance started up fine.

> Once the process died we used the PID to look in the syslog for clues as to why the process died,
> and present the user with an error message based on that.
> 
> Can you please revert this unconditional deletion of the file?
> Or do you see any alternative to get the PID of a process that
> exits immediately (case of misconfiguration)?

This depends on how you start these instances - if you start them without
--daemon, and call wait() in the caller, you get the PID of whoever exited
back.  If you use systemd, with named instances, it will tell you in
the journal (by instance named).

To find a certain instance in syslog (if you have no systemd), you can also 
use the "--syslog instance1234" trick - so each instance would send its own
identifier, and you can look for "instance1234[" in syslog.

But generally speaking, a process that is ending normally (and we consider
"error exit" to be "ending normally", as opposed to "SIGSEGV core dump
boom") should not end with any resources still in use - so, tun interface
and routes are cleaned up, pid file is removed, auth_control_files are
removed, etc. - and we really believe in "cleaning up".  OpenVPN did not
always do the right thing (especially cleaning up interfaces on error
exit), but we're getting there.


Again, sorry that we caused work here.

gert
-- 
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             gert@...1296...

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 630 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Openvpn-devel] PID is deleted unconditionally on exit
  2021-05-12 20:02 [Openvpn-devel] PID is deleted unconditionally on exit Matthias May
  2021-06-15 18:39 ` Gert Doering
@ 2021-06-15 18:44 ` David Sommerseth
  1 sibling, 0 replies; 3+ messages in thread
From: David Sommerseth @ 2021-06-15 18:44 UTC (permalink / raw)
  To: Matthias May <matthias.may@

On 12/05/2021 22:02, Matthias May via Openvpn-devel wrote:
> Hi Gert
> 
> We recently updated OpenVPN to 2.5.2 and found that the PID
> is since [1] unconditionally deleted when OpenVPN exits.
> This breaks OpenVPN in our init.

What kind of init system is this?  On what kind of distribution?


-- 
kind regards,

David Sommerseth
OpenVPN Inc



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-15 18:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-12 20:02 [Openvpn-devel] PID is deleted unconditionally on exit Matthias May
2021-06-15 18:39 ` Gert Doering
2021-06-15 18:44 ` David Sommerseth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.