Comment 4 for bug 252996

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Numerigraphe, it still seems to be the case.

Its somewhat confusing in job_next_state why so much trouble is taken to skip to JOB_STOPPING if there is no main process:

    case JOB_RUNNING:
        switch (job->goal) {
        case JOB_STOP:
            if (job->class->process[PROCESS_MAIN]
                && (job->pid[PROCESS_MAIN] > 0)) {
                return JOB_PRE_STOP;
            } else {
                return JOB_STOPPING;
            }
        case JOB_START:
            return JOB_STOPPING;
        default:
            nih_assert_not_reached ();
        }

Seems it would be simpler to just go to pre-stop no matter what. I'm sure there's a good reason for this though.