job.h revision b26fa1a2fbcfee7d03b0c8fd15ec3aa64ae70b9f
f82c66a0f006e0f7bbe420e055fef560c6898126nd This file is part of systemd.
f82c66a0f006e0f7bbe420e055fef560c6898126nd Copyright 2010 Lennart Poettering
f82c66a0f006e0f7bbe420e055fef560c6898126nd systemd is free software; you can redistribute it and/or modify it
f82c66a0f006e0f7bbe420e055fef560c6898126nd under the terms of the GNU Lesser General Public License as published by
f82c66a0f006e0f7bbe420e055fef560c6898126nd the Free Software Foundation; either version 2.1 of the License, or
f82c66a0f006e0f7bbe420e055fef560c6898126nd (at your option) any later version.
f82c66a0f006e0f7bbe420e055fef560c6898126nd systemd is distributed in the hope that it will be useful, but
f82c66a0f006e0f7bbe420e055fef560c6898126nd WITHOUT ANY WARRANTY; without even the implied warranty of
f82c66a0f006e0f7bbe420e055fef560c6898126nd MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
f82c66a0f006e0f7bbe420e055fef560c6898126nd Lesser General Public License for more details.
f82c66a0f006e0f7bbe420e055fef560c6898126nd You should have received a copy of the GNU Lesser General Public License
f82c66a0f006e0f7bbe420e055fef560c6898126nd along with systemd; If not, see <http://www.gnu.org/licenses/>.
8310cf661acfe5224adb2f1d62e67e929fb5b60bminfrin/* Be careful when changing the job types! Adjust job_merging_table[] accordingly! */
cd75115baac4df586f9a346dc1c2c9d9bd3d58aaminfrin JOB_START, /* if a unit does not support being started, we'll just wait until it becomes active */
78f97ce162b66a0dbfd7af4dcd9984f162569b04minfrin /* Note that restarts are first treated like JOB_STOP, but
f82c66a0f006e0f7bbe420e055fef560c6898126nd * then instead of finishing are patched to become
f82c66a0f006e0f7bbe420e055fef560c6898126nd * JOB_START. */
f82c66a0f006e0f7bbe420e055fef560c6898126nd JOB_RESTART, /* If running, stop. Then start unconditionally. */
f82c66a0f006e0f7bbe420e055fef560c6898126nd /* JOB_NOP can enter into a transaction, but as it won't pull in
f82c66a0f006e0f7bbe420e055fef560c6898126nd * any dependencies and it uses the special 'nop_job' slot in Unit,
f82c66a0f006e0f7bbe420e055fef560c6898126nd * it won't have to merge with anything (except possibly into another
f82c66a0f006e0f7bbe420e055fef560c6898126nd * JOB_NOP, previously installed). JOB_NOP is special-cased in
b6529ec5115d80b7dedcfd0935746015b2096084minfrin * job_type_is_*() functions so that the transaction can be
f82c66a0f006e0f7bbe420e055fef560c6898126nd * activated. */
663c339c8a4663cf1977f890481f8b7e251d3221jerenkrantz /* JOB_TRY_RESTART can never appear in a transaction, because
f82c66a0f006e0f7bbe420e055fef560c6898126nd * it always collapses into JOB_RESTART or JOB_NOP before entering.
f82c66a0f006e0f7bbe420e055fef560c6898126nd * Thus we never need to merge it with anything. */
f82c66a0f006e0f7bbe420e055fef560c6898126nd JOB_TRY_RESTART = _JOB_TYPE_MAX_IN_TRANSACTION, /* if running, stop and then start */
663c339c8a4663cf1977f890481f8b7e251d3221jerenkrantz /* Similar to JOB_TRY_RESTART but collapses to JOB_RELOAD or JOB_NOP */
f82c66a0f006e0f7bbe420e055fef560c6898126nd /* JOB_RELOAD_OR_START won't enter into a transaction and cannot result
f82c66a0f006e0f7bbe420e055fef560c6898126nd * from transaction merging (there's no way for JOB_RELOAD and
f82c66a0f006e0f7bbe420e055fef560c6898126nd * JOB_START to meet in one transaction). It can result from a merge
03f4b8dc5610480df8539053b96b568a9f29ee13minfrin * during job installation, but then it will immediately collapse into
03f4b8dc5610480df8539053b96b568a9f29ee13minfrin * one of the two simpler types. */
03f4b8dc5610480df8539053b96b568a9f29ee13minfrin JOB_RELOAD_OR_START, /* if running, reload, otherwise start */
8310cf661acfe5224adb2f1d62e67e929fb5b60bminfrin JOB_FAIL, /* Fail if a conflicting job is already queued */
8310cf661acfe5224adb2f1d62e67e929fb5b60bminfrin JOB_REPLACE, /* Replace an existing conflicting job */
8310cf661acfe5224adb2f1d62e67e929fb5b60bminfrin JOB_REPLACE_IRREVERSIBLY,/* Like JOB_REPLACE + produce irreversible jobs */
8310cf661acfe5224adb2f1d62e67e929fb5b60bminfrin JOB_ISOLATE, /* Start a unit, and stop all others */
f82c66a0f006e0f7bbe420e055fef560c6898126nd JOB_FLUSH, /* Flush out all other queued jobs when queing this one */
cd75115baac4df586f9a346dc1c2c9d9bd3d58aaminfrin JOB_IGNORE_DEPENDENCIES, /* Ignore both requirement and ordering dependencies */
cd75115baac4df586f9a346dc1c2c9d9bd3d58aaminfrin JOB_IGNORE_REQUIREMENTS, /* Ignore requirement dependencies */
8310cf661acfe5224adb2f1d62e67e929fb5b60bminfrin JOB_CANCELED, /* Job canceled by a conflicting job installation or by explicit cancel request */
8310cf661acfe5224adb2f1d62e67e929fb5b60bminfrin JOB_DEPENDENCY, /* A required dependency job did not result in JOB_DONE */
8310cf661acfe5224adb2f1d62e67e929fb5b60bminfrin JOB_SKIPPED, /* Negative result of JOB_VERIFY_ACTIVE */
8310cf661acfe5224adb2f1d62e67e929fb5b60bminfrin JOB_ASSERT, /* Couldn't start a unit, because an assert didn't hold */
8310cf661acfe5224adb2f1d62e67e929fb5b60bminfrin JOB_UNSUPPORTED, /* Couldn't start a unit, because the unit type is not supported on the system */
8310cf661acfe5224adb2f1d62e67e929fb5b60bminfrin /* Encodes that the 'subject' job needs the 'object' job in
8310cf661acfe5224adb2f1d62e67e929fb5b60bminfrin * some way. This structure is used only while building a transaction. */
8310cf661acfe5224adb2f1d62e67e929fb5b60bminfrin /* Used for graph algs as a "I have been here" marker */
char **deserialized_clients;
return job_type_lookup_merge(a, b) >= 0;
if (b == JOB_NOP)
if (a == JOB_NOP)
return a == job_type_lookup_merge(a, b);