Skip to content

Commit

Permalink
Fix #312: restart services with respawn set, e.g. ttys, immediately
Browse files Browse the repository at this point in the history
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
  • Loading branch information
troglobit committed Nov 9, 2022
1 parent bb9bd7e commit f6b5b02
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/service.c
Original file line number Diff line number Diff line change
Expand Up @@ -2223,10 +2223,15 @@ int service_step(svc_t *svc)
* which we need to wait for the forked-off child to create its pid
* file. In both cases, after that, retry after 2 sec
*/
if (!svc->respawn)
if (!svc->respawn) {
dbg("delayed restart of %s", svc_ident(svc, NULL, 0));
service_timeout_after(svc, svc->restart_tmo, service_retry);
goto done;
service_timeout_after(svc, svc->restart_tmo, service_retry);
goto done;
}

dbg("respawning %s", svc_ident(svc, NULL, 0));
svc_unblock(svc);
break;
}

if (svc_is_runtask(svc)) { /* only run/task, not sysv here */
Expand Down

0 comments on commit f6b5b02

Please sign in to comment.