[systemd-devel] [PATCH ping?] service: schedule JOB_RESTART from SERVICE_AUTO_RESTART state

Lennart Poettering lennart at poettering.net
Mon Apr 2 14:54:45 PDT 2012


On Mon, 19.03.12 09:42, David Ward (david.ward at ll.mit.edu) wrote:

> Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=45511

Sorry for not reviewing this more quickly!

Hmm, we probably should add a comment next to this line, explaining why
JOB_RESTART here, and not JOB_START, since this isn't obvious. 

Otherwise looks good and I agree with the rationale.

> ---
>  src/service.c |    4 +---
>  1 files changed, 1 insertions(+), 3 deletions(-)
> 
> diff --git a/src/service.c b/src/service.c
> index 8b5c0b0..e39e23d 100644
> --- a/src/service.c
> +++ b/src/service.c
> @@ -2208,9 +2208,7 @@ static void service_enter_restart(Service *s) {
>                          goto fail;
>          }
>  
> -        service_enter_dead(s, SERVICE_SUCCESS, false);
> -
> -        if ((r = manager_add_job(UNIT(s)->manager, JOB_START, UNIT(s), JOB_FAIL, false, &error, NULL)) < 0)
> +        if ((r = manager_add_job(UNIT(s)->manager, JOB_RESTART, UNIT(s), JOB_FAIL, false, &error, NULL)) < 0)
>                  goto fail;
>  
>          log_debug("%s scheduled restart job.", UNIT(s)->id);


Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list