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>
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() {