~upstart-devel/upstart/trunk

« back to all changes in this revision

Viewing changes to init/job_process.c

  • Committer: James Hunt
  • Date: 2014-09-03 16:28:24 UTC
  • mfrom: (1660.1.1 upstart-bug-1357252)
  • Revision ID: james.hunt@ubuntu.com-20140903162824-4f039oykmggh18kh
* Merge of lp:~jamesodhunt/upstart/bug-1357252.

Show diffs side-by-side

added added

removed removed

Lines of Context:
890
890
                                job_process_error_abort (fds[1], JOB_PROCESS_ERROR_CGROUP_SETUP, 0);
891
891
                        }
892
892
 
 
893
                        /* If spawning the last process for the job,
 
894
                         * arrange for the cgroup manager to destroy
 
895
                         * all job cgroups relating to this job once all
 
896
                         * job processes have completed.
 
897
                         */
 
898
                        if (job_last_process (job, process)) {
 
899
                                if (! cgroup_clear (&job->class->cgroups)) {
 
900
                                        job_process_error_abort (fds[1], JOB_PROCESS_ERROR_CGROUP_CLEAR, 0);
 
901
                                }
 
902
                        }
893
903
                }
894
904
#endif /* ENABLE_CGROUPS */
895
905
 
1248
1258
                                  err, _("unable to enter cgroup: %s"),
1249
1259
                                  strerror (err->errnum)));
1250
1260
                break;
 
1261
        case JOB_PROCESS_ERROR_CGROUP_CLEAR:
 
1262
                err->error.message = NIH_MUST (nih_sprintf (
 
1263
                                  err, _("unable to mark cgroups for removal: %s"),
 
1264
                                  strerror (err->errnum)));
 
1265
                break;
1251
1266
 
1252
1267
        default:
1253
1268
                nih_assert_not_reached ();
1806
1821
                nih_assert_not_reached ();
1807
1822
        }
1808
1823
 
1809
 
 
1810
1824
        /* Cancel any timer trying to kill the job, since it's just
1811
1825
         * died.  We could do this inside the main process block above, but
1812
1826
         * leaving it here for now means we can use the timer for any