From 1d31d840d45a2bce86c1a7b1871e86dd20b39cf2 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Wed, 13 Dec 2017 10:32:26 +0100 Subject: [PATCH] strongswan: fix reload service Based on the ipsec running state reload_service is either reloading ipsec or starting ipsec. However in the latter case it calls ipsec start which bypasses the procd start_service function which means the running ipsec instance is not managed by procd. Fix this by calling start in case ipsec is not running; at the same time add service_running function which is used by procd provided running function. Signed-off-by: Hans Dedecker --- net/strongswan/files/ipsec.init | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/net/strongswan/files/ipsec.init b/net/strongswan/files/ipsec.init index 311679d69a..1e0adfd114 100644 --- a/net/strongswan/files/ipsec.init +++ b/net/strongswan/files/ipsec.init @@ -318,14 +318,19 @@ prepare_env() { config_foreach config_remote remote } +service_running() { + ipsec status > /dev/null 2>&1 +} + reload_service() { - prepare_env - if ipsec status > /dev/null 2>&1; then + running && { + prepare_env ipsec rereadall ipsec reload - else - ipsec start - fi + return + } + + start } service_triggers() { -- 2.30.2