b26fa1a2fbcfee7d03b0c8fd15ec3aa64ae70b9f |
|
10-Feb-2016 |
Daniel Mack <daniel@zonque.org> |
tree-wide: remove Emacs lines from all files
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file. |
7a7821c878a6ddfb2e79268bb1cd8f7662a9b8f8 |
|
04-Feb-2016 |
Lennart Poettering <lennart@poettering.net> |
core: rework job_get_timeout() to use usec_t and handle USEC_INFINITY time events correctly |
36c16a7cdd6c33d7980efc2cd6a2211941f302b4 |
|
01-Feb-2016 |
Lennart Poettering <lennart@poettering.net> |
core: rework unit timeout handling, and add new setting RuntimeMaxSec=
This clean-ups timeout handling in PID 1. Specifically, instead of storing 0 in internal timeout variables as
indication for a disabled timeout, use USEC_INFINITY which is in-line with how we do this in the rest of our code
(following the logic that 0 means "no", and USEC_INFINITY means "never").
This also replace all usec_t additions with invocations to usec_add(), so that USEC_INFINITY is properly propagated,
and sd-event considers it has indication for turning off the event source.
This also alters the deserialization of the units to restart timeouts from the time they were originally started from.
Before this patch timeouts would be restarted beginning with the time of the deserialization, which could lead to
artificially prolonged timeouts if a daemon reload took place.
Finally, a new RuntimeMaxSec= setting is introduced for service units, that specifies a maximum runtime after which a
specific service is forcibly terminated. This is useful to put time limits on time-intensive processing jobs.
This also simplifies the various xyz_spawn() calls of the various types in that explicit distruction of the timers is
removed, as that is done anyway by the state change handlers, and a state change is always done when the xyz_spawn()
calls fail.
Fixes: #2249 |
94bd732348535de399f8f003e3a1cbc8a81ab839 |
|
31-Jan-2016 |
Evgeny Vereshchagin <evvers@ya.ru> |
core: refactoring: add job_type_to_access_method
remove duplication |
3282591dc30b2934a895c7403d2f0b0690260947 |
|
28-Jan-2016 |
Lennart Poettering <lennart@poettering.net> |
core: make sure "systemctl reload-or-try-restart is actually a noop if a unit is not running
This makes sure we follow the same basic logic for try-restart if we have a try-reload.
Fixes #688 |
d054f0a4d451120c26494263fc4dc175bfd405b1 |
|
12-Jan-2016 |
Daniel Mack <daniel@zonque.org> |
tree-wide: use xsprintf() where applicable
Also add a coccinelle receipt to help with such transitions. |
df446f96031e281ed676052ccdede0c774cb1e0c |
|
17-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
core: Minor cleaning up of unit/log status and log logic
We only reorder a few things and modernize some constructs. No
functional changes.
- Move some if checks from the caller to the callee of a few functions.
- Use IN_SE() where we can
- Move status printing functions together |
4bd29fe5cec9d744a4e39240c76b85d999bd2cf7 |
|
12-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
core: drop "override" flag when building transactions
Now that we don't have RequiresOverridable= and RequisiteOverridable=
dependencies anymore, we can get rid of tracking the "override" boolean
for jobs in the job engine, as it serves no purpose anymore.
While we are at it, fix some error messages we print when invoking
functions that take the override parameter. |
f32b43bda454a70ae23d6802605d41b26dc24ce2 |
|
12-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
core: remove support for RequiresOverridable= and RequisiteOverridable=
As discussed at systemd.conf 2015 and on also raised on the ML:
http://lists.freedesktop.org/archives/systemd-devel/2015-November/034880.html
This removes the two XyzOverridable= unit dependencies, that were
basically never used, and do not enhance user experience in any way.
Most folks looking for the functionality this provides probably opt for
the "ignore-dependencies" job mode, and that's probably a good idea.
Hence, let's simplify systemd's dependency engine and remove these two
dependency types (and their inverses).
The unit file parser and the dbus property parser will now redirect
the settings/properties to result in an equivalent non-overridable
dependency. In the case of the unit file parser we generate a warning,
to inform the user.
The dbus properties for this unit type stay available on the unit
objects, but they are now hidden from usual introspection and will
always return the empty list when queried.
This should provide enough compatibility for the few unit files that
actually ever made use of this. |
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out allocation calls into alloc-util.[ch] |
8b43440b7ef4b81c69c31de7ff820dc07a780254 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: move string table stuff into its own string-table.[ch] |
6bedfcbb2970e06a4d3280c8fb62083d252ede73 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split string parsing related calls from util.[ch] into parse-util.[ch] |
07630cea1f3a845c09309f197ac7c4f11edd3b62 |
|
24-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split our string related calls from util.[ch] into its own file string-util.[ch]
There are more than enough calls doing string manipulations to deserve
its own files, hence do something about it.
This patch also sorts the #include blocks of all files that needed to be
updated, according to the sorting suggestions from CODING_STYLE. Since
pretty much every file needs our string manipulation functions this
effectively means that most files have sorted #include blocks now.
Also touches a few unrelated include files. |
4f5dd3943bef8a04be7e3b838b822bb9a7ad6cb3 |
|
24-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util: split out escaping code into escape.[ch]
This really deserves its own file, given how much code this is now. |
1fc464f6fbecfc5d8ba9f7b98d19e21fb324bfb9 |
|
22-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
cgtop: underline table header
Let's underline the header line of the table shown by cgtop, how it is
customary for tables. In order to do this, let's introduce new ANSI
underline macros, and clean up the existing ones as side effect. |
75f86906c52735c98dc0aa7e24b773edb42ee814 |
|
07-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
basic: rework virtualization detection API
Introduce a proper enum, and don't pass around string ids anymore. This
simplifies things quite a bit, and makes virtualization detection more
similar to architecture detection. |
64f575d2ab9a6743d3c7172b7591c88ba243cf1b |
|
21-Jul-2015 |
Michal Schmidt <mschmidt@redhat.com> |
core: adjust job completion message log levels
We do not print all non-OK job completion status messages to the console
in red, because not all of them are plain errors. We do however log the
same messages as LOG_ERR.
Differentiate the log levels by deducing them from the job result in a
way that more or less matches the color of the console message. |
b81bbe5355b97d0d7dbe8796afd39bf284696063 |
|
21-Jul-2015 |
Michal Schmidt <mschmidt@redhat.com> |
core: small refactor of job completion logging
Joins three log_struct() calls into one. |
4f29c6fea6a6c5c2c9406ad091cd6f56da21e2cb |
|
21-Jul-2015 |
Michal Schmidt <mschmidt@redhat.com> |
core: log completion of remaining job types
JOB_RESTART and failed JOB_VERIFY_ACTIVE completions were printed to
console but not to the log. |
30961fa300cad21b50fe47baee523beeadb5d0bc |
|
21-Jul-2015 |
Michal Schmidt <mschmidt@redhat.com> |
core: do not log done failed-condition jobs as if unit started
It is misleading to see "Started foo." in the log when the unit's
condition was false. |
aa49ab5f22c0fdc7a5381d4e452f40705f3d7bf8 |
|
21-Jul-2015 |
Michal Schmidt <mschmidt@redhat.com> |
core: try harder to get job completion messages too
This is similar to "core: always try harder to get unit status
message format string", but for job completion status messages.
It makes generic status messages applicable for printing to the console.
And it rewrites the functions in a more table-based style. |
d1a34ae9c20f1c02aab17884919eccef572b1d21 |
|
21-Jul-2015 |
Michal Schmidt <mschmidt@redhat.com> |
core: fix confusing logging of instantaneous jobs
For instantaneous jobs (e.g. starting of targets, sockets, slices, or
Type=simple services) the log shows the job completion
before starting:
systemd[1]: Created slice -.slice.
systemd[1]: Starting -.slice.
systemd[1]: Created slice System Slice.
systemd[1]: Starting System Slice.
systemd[1]: Listening on Journal Audit Socket.
systemd[1]: Starting Journal Audit Socket.
systemd[1]: Reached target Timers.
systemd[1]: Starting Timers.
...
The reason is that the job completes before the ->start() method returns
and only then does unit_start() print the "Starting ..." message.
The same thing happens when stopping units.
Rather than fixing the order of the messages, let's just not emit the
Starting/Stopping message at all when the job completes instantaneously.
The job completion message is sufficient in this case. |
fc08079ef25a063f56be48b87035f8fde79153ba |
|
07-Jul-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
treewide: fix typos of let's |
c6497ccb7153af9a1252c48918e380b5134314de |
|
19-May-2015 |
Lennart Poettering <lennart@poettering.net> |
core: when propagating restart requests due to deps, downgrade restart to try-restart
Previously, if a service A depended on a service B via Requires=, and A
was not running and B restarted this would trigger a start of A as well,
since the restart was propagated as restart independently of the state
of A.
This patch ensures that a restart of B would be propagated as a
try-restart to A, thus not changing its state if it isn't up.
http://lists.freedesktop.org/archives/systemd-devel/2015-May/032061.html |
be7d9ff730cb88d7c6a869dd5c47754c78ceaef2 |
|
19-May-2015 |
Lennart Poettering <lennart@poettering.net> |
core: introduce seperate reverse dependencies for Requires= and Requisite=
This allows us to ensure that Requisite= dependencies never cause
propagation between units, while Requires= dependencies might.
http://lists.freedesktop.org/archives/systemd-devel/2015-May/031742.html |
b2c23da8cea1987a1a329f5a964d3299b7ca7890 |
|
11-May-2015 |
Lennart Poettering <lennart@poettering.net> |
core: rename SystemdRunningAs to ManagerRunningAs
It's primarily just a property of the Manager object after all, and we
try to refer to PID 1 as "manager" instead of "systemd", hence let's to
stick to this here too. |
f2341e0a87cab1558c84c933956e9181d5fb6c52 |
|
11-May-2015 |
Lennart Poettering <lennart@poettering.net> |
core,network: major per-object logging rework
This changes log_unit_info() (and friends) to take a real Unit* object
insted of just a unit name as parameter. The call will now prefix all
logged messages with the unit name, thus allowing the unit name to be
dropped from the various passed romat strings, simplifying invocations
drastically, and unifying log output across messages. Also, UNIT= vs.
USER_UNIT= is now derived from the Manager object attached to the Unit
object, instead of getpid(). This has the benefit of correcting the
field for --test runs.
Also contains a couple of other logging improvements:
- Drops a couple of strerror() invocations in favour of using %m.
- Not only .mount units now warn if a symlinks exist for the mount
point already, .automount units do that too, now.
- A few invocations of log_struct() that didn't actually pass any
additional structured data have been replaced by simpler invocations
of log_unit_info() and friends.
- For structured data a new LOG_UNIT_MESSAGE() macro has been added,
that works like LOG_MESSAGE() but prefixes the message with the unit
name. Similar, there's now LOG_LINK_MESSAGE() and
LOG_NETDEV_MESSAGE().
- For structured data new LOG_UNIT_ID(), LOG_LINK_INTERFACE(),
LOG_NETDEV_INTERFACE() macros have been added that generate the
necessary per object fields. The old log_unit_struct() call has been
removed in favour of these new macros used in raw log_struct()
invocations. In addition to removing one more function call this
allows generated structured log messages that contain two object
fields, as necessary for example for network interfaces that are
joined into another network interface, and whose messages shall be
indexed by both.
- The LOG_ERRNO() macro has been removed, in favour of
log_struct_errno(). The latter has the benefit of ensuring that %m in
format strings is properly resolved to the specified error number.
- A number of logging messages have been converted to use
log_unit_info() instead of log_info()
- The client code in sysv-generator no longer #includes core code from
src/core/.
- log_unit_full_errno() has been removed, log_unit_full() instead takes
an errno now, too.
- log_unit_info(), log_link_info(), log_netdev_info() and friends, now
avoid double evaluation of their parameters |
7dfbe2e3fc0215b49d8202a32beb6b1aae08c4e4 |
|
29-Apr-2015 |
Tom Gundersen <teg@jklm.no> |
core: annotate event sources |
288a74cce597f81d3ba01d8a5ca7d2ba5b654b7e |
|
11-Apr-2015 |
Ronny Chevalier <chevalier.ronny@gmail.com> |
shared: add terminal-util.[ch] |
019c7fba754f74909bdb8bbbbbbe529082928a95 |
|
09-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
util: add shell_maybe_quote() call for preparing a string for shell cmdline inclusion
If necessary the passed string is enclosed in "", and all special
characters escapes.
This also ports over usage in bus-util.c and job.c to use this, instead
of a incorrect local implementation that forgets to properly escape. |
15411c0cb1192799b37ec8f25d6f30e8d7292fc6 |
|
13-Mar-2015 |
David Herrmann <dh.herrmann@gmail.com> |
tree-wide: there is no ENOTSUP on linux
Replace ENOTSUP by EOPNOTSUPP as this is what linux actually uses. |
103635db51044e6b56efda08bfe98ed78a218b75 |
|
12-Mar-2015 |
Tom Gundersen <teg@jklm.no> |
core: add missing words to my fix of explanation of associativity |
48b4eab497c8d337e0c892291405ea4201da4572 |
|
11-Mar-2015 |
Tom Gundersen <teg@jklm.no> |
core: fix explanation of associativity |
2eec67acbb00593e414549a7e5b35eb7dd776b1b |
|
23-Feb-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
remove unused includes
This patch removes includes that are not used. The removals were found with
include-what-you-use which checks if any of the symbols from a header is
in use. |
5ffa8c818120e35c89becd938d160235c069dd12 |
|
01-Feb-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Add a snprinf wrapper which checks that the buffer was big enough
If we scale our buffer to be wide enough for the format string, we
should expect that the calculation was correct.
char_array_0() invocations are removed, since snprintf nul-terminates
the output in any case.
A similar wrapper is used for strftime calls, but only in timedatectl.c. |
9c3349e23b14db27e7ba45f82cf647899c563ea9 |
|
05-Jan-2015 |
Lennart Poettering <lennart@poettering.net> |
core: rework counting of running jobs
Let's unify the code that counts the running jobs a bit, in order to
make sure we are less likely to miss one.
This is related to this bug:
https://bugs.freedesktop.org/show_bug.cgi?id=87349
However, it probably won't fix it fully, and I cannot reproduce the issue.
The change also adds an explicit assert change when the counter is off. |
0faacd470dfbd24f4c6504da6f04213aa05f9d19 |
|
15-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
unit: handle nicely of certain unit types are not supported on specific systems
Containers do not really support .device, .automount or .swap units;
Systems compiled without support for swap do not support .swap units;
Systems without kdbus do not support .busname units.
With this change attempts to start a unsupported unit types will result
in an immediate "unsupported" job result, which is a lot more
descriptive then before. Also, attempts to start device units in
containers will now immediately fail instead of causing jobs to be
enqueued that never go away. |
da927ba997d68401563b927f92e6e40e021a8e5c |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: no need to negate errno for log_*_errno()
It corrrectly handles both positive and negative errno values. |
0a1beeb64207eaa88ab9236787b1cbc2f704ae14 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: auto-convert the simple cases to log_*_errno()
As a followup to 086891e5c1 "log: add an "error" parameter to all
low-level logging calls and intrdouce log_error_errno() as log calls
that take error numbers", use sed to convert the simple cases to use
the new macros:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/'
Multi-line log_*() invocations are not covered.
And we also should add log_unit_*_errno(). |
e2cc6eca73cd1df8be552d7c23f9ff3d69c06f1e |
|
28-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
log: fix order of log_unit_struct() to match other logging calls
Also, while we are at it, introduce some syntactic sugar for creating
ERRNO= and MESSAGE= structured logging fields. |
79008bddf679a5e0900369950eb346c9fa687107 |
|
27-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
log: rearrange log function naming
- Rename log_meta() → log_internal(), to follow naming scheme of most
other log functions that are usually invoked through macros, but never
directly.
- Rename log_info_object() to log_object_info(), simply because the
object should be before any other parameters, to follow OO-style
programming style. |
61da906a744594002c2c967ecf6ec7899c7a9397 |
|
26-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
core: drop now-redundant special-casing of JOB_NOP
job_type_is_conflicting(X, JOB_NOP) correctly gives: false.
job_type_allows_late_merge(JOB_NOP) && job_type_is_superset(X, JOB_NOP)
correctly gives: true. |
7e803f5ecf689216d6fcd8a1d19a442f234bf28b |
|
26-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
core: fix assertion failure in checking a transaction with a JOB_NOP
Several functions called from transaction_activate() need to correctly
handle the case where a JOB_NOP job is being checked against a unit's
pending job. The assumption that JOB_NOP never merges with other job
types was correct, but since the job_type_is_*() functions are
implemented using the merge lookup, they need to special-case JOB_NOP
to avoid hitting assertion failures. |
59fccdc587bc179c1638916ee16a24099f94f81f |
|
06-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
core: introduce the concept of AssertXYZ= similar to ConditionXYZ=, but fatal for a start job if not met |
127d5fd1563a74411aaceeadd251f98fd52216d7 |
|
28-Oct-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
manager: convert ephemeral to enum
In preparation for subsequent changes. |
f189ab18de69d3dee81117d7925fb370cd038f0f |
|
28-Oct-2014 |
Lennart Poettering <lennart@poettering.net> |
job: optionally, when a job timeout is hit, also execute a failure action |
8e07fc41f86d41e68c5663b2a3c620a0adedcc11 |
|
31-Aug-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Quote unit names in suggested systemctl commandlines
The fact that unit names have to be quoted can be a bit surprising.
Show quotes in the hint commandline, but only after checking that this
is necessary, since quotes are visually heavy and usually not needed.
https://bugs.freedesktop.org/show_bug.cgi?id=82832 |
b39a2770ba55637da80e2e389222c59dbea73507 |
|
15-Aug-2014 |
Stef Walter <stef@thewalter.net> |
core: Rename Job.subscribed field to Job.clients
This reflects how this field will be used, to not only track where
to send signals, but also which callers (other than root) are allowed
to call DBus methods on the Job. |
1727a595225132eb73ec134b6979d9c713b42e8c |
|
12-May-2014 |
Michael Marineau <michael.marineau@coreos.com> |
job: always add waiting jobs to run queue during coldplug
commit 20a83d7bf was not equivalent to the original bug fix proposed by
Michal Sekletar <msekleta@redhat.com>. The committed version only added
the job to the run queue if the job had a timeout, which most jobs do
not have. Just re-ordering the code gets us the intended functionality |
20a83d7bf4542875f8033b68682a4da4993010e8 |
|
26-Apr-2014 |
Brandon Philips <brandon@ifup.co> |
job: add waiting jobs to run queue in unit_coldplug
When we have job installed and added to run queue for service which is
still in dead state and systemd initiates reload then after reload we
never add deserialized job to the run queue again. This is caused by
check in service_coldplug() where we check if deserialized state is
something else than dead state, which is not the case thus we never call
service_set_state() and finally unit_notify() where we would have added
job to the run queue.
Thanks to Michal Sekletar <msekleta@redhat.com> for the original patch. |
6a0f1f6d5af7c7300d3db7a0ba2b068f8abd222b |
|
24-Mar-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-event: rework API to support CLOCK_REALTIME_ALARM and CLOCK_BOOTTIME_ALARM, too |
2c5859afecee81e345fc9526b1083bf79990ffb8 |
|
07-Mar-2014 |
Daniel Mack <zonque@gmail.com> |
Make tables for DEFINE_STRING_TABLE_LOOKUP consistent
Bring some arrays that are used for DEFINE_STRING_TABLE_LOOKUP() in the
same order than the enums they reference.
Also, pass the corresponding _MAX value to the array initalizer where
appropriate. |
8f8f05a919355095518911135c3d630f4620a9b0 |
|
03-Mar-2014 |
Lennart Poettering <lennart@poettering.net> |
bus: add sd_bus_track object for tracking peers, and port core over to it
This is primarily useful for services that need to track clients which
reference certain objects they maintain, or which explicitly want to
subscribe to certain events. Something like this is done in a large
number of services, and not trivial to do. Hence, let's unify this at
one place.
This also ports over PID 1 to use this to ensure that subscriptions to
job and manager events are correctly tracked. As a side-effect this
makes sure we properly serialize and restore the track list across
daemon reexec/reload, which didn't work correctly before.
This also simplifies how we distribute messages to broadcast to the
direct busses: we only track subscriptions for the API bus and
implicitly assume that all direct busses are subscribed. This should be
a pretty OK simplification since clients connected via direct bus
connections are shortlived anyway. |
bcfce235a3d757f0ec3b0c01e8583382db1adfe2 |
|
20-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
macro: introduce a nice macro for disabling -Wformat-nonliteral temporarily |
151b9b9662a90455262ce575a8a8ae74bf4ff336 |
|
20-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
api: in constructor function calls, always put the returned object pointer first (or second)
Previously the returned object of constructor functions where sometimes
returned as last, sometimes as first and sometimes as second parameter.
Let's clean this up a bit. Here are the new rules:
1. The object the new object is derived from is put first, if there is any
2. The object we are creating will be returned in the next arguments
3. This is followed by any additional arguments
Rationale:
For functions that operate on an object we always put that object first.
Constructors should probably not be too different in this regard. Also,
if the additional parameters might want to use varargs which suggests to
put them last.
Note that this new scheme only applies to constructor functions, not to
all other functions. We do give a lot of freedom for those.
Note that this commit only changes the order of the new functions we
added, for old ones we accept the wrong order and leave it like that. |
4daf54a851e4fb7ed1a13c3117bba12528fd2c7f |
|
12-Feb-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journald: log provenience of signals |
8bb310c3c6f5a52f2d483fd8dfb16ca66ecf7a5f |
|
29-Jan-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
manager: print ephemeral information about running jobs' timeouts (v2)
This reverts commit 28c758de94bc8ba97b89d9dab3f517cf466978d0
but makes job_coldplug smarter.
In (v1) I changed the job start timestamp to be always set, so the
start time can be reported in the cylon eye message. The bug was that
when deserializing jobs, they would be ignored if their start
timestamp was unset which was synonymous with no timeout. But after
the change, jobs would have a start timestamp set despite having no
timeout. After deserialization they would be considered immediately
expired. Fix this by checking if the timeout is not zero when
considering jobs for expiration. |
28c758de94bc8ba97b89d9dab3f517cf466978d0 |
|
28-Jan-2014 |
Kay Sievers <kay@vrfy.org> |
Revert "manager: print ephemeral information about running jobs' timeouts"
This reverts commit 2cba2e03524ec0922ddc70f933e8a89b7d23b4ec.
It breaks bootup with dracut, the transition to the real rootfs fails. |
cb8ccb2271727fc114ca43104d3333ee4635cc79 |
|
28-Jan-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
manager: also turn on output on unit failure |
2cba2e03524ec0922ddc70f933e8a89b7d23b4ec |
|
27-Jan-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
manager: print ephemeral information about running jobs' timeouts
Produces output like:
[ *** ] (1 of 2) A start job is running for slow.service (33s / 1min 30s)
The first nubmer is the time since job start, the second is the job timeout. |
68db7a3bd9b2f8640c7297382b6d20eb995f7e1e |
|
27-Jan-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
core: add function to tell when job will time out
Things will continue when either the job timeout
or the unit timeout is reached. Add functionality to
access that info. |
ccd06097c79218f7d5ea4c21721bbcbc7c467dca |
|
03-Jan-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Use format patterns for usec_t, pid_t, nsec_t, usec_t
It is nicer to predefine patterns using configure time check instead of
using casts everywhere.
Since we do not need to use any flags, include "%" in the format instead
of excluding it like PRI* macros. |
9091e686f43184065381aa71929e3df36a4ea2e1 |
|
14-Dec-2013 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
Add more _printf_'s for format-nonliterals
Clang is a bit more strict wrt format-nonliterals:
http://clang.llvm.org/docs/LanguageExtensions.html#format-string-checking
Adding these extra printf attributes also makes gcc able to find more
problems. E.g. this patch uncovers a format issue in udev-builtin-path_id.c
Some parts looked intetional about breaking the format-nonliteral check.
I added some supression for warnings there. |
6a371e23ee0e47827fb4e3aa469ed84da2599304 |
|
03-Dec-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
systemd: treat reload failure as failure
systemctl reload "suceeded" on stopped units, but it is documented
to fail in this case.
https://bugzilla.redhat.com/show_bug.cgi?id=1036845 |
255baef68a8d9d74cb3b846f93c290225ad162aa |
|
26-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
core: add new "flush" job mode to cancel all other jobs when queuing a new job |
752b590500cdfe8e60800c0553bf7ae3ac613ffd |
|
25-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
core: dispatch run queue only if there's nothing else to do
Always read all external events before we decide what we do next. |
66ca4ec48a63ee0e71532148b9b373cda318c7e2 |
|
22-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
job: fix serialization |
718db96199eb307751264e4163555662c9a389fa |
|
20-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
core: convert PID 1 to libsystemd-bus
This patch converts PID 1 to libsystemd-bus and thus drops the
dependency on libdbus. The only remaining code using libdbus is a test
case that validates our bus marshalling against libdbus' marshalling,
and this dependency can be turned off.
This patch also adds a couple of things to libsystem-bus, that are
necessary to make the port work:
- Synthesizing of "Disconnected" messages when bus connections are
severed.
- Support for attaching multiple vtables for the same interface on the
same path.
This patch also fixes the SetDefaultTarget() and GetDefaultTarget() bus
calls which used an inappropriate signature.
As a side effect we will now generate PropertiesChanged messages which
carry property contents, rather than just invalidation information. |
5b1869eaa22e365ab6595924fe96549b279b5ebc |
|
14-Nov-2013 |
Olivier Brunel <jjk@jjacky.com> |
Fix possible lack of status messages on shutdown/reboot
Since 31a7eb86 the output on console can be disabled to avoid colliding with
gettys. However, it could also lead to a lack of messages during
shutdown/reboot. |
9588bc32096fc8342bfd8b989689717186d7d86e |
|
08-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
Remove dead code and unexport some calls
"make check-api-unused" informs us about code that is not used anymore
or that is exported but only used internally. Fix these all over the
place. |
71fda00f320379f5cbee8e118848de98caaa229d |
|
14-Oct-2013 |
Lennart Poettering <lennart@poettering.net> |
list: make our list macros a bit easier to use by not requring type spec on each invocation
We can determine the list entry type via the typeof() gcc construct, and
so we should to make the macros much shorter to use. |
f485606bf8957d2954cf6fa5b0aabd5c39db15c1 |
|
17-Sep-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Make tmpdir removal asynchronous
https://bugs.freedesktop.org/show_bug.cgi?id=68232 |
c2756a68401102786be343712c0c35acbd73d28d |
|
28-Jun-2013 |
Lennart Poettering <lennart@poettering.net> |
core: add transient units
Transient units can be created via the bus API. They are configured via
the method call parameters rather than on-disk files. They are subject
to normal GC. Transient units currently may only be created for
services (however, we will extend this), and currently only ExecStart=
and the cgroup parameters can be configured (also to be extended).
Transient units require a unique name, that previously had no
configuration file on disk.
A tool systemd-run is added that makes use of this functionality to run
arbitrary command lines as transient services:
$ systemd-run /bin/ping www.heise.de
Will cause systemd to create a new transient service and run ping in it. |
44a6b1b68029833893f6e9cee35aa27a974038f6 |
|
03-May-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Add __attribute__((const, pure, format)) in various places
I'm assuming that it's fine if a _const_ or _pure_ function
calls assert. It is assumed that the assert won't trigger,
and even if it does, it can only trigger on the first call
with a given set of parameters, and we don't care if the
compiler moves the order of calls. |
3ecaa09bccd8a59c9f1e06756a1334a162206dc4 |
|
23-Apr-2013 |
Lennart Poettering <lennart@poettering.net> |
unit: rework trigger dependency logic
Instead of having explicit type-specific callbacks that inform the
triggering unit when a triggered unit changes state, make this generic
so that state changes are forwarded betwee any triggered and triggering
unit.
Also, get rid of UnitRef references from automount, timer, path units,
to the units they trigger and rely exclsuively on UNIT_TRIGGER type
dendencies. |
b92bea5d2a9481de69bb627a7b442a9f58fca43d |
|
06-Apr-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Use initalization instead of explicit zeroing
Before, we would initialize many fields twice: first
by filling the structure with zeros, and then a second
time with the real values. We can let the compiler do
the job for us, avoiding one copy.
A downside of this patch is that text gets slightly
bigger. This is because all zero() calls are effectively
inlined:
$ size build/.libs/systemd
text data bss dec hex filename
before 897737 107300 2560 1007597 f5fed build/.libs/systemd
after 897873 107300 2560 1007733 f6075 build/.libs/systemd
… actually less than 1‰.
A few asserts that the parameter is not null had to be removed. I
don't think this changes much, because first, it is quite unlikely
for the assert to fail, and second, an immediate SEGV is almost as
good as an assert. |
076a24adf4bfbb9c5aa8167e102c253c7e1c651e |
|
02-Mar-2013 |
Michal Schmidt <mschmidt@redhat.com> |
job: print the "OK" status messages in normal green
The "OK" status messages should not draw attention to themselves.
It's better if they're not printed in bright/bold. Leave that
to errors and warnings.
Use a plain inconspicuous enterprisey green. |
984a2be450abac81474889b8bea4b3fbeddb26c5 |
|
28-Feb-2013 |
Michal Schmidt <mschmidt@redhat.com> |
util, core:Â add support for ephemeral status lines
Ephemeral status lines do not end with a newline and they expect to be
overwritten by the next printed status line. |
49b1d377263f33991a03235779e50f61273ba649 |
|
28-Feb-2013 |
Michal Schmidt <mschmidt@redhat.com> |
core:Â redefine unit_status_printf()
Take advantage of the fact that almost all callers want to pass unit
description as the last parameter. Those who don't can use the more
flexible manager_status_printf(). |
637f8b8eb5decb6dd626276ea9e3a545c895e086 |
|
27-Feb-2013 |
Michal Schmidt <mschmidt@redhat.com> |
core:Â keep track of the number of JOB_RUNNING jobs |
23ade460e5a118daa575a961b405d089f95e0617 |
|
22-Feb-2013 |
Michal Schmidt <mschmidt@redhat.com> |
core, systemctl: add support for irreversible jobs
Add a new job mode: replace-irreversibly. Jobs enqueued using this mode
cannot be implicitly canceled by later enqueued conflicting jobs.
They can however still be canceled with an explicit "systemctl cancel"
call. |
c65eb8365344eeb72ee2c0b333ab54d925263b3f |
|
09-Feb-2013 |
Lennart Poettering <lennart@poettering.net> |
shutdown: issue a sync() as soon as shutdown.target is queued |
e45460d666512db4f908f86e8722d7932dcf0f82 |
|
25-Jan-2013 |
Michal Schmidt <mschmidt@redhat.com> |
job: fix merging with --ignore-dependencies
This fixes a bug where a job with --ignore-dependencies would wait for
other jobs because it merged into a previously queued job. |
bbc9006e6b5665073149331d75c104a33224dc19 |
|
18-Jan-2013 |
Mirco Tischler <mt-ml@gmx.de> |
core: log USER_UNIT instead of UNIT if in user session |
38c888a4049438f2521edf38d55f937b53d17a9e |
|
15-Jan-2013 |
Michal Sekletar <msekleta@redhat.com> |
core: use correct argument of type JobResult |
66870f90dec9b5bf4ad76f9757fafce703560a67 |
|
06-Jan-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
systemd: use unit logging macros |
1abc85b8d026a2d72442b0edaee5213d0ee73c1f |
|
25-Oct-2012 |
Michal Schmidt <mschmidt@redhat.com> |
job: avoid recursion into transaction code from job cancelation
I hit an "assert(j->installed)" failure in transaction_apply(). Looking
into the backtrace I saw what happened:
1. The system was booting. var.mount/start was an installed job.
2. I pressed Ctrl+Alt+Del.
3. reboot.target was going to be isolated.
4. transaction_apply() proceeded to install a var.mount/stop job.
5. job_install() canceled the conflicting start job.
6. Depending jobs ended recursively with JOB_DEPENDENCY, among them was
local-fs.target/start.
7. Its OnFailure action triggered - emergency.target was now going to be
isolated.
8. We recursed back into transaction_apply() where the half-installed
var.mount/stop job confused us.
Recursing from job installation back into the transaction code cannot be
a good idea. Avoid the problem by canceling the conflicting job
non-recursively in job_install(). I don't think we'll miss anything by
not recursing here. After all, we are called from transaction_apply().
We will not be installing just this one job, but all jobs from a
transaction. All requirement dependencies will be included in it and
will be installed separately. Every transaction job will get a chance
to cancel its own conflicting installed job. |
1ca6783f5ea3755bd83e723f529c2eda512c7fed |
|
13-Oct-2012 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
log: introduce a macro to format message id
The MESSAGE_ID=... stanza will appear in countless number of places.
It is just too long to write it out in full each time.
Incidentally, this also fixes a typo of MESSSAGE is three places. |
81270860a5b8c6794f0c7bac8becfdd0c41a9385 |
|
04-Sep-2012 |
Lennart Poettering <lennart@poettering.net> |
journal: suppress structured messages if they'd go to the console |
877d54e9b09e093c2102f519a84e2a52637ae035 |
|
04-Sep-2012 |
Lennart Poettering <lennart@poettering.net> |
journal: generate structured journal messages for a number of events |
7cf82e0bb1ebafd054824d6fc7121050397824e9 |
|
14-May-2012 |
Michal Schmidt <mschmidt@redhat.com> |
job: info message if JOB_VERIFY_ACTIVE detects an inactive unit |
1f136e7acffe0354c0a0639a6280c6e75a6d7739 |
|
14-May-2012 |
Michal Schmidt <mschmidt@redhat.com> |
job: report the status of first half of JOB_RESTART the same as JOB_STOP |
c69182961b00707d977957cf81d5c41cfbeab429 |
|
14-May-2012 |
Michal Schmidt <mschmidt@redhat.com> |
unit: unit type dependent status messages
Instead of generic "Starting..." and "Started" messages for all unit use
type-dependent messages. For example, mounts will announce "Mounting..."
and "Mounted".
Add status messages to units of types that used to be entirely silent
(automounts, sockets, targets, devices). For unit types whose jobs are
instantaneous, report only the job completion, not the starting event.
Socket units with non-instantaneous jobs are rare (Exec*= is not used
often in socket units), so I chose not to print the starting messages
for them either.
This will hopefully give people better understanding of the boot. |
5f23d5b149513d98bb90df8cb912b6f567bed89f |
|
14-May-2012 |
Michal Schmidt <mschmidt@redhat.com> |
job: change red [ABORT] status to yellow [DEPEND]
The red "[ABORT]" for a dependency failure is too scary.
It suggests a crash. And it suggests a problem with the unit itself.
Change it to a yellow "[DEPEND]" message. The color communicates the
level of seriousness better. |
66aa6f7fbb16f441b28196c46a8c3fd60ed39d1b |
|
14-May-2012 |
Michal Schmidt <mschmidt@redhat.com> |
job: only jobs on the runqueue can be run |
e0209d83e7b30153f43b1a633c955f66eb2c2e4a |
|
25-Apr-2012 |
Michal Schmidt <mschmidt@redhat.com> |
core: add NOP jobs, job type collapsing
Two of our current job types are special:
JOB_TRY_RESTART, JOB_RELOAD_OR_START.
They differ from other job types by being sensitive to the unit active state.
They perform some action when the unit is active and some other action
otherwise. This raises a question: when exactly should the unit state be
checked to make the decision?
Currently the unit state is checked when the job becomes runnable. It's more
sensible to check the state immediately when the job is added by the user.
When the user types "systemctl try-restart foo.service", he really intends
to restart the service if it's running right now. If it isn't running right
now, the restart is pointless.
Consider the example (from Bugzilla[1]):
sleep.service takes some time to start.
hello.service has After=sleep.service.
Both services get started. Two jobs will appear:
hello.service/start waiting
sleep.service/start running
Then someone runs "systemctl try-restart hello.service".
Currently the try-restart operation will block and wait for
sleep.service/start to complete.
The correct result is to complete the try-restart operation immediately
with success, because hello.service is not running. The two original
jobs must not be disturbed by this.
To fix this we introduce two new concepts:
- a new job type: JOB_NOP
A JOB_NOP job does not do anything to the unit. It does not pull in any
dependencies. It is always immediately runnable. When installed to a unit,
it sits in a special slot (u->nop_job) where it never conflicts with
the installed job (u->job) of a different type. It never merges with jobs
of other types, but it can merge into an already installed JOB_NOP job.
- "collapsing" of job types
When a job of one of the two special types is added, the state of the unit
is checked immediately and the job type changes:
JOB_TRY_RESTART -> JOB_RESTART or JOB_NOP
JOB_RELOAD_OR_START -> JOB_RELOAD or JOB_START
Should a job type JOB_RELOAD_OR_START appear later during job merging, it
collapses immediately afterwards.
Collapsing actually makes some things simpler, because there are now fewer
job types that are allowed in the transaction.
[1] Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=753586 |
5273510e9f228a300ec6207d4502f1c6253aed5e |
|
23-Apr-2012 |
Michal Schmidt <mschmidt@redhat.com> |
transaction: cancel jobs non-recursively on isolate
Recursive cancellation of jobs would trigger OnFailure actions of
dependent jobs. This is not desirable when isolating.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=798328 |
39a18c60d07319ebfcfd476556729c2cadd616d6 |
|
24-Apr-2012 |
Michal Schmidt <mschmidt@redhat.com> |
job: serialize jobs properly
Jobs were not preserved correctly over a daemon-reload operation.
A systemctl process waiting for a job completion received a job removal
signal. The job itself changed its id. The job timeout started ticking all
over again.
This fixes the deficiencies. |
78ff1acdfe6a1f50d4ac62dc354c667999be0508 |
|
22-Apr-2012 |
Lennart Poettering <lennart@poettering.net> |
job: the status messages are proper sentences, hence end them with a full stop |
97e6a11996855800f68dc41c13537784198c8b61 |
|
20-Apr-2012 |
Michal Schmidt <mschmidt@redhat.com> |
dbus-job: allow multiple bus clients
Merging of jobs can result in more than one client being interested in a job. |
d6a093d098054b6fe866441251ad9485c9e31584 |
|
20-Apr-2012 |
Michal Schmidt <mschmidt@redhat.com> |
transaction: remove checks for installed
Transactions cannot contain installed jobs anymore. Remove the now pointless
checks. |
656bbffc6c45bdd8d5c28a96ca948ba16c546547 |
|
20-Apr-2012 |
Michal Schmidt <mschmidt@redhat.com> |
transaction: rework merging with installed jobs
Previously transactions could reference installed jobs. It made some issues
difficult to fix.
This sets new rules for jobs:
A job cannot be both a member of a transaction and installed. When jobs are
created, they are linked to a transaction. The whole transaction is constructed
(with merging of jobs within, etc.). When it's complete, all the jobs are
unlinked from it one by one and let to install themselves. It is during the
installation when merging with previously installed jobs (from older
transactions) is contemplated.
Merging with installed jobs has different rules than merging within a
transaction:
- An installed conflicting job gets cancelled. It cannot be simply deleted,
because someone might be waiting for its completion on DBus.
- An installed, but still waiting, job can be safely merged into.
- An installed and running job can be tricky. For some job types it is safe to
just merge. For the other types we merge anyway, but put the job back into
JOB_WAITING to allow it to run again. This may be suboptimal, but it is not
currently possible to have more than one installed job for a unit.
Note this also fixes a bug where the anchor job could be deleted during merging
within the transaction. |
05d576f1f77699ea5c2e5ed0e04451b14dfc45a0 |
|
20-Apr-2012 |
Michal Schmidt <mschmidt@redhat.com> |
job: separate job_install()
Let the jobs install themselves. |
e6eda1f23efab618bb26e7015230d8552b401dc6 |
|
20-Apr-2012 |
Michal Schmidt <mschmidt@redhat.com> |
transaction: remove the anchor link
tr->anchor_job is sufficient. |
1da4264fbd0fa5e6b1bd5e0ac4674a3503774369 |
|
20-Apr-2012 |
Michal Schmidt <mschmidt@redhat.com> |
job: jobs shouldn't need to know about transaction anchors
Let the transactions maintain their own anchor links. |
668ad332a404736474749cbcc8404af3e4447170 |
|
20-Apr-2012 |
Michal Schmidt <mschmidt@redhat.com> |
job: job_new() can find the manager from the unit |
7527cb527598aaabf0ed9b38a352edb28536392a |
|
20-Apr-2012 |
Michal Schmidt <mschmidt@redhat.com> |
manager: Transaction as an object
This makes it obvious that transactions are short-lived. They are created in
manager_add_job() and destroyed after the application of jobs.
It also prepares for a split of the transaction code to a new source. |
97e7d748d1bf26790fc3b2607885f4ac8c4ecf3a |
|
20-Apr-2012 |
Michal Schmidt <mschmidt@redhat.com> |
job: job_uninstall()
Split the uninstallation of the job from job_free() into a separate function.
Adjust the callers.
job_free() now only works on unlinked and uninstalled jobs. This enforces clear
thinking about job lifetimes. |
02a3bcc6b4372ca50c0a62b193f9a75b988ffa69 |
|
20-Apr-2012 |
Michal Schmidt <mschmidt@redhat.com> |
job: allow job_free() only on already unlinked jobs
job_free() is IMO too helpful when it unlinks the job from the transaction.
The callers should ensure the job is already unlinked before freeing.
The added assertions check if anyone gets it wrong. |
691206668a0bf78895d4a5fe3772f4a10c790a90 |
|
13-Apr-2012 |
Lennart Poettering <lennart@poettering.net> |
unit: signal explicitly if a condition failed in unit_start()
We shouldn't print a status message on the console if we skipped a unit
due to a condition. Hence make unit_start() return -ENOEXEC in such a
case which is mapped to JOB_SKIPPED which results in no console message. |
5430f7f2bc7330f3088b894166bf3524a067e3d8 |
|
12-Apr-2012 |
Lennart Poettering <lennart@poettering.net> |
relicense to LGPLv2.1 (with exceptions)
We finally got the OK from all contributors with non-trivial commits to
relicense systemd from GPL2+ to LGPL2.1+.
Some udev bits continue to be GPL2+ for now, but we are looking into
relicensing them too, to allow free copy/paste of all code within
systemd.
The bits that used to be MIT continue to be MIT.
The big benefit of the relicensing is that closed source code may now
link against libsystemd-login.so and friends. |
b30e2f4c18ad81b04e4314fd191a5d458553773c |
|
11-Apr-2012 |
Kay Sievers <kay@vrfy.org> |
move libsystemd_core.la sources into core/ |