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 <dedeckeh@gmail.com>
This commit is contained in:
parent
49b519fed4
commit
1d31d840d4
1 changed files with 10 additions and 5 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue