Commit graph

154 commits

Author SHA1 Message Date
Kay Sievers 28c758de94 Revert "manager: print ephemeral information about running jobs' timeouts"
This reverts commit 2cba2e0352.

It breaks bootup with dracut, the transition to the real rootfs fails.
2014-01-28 12:03:23 +01:00
Zbigniew Jędrzejewski-Szmek cb8ccb2271 manager: also turn on output on unit failure 2014-01-27 23:17:03 -05:00
Zbigniew Jędrzejewski-Szmek d450b6f2a9 manager: add systemd.show_status=auto mode
When set to auto, status will shown when the first ephemeral message
is shown (a job has been running for five seconds). Then until the
boot or shutdown ends, status messages will be shown.

No indication about the switch is done: I think it should be clear
for the user that first the cylon eye and the ephemeral messages appear,
and afterwards messages are displayed.

The initial arming of the event source was still wrong, but now should
really be fixed.
2014-01-27 23:17:03 -05:00
Zbigniew Jędrzejewski-Szmek 8e33886ec5 Replace mkostemp+unlink with open(O_TMPFILE)
This will only work on Linux >= 3.11, and probably not on all
filesystems. Fallback code is provided.
2014-01-27 23:17:02 -05:00
Zbigniew Jędrzejewski-Szmek fd08a8403f manager: rearm jobs timer
It would fire just once.

Also fix units from sec to usec as appropriate.

Decrease the switching interval to 1/3 s, so that when the time
remaining is displayed with 1s precision, it doesn't jump by 2s every
once in a while. Also, the system is feels noticably faster when the
status changes couple of times per second instead of every few
seconds.
2014-01-27 01:23:16 -05:00
Zbigniew Jędrzejewski-Szmek 2cba2e0352 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.
2014-01-27 01:23:16 -05:00
Lennart Poettering f069efb471 core: don't allow setting NOTIFY_SOCKET and similar env vars we need ourselves via SetEnvironment bus calls
We just quietly eat them up, so that simple environment importing still
works without error.
2014-01-12 20:10:40 +08:00
Lennart Poettering 43d03a8376 core: clean up environment block for --user instances a bit 2014-01-12 19:41:57 +08:00
Zbigniew Jędrzejewski-Szmek 5bf348d77e core: fix unused variable 2014-01-11 10:07:22 -05:00
Zbigniew Jędrzejewski-Szmek a2cc4a6c96 core: fix lack of notifications after reload 2014-01-09 20:50:49 -05:00
Kay Sievers fcc81ea361 core: --user -- move generator directories from /tmp to $XDG_RUNTIME_DIR 2014-01-07 01:35:13 +08:00
Kay Sievers 88c59cb3c1 bus: always create --user bus when kdbus is active
We set the variable in the unit file for --user, so this check is
always true.
2014-01-03 02:59:05 +01:00
Zbigniew Jędrzejewski-Szmek ccd06097c7 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.
2014-01-02 19:45:47 -05:00
Zbigniew Jędrzejewski-Szmek a9244623f7 core/manager: print info about interesting signals
Information about signals which are not routinely received by systemd
are printed at info level. This should make it easier to see what is
happening in the system.
2014-01-02 19:45:47 -05:00
Zbigniew Jędrzejewski-Szmek f78e6385dc Use enums to make it obvious what boolean params mean
Suggested-by: Russ Allbery <rra@debian.org>
2013-12-26 15:49:54 -05:00
Lennart Poettering f2769777c8 bus: make system bus kdbus node world-accessible 2013-12-26 03:08:15 +01:00
Lennart Poettering be04cbca6c core: when we close the notify fd, we also need to free its event source 2013-12-23 21:01:32 +01:00
Lennart Poettering 9bf3b53533 shared: switch our hash table implementation over to SipHash
SipHash appears to be the new gold standard for hashing smaller strings
for hashtables these days, so let's make use of it.
2013-12-22 21:12:25 +01:00
Lennart Poettering d86f9d5285 core: pass notify fd across reexecs
That way we the random socket name stays stable across reexec and we
won't lose client messages.
2013-12-21 00:53:22 +01:00
Lennart Poettering fa28bc2df7 core: priorize notification fd processing over notification fd process via sd-event's logic 2013-12-18 18:21:27 +01:00
Lennart Poettering d003f514da core: always create /dev/kdbus/ns (and make it private 0700) after setting up the kdbus system bus 2013-12-17 01:05:37 +01:00
Lennart Poettering 7b77ed8cf3 event: be more conservative when returning errors from event handler callbacks
We really should return errors from event handlers if we have a
continous problem and don't know any other solution.
2013-12-13 04:06:43 +01:00
Shawn Landden 9a636ed809 core: epoll and signalfd has been moved into sd event loop 2013-12-10 22:50:29 +00:00
Shawn Landden 145b1f799f core/manager: remove infinite loop 2013-12-10 18:08:25 +00:00
Zbigniew Jędrzejewski-Szmek 2b6bf07dd2 Get rid of our reimplementation of basename
The only problem is that libgen.h #defines basename to point to it's
own broken implementation instead of the GNU one. This can be fixed
by #undefining basename.
2013-12-06 21:29:55 -05:00
Lennart Poettering a6aa89122d bus: don't make use of the private bus socket if kdbus is available 2013-12-03 19:55:51 +01:00
Lennart Poettering 8bf9fcf488 core: extra paranoia when deserializing kdbus fd 2013-12-02 23:32:34 +01:00
Lennart Poettering 626851be97 bus: do kdbus only if this is enabled on the configure switch
Since we want to retain the ability to break kernel ←→ userspace ABI
after the next release, let's not make use by default of kdbus, so that
people with future kernels will not suddenly break with current systemd
versions.

kdbus support is left in all builds but must now be explicitly requested
at runtime (for example via setting $DBUS_SESSION_BUS). Via a configure
switch the old behaviour can be restored. In fact, we change autogen.sh
to do this, so that git builds (which run autogen.sh) get kdbus by
default, but tarball builds (which ue the configure defaults) do not get
it, and hence this stays out of the distros by default.
2013-11-30 20:18:48 +01:00
Lennart Poettering 9bd37b40fa nspawn: set up a kdbus namespace when starting a container 2013-11-30 16:36:46 +01:00
Lennart Poettering e3dd987cfc core: allocate a kdbus bus for each systemd instance, if we can 2013-11-30 03:53:42 +01:00
Daniel Buch f5f6d0e255 tree-wide usage of %m specifier instead of strerror(errno)
Also for log_error() except where a specific error is specified

e.g. errno ? strerror(errno) : "Some user specified message"
2013-11-26 21:07:46 +10:00
Lennart Poettering 9670d583d3 swap: always track the current real device node of all swap devices, even when not active
This way, we can avoid executing two /bin/swapon jobs to be dispatched
for the same swap device if it is configured for two different paths.

Previously we were just tracking the device nodes of active swap
devices, which would not allow us to recognize the identity of two swap
devices before they are active.

https://bugs.freedesktop.org/show_bug.cgi?id=69835
2013-11-25 22:10:22 +01:00
Lennart Poettering 290837072b core: set some event source priorities to enforce dispatching order 2013-11-25 17:40:53 +01:00
Lennart Poettering 752b590500 core: dispatch run queue only if there's nothing else to do
Always read all external events before we decide what we do next.
2013-11-25 17:40:53 +01:00
Kay Sievers 828db5d84a core: set finish_timestamp only after all jobs have finished 2013-11-24 19:18:36 +01:00
Lennart Poettering 9d5a3757c3 manager: always sort environment block, it's prettier 2013-11-21 21:12:36 +01:00
Lennart Poettering 3772995afa manager: don't do plymouth in a container
Given that plymouth listens on an abstract namespace socket and if
CLONE_NEWNET is not used the abstract namespace is shared with the host
we might actually end up send plymouth data to the host.
2013-11-20 20:58:17 +01:00
Lennart Poettering 718db96199 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.
2013-11-20 20:52:36 +01:00
Olivier Brunel 2f38577f30 Only disable output on console during boot if needed
If there are no more jobs on console, no need/we shouldn't disable output.
2013-11-13 23:22:31 -05:00
Lennart Poettering 9588bc3209 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.
2013-11-08 18:12:45 +01:00
David Strauss f366954523 Comment spelling fixes. 2013-11-06 20:03:18 +10:00
Kay Sievers df28bc0836 build-sys: use -Og instead of -O0 to catch warnings
$ touch src/core/dbus.c; make CFLAGS=-O0
  make --no-print-directory all-recursive
  Making all in .
    CC       src/core/libsystemd_core_la-dbus.lo
    CCLD     libsystemd-core.la

  $ touch src/core/dbus.c; make CFLAGS=-Og
  make --no-print-directory all-recursive
  Making all in .
    CC       src/core/libsystemd_core_la-dbus.lo
  src/core/dbus.c: In function 'init_registered_system_bus':
  src/core/dbus.c:798:18: warning: 'id' may be used uninitialized in this function [-Wmaybe-uninitialized]
           dbus_free(id);
                    ^
    CCLD     libsystemd-core.la

-Og Optimize debugging experience. -Og enables optimizations that do
not interfere with debugging. It should be the optimization level of
choice for the standard edit-compile-debug cycle, offering a
reasonable level of optimization while maintaining fast compilation
and a good debugging experience.
2013-10-21 15:46:00 +02:00
Lennart Poettering 71fda00f32 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.
2013-10-14 06:11:19 +02:00
Mantas Mikulėnas a0a6408e31 manager: connect to private bus even if $DBUS_SESSION_BUS_ADDRESS is not set
Because that's exactly the kind of situation where the private bus is
necessary.
2013-10-13 23:01:23 -04:00
Zbigniew Jędrzejewski-Szmek 51d122af23 Introduce _cleanup_fdset_free_ 2013-10-13 17:56:54 -04:00
Lennart Poettering bcd8e6d1bd local: fix memory leak when putting together locale settings
Also, we need to use proper strv_env_xyz() calls when putting together
the environment array, since otherwise settings won't be properly
overriden.

And let's get rid of strv_appendf(), is overkill and there was only one
user.
2013-10-01 00:17:21 +02:00
Lennart Poettering a57f7e2c82 core: rework how we match mount units against each other
Previously to automatically create dependencies between mount units we
matched every mount unit agains all others resulting in O(n^2)
complexity. On setups with large amounts of mount units this might make
things slow.

This change replaces the matching code to use a hashtable that is keyed
by a path prefix, and points to a set of units that require that path to
be around. When a new mount unit is installed it is hence sufficient to
simply look up this set of units via its own file system paths to know
which units to order after itself.

This patch also changes all unit types to only create automatic mount
dependencies via the RequiresMountsFor= logic, and this is exposed to
the outside to make things more transparent.

With this change we still have some O(n) complexities in place when
handling mounts, but that's currently unavoidable due to kernel APIs,
and still substantially better than O(n^2) as before.

https://bugs.freedesktop.org/show_bug.cgi?id=69740
2013-09-26 20:20:30 +02:00
Kay Sievers c51d84dc09 support acpi firmware performance data (FPDT)
Prefer firmware-provided performance data over loader-exported ones; if
ACPI data is available, always use it, otherwise try to read the loader
data.

The firmware-provided variables start at the time the first EFI image
is executed and end when the operating system exits the boot services;
the (loader) time calculated in systemd-analyze increases.
2013-09-24 15:43:41 +02:00
Zbigniew Jędrzejewski-Szmek 43638332c4 man: add a list of environment variables 2013-09-17 10:26:30 -05:00
Zbigniew Jędrzejewski-Szmek c9d954b27e run: allow non-absolute paths as command 2013-09-09 13:49:30 -04:00