Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2750048e authored by Mike Kasick's avatar Mike Kasick Committed by Steve Kondik
Browse files

Restart oneshot services when manually restarted.

Restores manual restart behavior of oneshot services prior to I9935b519.

Change-Id: Iadfc8462838e3ad2dbbe38d76ba2ef0ce955f722
parent 4911b6a1
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -63,7 +63,7 @@ static int wait_for_one_process(int block)


    NOTICE("process '%s', pid %d exited\n", svc->name, pid);
    NOTICE("process '%s', pid %d exited\n", svc->name, pid);


    if (!(svc->flags & SVC_ONESHOT)) {
    if (!(svc->flags & SVC_ONESHOT) || (svc->flags & SVC_RESTART)) {
        kill(-pid, SIGKILL);
        kill(-pid, SIGKILL);
        NOTICE("process '%s' killing any children in process group\n", svc->name);
        NOTICE("process '%s' killing any children in process group\n", svc->name);
    }
    }
@@ -78,8 +78,9 @@ static int wait_for_one_process(int block)
    svc->pid = 0;
    svc->pid = 0;
    svc->flags &= (~SVC_RUNNING);
    svc->flags &= (~SVC_RUNNING);


        /* oneshot processes go into the disabled state on exit */
        /* oneshot processes go into the disabled state on exit,
    if (svc->flags & SVC_ONESHOT) {
         * except when manually restarted. */
    if ((svc->flags & SVC_ONESHOT) && !(svc->flags & SVC_RESTART)) {
        svc->flags |= SVC_DISABLED;
        svc->flags |= SVC_DISABLED;
    }
    }