summaryrefslogtreecommitdiffabout
path: root/src/progman.c
Side-by-side diff
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
progman_startup_phase (void)
{
struct prog *prog;
for (prog = proghead; prog; prog = prog->next)
{
- if (IS_COMPONENT (prog) && prog->v.p.comp->mode == pies_comp_startup)
+ if (IS_COMPONENT (prog) && prog->v.p.comp->mode == pies_comp_startup
+ && prog->v.p.status == status_running)
return 1;
}
return 0;
}
int
@@ -335,13 +336,13 @@ progman_waiting_p (void)
{
struct prog *prog;
for (prog = proghead; prog; prog = prog->next)
{
if (IS_COMPONENT (prog)
- && prog->pid > 0
+ && prog->v.p.status == status_running
&& (prog->wait || prog->v.p.comp->mode == pies_comp_startup))
{
debug (3, ("%s: waiting for %s (%lu)",
__FUNCTION__, prog_tag (prog),
(unsigned long) prog->pid));
return 1;
@@ -2353,20 +2354,12 @@ progman_cleanup (int expect_term)
react (listener, status, pid);
if (listener->v.p.comp->flags & CF_WAIT)
enable_socket (listener->v.p.socket);
}
destroy_prog (&prog);
}
- else if (prog->v.p.comp->mode == pies_comp_startup)
- {
- debug (1, (_("removing startup component %s, pid=%lu"),
- prog_tag (prog), (unsigned long)pid));
- destroy_prog (&prog);
- if (!progman_startup_phase ())
- pies_schedule_children (PIES_CHLD_WAKEUP);
- }
else
{
if (prog->v.p.comp->mode >= pies_mark_sysvinit
&& prog->v.p.comp->mode != pies_comp_ondemand)
{
sysvinit_acct (SYSV_ACCT_PROC_STOP, "", prog_tag (prog),
@@ -2376,12 +2369,18 @@ progman_cleanup (int expect_term)
if (prog->wait)
{
pies_schedule_children (PIES_CHLD_WAKEUP);
prog->wait = 0;
}
}
+ else if (prog->v.p.comp->mode == pies_comp_startup)
+ {
+ prog->v.p.status = status_finished;
+ if (!progman_startup_phase ())
+ pies_schedule_children (PIES_CHLD_WAKEUP);
+ }
else
{
if (is_sysvinit (prog->v.p.comp))
sysvinit_acct (SYSV_ACCT_PROC_STOP, "",
prog_tag (prog), pid, "");

Return to:

Send suggestions and report system problems to the System administrator.