diff --git a/service.c b/service.c index c6507710..e5700968 100644 --- a/service.c +++ b/service.c @@ -430,7 +430,9 @@ void service_stop_dynamic(void) if (svc_is_removed(svc)) new_state = SVC_HALTED_STATE; - dyn_stop_cnt++; + if (!svc_has_sighup(svc)) + dyn_stop_cnt++; + _d("Marking service %s as state %d", svc->cmd, new_state); service_stop(svc, new_state); } diff --git a/svc.h b/svc.h index 3e039e78..b15266f5 100644 --- a/svc.h +++ b/svc.h @@ -152,6 +152,7 @@ int svc_next_id (char *cmd); int svc_is_unique (svc_t *svc); static inline int svc_in_runlevel(svc_t *svc, int runlevel) { return svc && ISSET(svc->runlevels, runlevel); } +static inline int svc_has_sighup(svc_t *svc) { return svc && 0 != svc->sighup; } static inline int svc_is_dynamic(svc_t *svc) { return svc && 0 != svc->mtime; } static inline int svc_is_removed(svc_t *svc) { return svc && -1 == svc->dirty; }