739
739
switch (job->state) {
740
740
case JOB_RUNNING:
741
/* FIXME check daemon; if true, check exit status
742
* and maybe don't change the goal */
741
/* Check whether we should respawn the process
743
* If a list of "normal" exit codes is provided, this is
744
* the list of exit codes that _prevent_ a respawn
749
for (i = 0; i < job->normalexit_len; i++)
751
(job->normalexit[i] == status))
754
if (i == job->normalexit_len)
743
758
job->goal = JOB_STOP;
761
/* If a script is killed or exits with a status other than
762
* zero, it's considered a failure and prevents the process
746
765
if (killed || status)
747
766
job->goal = JOB_STOP;