summaryrefslogtreecommitdiff
path: root/src/job.c
Commit message (Collapse)AuthorAge
* job: use a lookup table for merging of job typesMichal Schmidt2012-04-05
| | | | | | | | | | | | | | | | | | It is easier to see what job_type_merge() is doing when the merging rules are written in the form of a table. job_type_is_superset() contained redundant information. It can be simplified to a simple rule: Type A is a superset of B iff merging A with B gives A. Two job types are conflicting iff they are not mergeable. Make job_type_lookup_merge() the core function to decide the type merging. All other job_type_*() are just short wrappers around it. They can be inline. test-job-type gives the same results as before. btw, the systemd binary is smaller by almost 1 KB.
* job: add debug prints where job type gets changedMichal Schmidt2012-03-28
|
* job: fix loss of ordering with restart jobsMichal Schmidt2012-03-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Suppose that foo.service/start is a job waiting on other job bar.service/start to finish. And then foo.service/restart is enqueued (not using --ignore-dependencies). Currently this makes foo.service start immediately, forgetting about the ordering to bar.service. The runnability check for JOB_RESTART jobs looks only at dependencies for stopping. That's actually correct, because restart jobs should be treated the same as stop jobs at first. The bug is that job_run_and_invalidate() does not treat them exactly the same as stop jobs. unit_start() gets called without checking for the runnability of the converted JOB_START job. The fix is to simplify the switch in job_run_and_invalidate(). Handle JOB_RESTART identically to JOB_STOP. Also simplify the handling of JOB_TRY_RESTART - just convert it to JOB_RESTART if the unit is active and let it fall through to the JOB_RESTART case. Similarly for JOB_RELOAD_OR_START - have a fall through to JOB_START. In job_finish_and_invalidate() it's not necessary to check for JOB_TRY_RESTART with JOB_DONE, because JOB_TRY_RESTART jobs will have been converted to JOB_RESTART already. Speeding up the restart of services in "auto-restart" state still works as before. Improves: https://bugzilla.redhat.com/show_bug.cgi?id=753586 but it's still not perfect. With this fix the try-restart action will wait for the restart to complete in the right order, but the optimal behaviour would be to finish quickly (without disturbing the start job).
* unit: remove union UnitMichal Schmidt2012-01-16
| | | | | | | | | | Now that objects of all unit types are allocated the exact amount of memory they need, the Unit union has lost its purpose. Remove it. "Unit" is a more natural name for the base unit class than "Meta", so rename Meta to Unit. Access to members of the base class gets simplified.
* util: rework ANSI escape code macrosLennart Poettering2012-01-14
|
* job: colored status messages on bootMichal Schmidt2011-11-11
| | | | | The lack or green/red status marks on boot has been described by some users as "critical", "dramatic", "dealbreaker", "showstopper". Seriously.
* manager: fix a crash in isolatingMichal Schmidt2011-10-17
| | | | | | | | | | | | | | | | | HASHMAP_FOREACH is safe against the removal of the current entry, but not against the removal of other entries. job_finish_and_invalidate() can recursively remove other entries. It triggered an assertion failure: Assertion 'j->installed' failed at src/manager.c:1218, function transaction_apply(). Aborting. Fix the crash by iterating from the beginning when there is a possibility that the iterator could be invalid. It is O(n^2) in the worst case, but that's better than a crash. https://bugzilla.redhat.com/show_bug.cgi?id=717325
* job: after converting a job from restart to start readd it to run queueLennart Poettering2011-09-21
| | | | | | | When we converted a restart job it's time to look again whether any of its dependencies are now runnable. https://bugzilla.redhat.com/show_bug.cgi?id=735013
* job: also print status messages when we successfully started a unitLennart Poettering2011-04-16
|
* unit: introduce OnFailureIsolate=Lennart Poettering2011-04-07
|
* job: fix deserialization of jobs: do not ignore orderingLennart Poettering2011-04-06
|
* job: introduce new job result code 'skipped' to use when pre conditions of ↵Lennart Poettering2011-03-08
| | | | | | | job did not apply https://bugzilla.redhat.com/show_bug.cgi?id=682245 https://bugzilla.redhat.com/show_bug.cgi?id=635780
* job: convert job type as early as we can, to simplify things a bitLennart Poettering2011-03-08
|
* Spelling CorrectionsHarald Hoyer2011-02-28
| | | | Just some lame spelling corrections with no functionality.
* job: also trigger on-failure dependencies when jobs faile due to ↵Lennart Poettering2011-02-24
| | | | dependencies, timeout
* job: don't access j->type when j is already freedLennart Poettering2011-02-24
|
* job: start job timeout on enqueuing not when we start to process a jobLennart Poettering2011-02-24
| | | | | | | This practically reverses 23e1e0c4a3bc93fb841ac9575953ed5d0ef5282d. This makes it easier to timeout individual jobs so that this timeout can be relied on, since blocked dependencies will not influence the timeout.
* dbus: pass along information why a job failed when it failed (dbus api change!)Lennart Poettering2011-02-24
|
* job: start job timer when we begin running the job, not already when we add ↵Lennart Poettering2011-02-23
| | | | it to the queue of jobs
* systemctl: introduce --ignore-dependenciesLennart Poettering2011-02-16
|
* job: make status message printing more verboseLennart Poettering2011-02-14
|
* job: make sure we don't fail umount.target if a mount unit failed to stopLennart Poettering2010-11-18
|
* job: make it possible to wait for devices to be unpluggedLennart Poettering2010-11-14
|
* job: recursively fail BoundBy dependenciesLennart Poettering2010-10-29
|
* unit: get rid of gnoreDependencyFailure= instead treat ConflictedBy= as ↵Lennart Poettering2010-10-29
| | | | weaker counterpart of Conflicts=, similar to Wants= vs. Requires=
* job: show failure message only for start jobsLennart Poettering2010-09-27
|
* dbus: export number of total failed jobs on D-Bus interfaceLennart Poettering2010-09-23
|
* manager: measure startup timesLennart Poettering2010-09-21
|
* manager: add missing second part of s/maintenance/failed/Matthew Miller2010-08-31
|
* emacs: make sure nobody accidently adds tabs to our sourcesLennart Poettering2010-08-14
|
* job: don't accidently access a job that doesn't exist anymoreLennart Poettering2010-08-13
|
* gc: remove a lot of unused codeLennart Poettering2010-08-11
|
* manager: when two pending jobs conflict, keep the one that "conflicts", ↵Lennart Poettering2010-08-09
| | | | | | | remove the one that is "conflicted" This gives the writer of units control which unit is kept and which is stopped when two units conflict.
* job: make sure restart jobs are readded to the run queue after conversion to ↵Lennart Poettering2010-07-21
| | | | start jobs
* job: timeout every job independently of the unitLennart Poettering2010-07-17
|
* unit: introduce IgnoreDependencyFailure=Lennart Poettering2010-07-12
|
* job: when converting restart jobs, move them to WAITING stateLennart Poettering2010-07-08
|
* unit: don't cancel dependent jobs if a stopped daemon returned an error codeLennart Poettering2010-07-07
|
* manager: optionally print status updates to console on bootLennart Poettering2010-07-07
|
* dbus: send signals about jobs to the clients having created them ↵Lennart Poettering2010-07-05
| | | | unconditionally, and thus get rid of broadcast signals in most cases
* unit: shorten active state enums to make systemctl output nicerLennart Poettering2010-07-01
|
* unit: add new abstracted maintenance state for unitsLennart Poettering2010-07-01
|
* systemctl: add --block switch for synchronous starting of unitsLennart Poettering2010-05-22
|
* job: don't show (null) prefix in dumpLennart Poettering2010-05-20
|
* build-sys: move source files to subdirectoryLennart Poettering2010-05-16