summaryrefslogtreecommitdiffabout
path: root/src/progman.c
Unidiff
Diffstat (limited to 'src/progman.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/progman.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/progman.c b/src/progman.c
index 5bc4eb3..a625885 100644
--- a/src/progman.c
+++ b/src/progman.c
@@ -321,13 +321,14 @@ static inline int
321progman_startup_phase (void) 321progman_startup_phase (void)
322{ 322{
323 struct prog *prog; 323 struct prog *prog;
324 324
325 for (prog = proghead; prog; prog = prog->next) 325 for (prog = proghead; prog; prog = prog->next)
326 { 326 {
327 if (IS_COMPONENT (prog) && prog->v.p.comp->mode == pies_comp_startup) 327 if (IS_COMPONENT (prog) && prog->v.p.comp->mode == pies_comp_startup
328 && prog->v.p.status == status_running)
328 return 1; 329 return 1;
329 } 330 }
330 return 0; 331 return 0;
331} 332}
332 333
333int 334int
@@ -335,13 +336,13 @@ progman_waiting_p (void)
335{ 336{
336 struct prog *prog; 337 struct prog *prog;
337 338
338 for (prog = proghead; prog; prog = prog->next) 339 for (prog = proghead; prog; prog = prog->next)
339 { 340 {
340 if (IS_COMPONENT (prog) 341 if (IS_COMPONENT (prog)
341 && prog->pid > 0 342 && prog->v.p.status == status_running
342 && (prog->wait || prog->v.p.comp->mode == pies_comp_startup)) 343 && (prog->wait || prog->v.p.comp->mode == pies_comp_startup))
343 { 344 {
344 debug (3, ("%s: waiting for %s (%lu)", 345 debug (3, ("%s: waiting for %s (%lu)",
345 __FUNCTION__, prog_tag (prog), 346 __FUNCTION__, prog_tag (prog),
346 (unsigned long) prog->pid)); 347 (unsigned long) prog->pid));
347 return 1; 348 return 1;
@@ -2353,20 +2354,12 @@ progman_cleanup (int expect_term)
2353 react (listener, status, pid); 2354 react (listener, status, pid);
2354 if (listener->v.p.comp->flags & CF_WAIT) 2355 if (listener->v.p.comp->flags & CF_WAIT)
2355 enable_socket (listener->v.p.socket); 2356 enable_socket (listener->v.p.socket);
2356 } 2357 }
2357 destroy_prog (&prog); 2358 destroy_prog (&prog);
2358 } 2359 }
2359 else if (prog->v.p.comp->mode == pies_comp_startup)
2360 {
2361 debug (1, (_("removing startup component %s, pid=%lu"),
2362 prog_tag (prog), (unsigned long)pid));
2363 destroy_prog (&prog);
2364 if (!progman_startup_phase ())
2365 pies_schedule_children (PIES_CHLD_WAKEUP);
2366 }
2367 else 2360 else
2368 { 2361 {
2369 if (prog->v.p.comp->mode >= pies_mark_sysvinit 2362 if (prog->v.p.comp->mode >= pies_mark_sysvinit
2370 && prog->v.p.comp->mode != pies_comp_ondemand) 2363 && prog->v.p.comp->mode != pies_comp_ondemand)
2371 { 2364 {
2372 sysvinit_acct (SYSV_ACCT_PROC_STOP, "", prog_tag (prog), 2365 sysvinit_acct (SYSV_ACCT_PROC_STOP, "", prog_tag (prog),
@@ -2376,12 +2369,18 @@ progman_cleanup (int expect_term)
2376 if (prog->wait) 2369 if (prog->wait)
2377 { 2370 {
2378 pies_schedule_children (PIES_CHLD_WAKEUP); 2371 pies_schedule_children (PIES_CHLD_WAKEUP);
2379 prog->wait = 0; 2372 prog->wait = 0;
2380 } 2373 }
2381 } 2374 }
2375 else if (prog->v.p.comp->mode == pies_comp_startup)
2376 {
2377 prog->v.p.status = status_finished;
2378 if (!progman_startup_phase ())
2379 pies_schedule_children (PIES_CHLD_WAKEUP);
2380 }
2382 else 2381 else
2383 { 2382 {
2384 if (is_sysvinit (prog->v.p.comp)) 2383 if (is_sysvinit (prog->v.p.comp))
2385 sysvinit_acct (SYSV_ACCT_PROC_STOP, "", 2384 sysvinit_acct (SYSV_ACCT_PROC_STOP, "",
2386 prog_tag (prog), pid, ""); 2385 prog_tag (prog), pid, "");
2387 2386

Return to:

Send suggestions and report system problems to the System administrator.