On 07/09/17 14:17, Samuli Seppänen wrote:
> On 07/09/2017 11:13, Gert Doering wrote:
>> Hi,
>>
>> On Thu, Sep 07, 2017 at 11:04:01AM +0300, Samuli Seppänen wrote:
>>> "Note that units which are configured for Restart= and which reach the
>>> start limit are not attempted to be restarted anymore; however, they may
>>> still be restarted manually at a later point, from which point on, the
>>> restart logic is again activated."
>>
>> Which is not what I hoped for... "turn it off and leave it so" is non
>> helpful (it might be a transient error preventing the startup).
>>
> 
> Good point. Systemd seems to be able to adjust its restart behavior
> depending on exit code of the main service process (i.e. OpenVPN) using
> "RestartForceExitStatus" and "RsstartPreventExitStatus"[1]. Perhaps
> these could be helpful in our case...

Okay, lets try to align what OpenVPN does in various scenarios and
compare it how we want restarts to happen.

First, have a look at the man page:
<https://www.freedesktop.org/software/systemd/man/systemd.service.html#Restart=>

Then realise that OpenVPN (AFAIK) only operates with two exit codes:

#define OPENVPN_EXIT_STATUS_GOOD                    0
#define OPENVPN_EXIT_STATUS_ERROR                   1
#define OPENVPN_EXIT_STATUS_USAGE                   1
#define OPENVPN_EXIT_STATUS_CANNOT_OPEN_DEBUG_FILE  1
(from error.h)

So the RestartForceExitStatus/RestartPreventExitStatus is not going to
be helpful if all graceful errors results in 1, which is the most common
way OpenVPN stops - through the M_FATAL.  So that leaves us with
SIGSEGV, SIGABRT and similar unclean exit signals.

To avoid restarts on faulty configurations or if we can define scenarios
where we do not want OpenVPN to be restarted automatically, we need to
introduce more exit codes.  This way we can implicitly tell systemd if
it should restart OpenVPN or not.


-- 
kind regards,

David Sommerseth
OpenVPN Technologies, Inc


Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to