summaryrefslogtreecommitdiff
path: root/src/core/manager.c
AgeCommit message (Collapse)Author
2014-01-28manager: remove "debugging" "feature"Zbigniew Jędrzejewski-Szmek
2014-01-28manager: requeue the cylon eye for 5s later when a job finishesZbigniew Jędrzejewski-Szmek
We'd reqeue the next status update very soon after. Change it so that we wait for full 5s without any job status changes until we print anything.
2014-01-28manager: print ephemeral information about running jobs' timeouts (v2)Zbigniew Jędrzejewski-Szmek
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.
2014-01-28Revert "manager: print ephemeral information about running jobs' timeouts"Kay Sievers
This reverts commit 2cba2e03524ec0922ddc70f933e8a89b7d23b4ec. It breaks bootup with dracut, the transition to the real rootfs fails.
2014-01-27manager: also turn on output on unit failureZbigniew Jędrzejewski-Szmek
2014-01-27manager: add systemd.show_status=auto modeZbigniew Jędrzejewski-Szmek
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-27Replace mkostemp+unlink with open(O_TMPFILE)Zbigniew Jędrzejewski-Szmek
This will only work on Linux >= 3.11, and probably not on all filesystems. Fallback code is provided.
2014-01-27manager: rearm jobs timerZbigniew Jędrzejewski-Szmek
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-27manager: print ephemeral information about running jobs' timeoutsZbigniew Jędrzejewski-Szmek
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-12core: don't allow setting NOTIFY_SOCKET and similar env vars we need ↵Lennart Poettering
ourselves via SetEnvironment bus calls We just quietly eat them up, so that simple environment importing still works without error.
2014-01-12core: clean up environment block for --user instances a bitLennart Poettering
2014-01-11core: fix unused variableZbigniew Jędrzejewski-Szmek
2014-01-09core: fix lack of notifications after reloadZbigniew Jędrzejewski-Szmek
2014-01-07core: --user -- move generator directories from /tmp to $XDG_RUNTIME_DIRKay Sievers
2014-01-03bus: always create --user bus when kdbus is activeKay Sievers
We set the variable in the unit file for --user, so this check is always true.
2014-01-02Use format patterns for usec_t, pid_t, nsec_t, usec_tZbigniew Jędrzejewski-Szmek
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-02core/manager: print info about interesting signalsZbigniew Jędrzejewski-Szmek
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.
2013-12-26Use enums to make it obvious what boolean params meanZbigniew Jędrzejewski-Szmek
Suggested-by: Russ Allbery <rra@debian.org>
2013-12-26bus: make system bus kdbus node world-accessibleLennart Poettering
2013-12-23core: when we close the notify fd, we also need to free its event sourceLennart Poettering
2013-12-22shared: switch our hash table implementation over to SipHashLennart Poettering
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-21core: pass notify fd across reexecsLennart Poettering
That way we the random socket name stays stable across reexec and we won't lose client messages.
2013-12-18core: priorize notification fd processing over notification fd process via ↵Lennart Poettering
sd-event's logic
2013-12-17core: always create /dev/kdbus/ns (and make it private 0700) after setting ↵Lennart Poettering
up the kdbus system bus
2013-12-13event: be more conservative when returning errors from event handler callbacksLennart Poettering
We really should return errors from event handlers if we have a continous problem and don't know any other solution.
2013-12-10core: epoll and signalfd has been moved into sd event loopShawn Landden
2013-12-10core/manager: remove infinite loopShawn Landden
2013-12-06Get rid of our reimplementation of basenameZbigniew Jędrzejewski-Szmek
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-03bus: don't make use of the private bus socket if kdbus is availableLennart Poettering
2013-12-02core: extra paranoia when deserializing kdbus fdLennart Poettering
2013-11-30bus: do kdbus only if this is enabled on the configure switchLennart Poettering
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-30nspawn: set up a kdbus namespace when starting a containerLennart Poettering
2013-11-30core: allocate a kdbus bus for each systemd instance, if we canLennart Poettering
2013-11-26tree-wide usage of %m specifier instead of strerror(errno)Daniel Buch
Also for log_error() except where a specific error is specified e.g. errno ? strerror(errno) : "Some user specified message"
2013-11-25swap: always track the current real device node of all swap devices, even ↵Lennart Poettering
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-25core: set some event source priorities to enforce dispatching orderLennart Poettering
2013-11-25core: dispatch run queue only if there's nothing else to doLennart Poettering
Always read all external events before we decide what we do next.
2013-11-24core: set finish_timestamp only after all jobs have finishedKay Sievers
2013-11-21manager: always sort environment block, it's prettierLennart Poettering
2013-11-20manager: don't do plymouth in a containerLennart Poettering
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-20core: convert PID 1 to libsystemd-busLennart Poettering
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-13Only disable output on console during boot if neededOlivier Brunel
If there are no more jobs on console, no need/we shouldn't disable output.
2013-11-08Remove dead code and unexport some callsLennart Poettering
"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-06Comment spelling fixes.David Strauss
2013-10-21build-sys: use -Og instead of -O0 to catch warningsKay Sievers
$ 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-14list: make our list macros a bit easier to use by not requring type spec on ↵Lennart Poettering
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-13manager: connect to private bus even if $DBUS_SESSION_BUS_ADDRESS is not setMantas Mikulėnas
Because that's exactly the kind of situation where the private bus is necessary.
2013-10-13Introduce _cleanup_fdset_free_Zbigniew Jędrzejewski-Szmek
2013-10-01local: fix memory leak when putting together locale settingsLennart Poettering
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-09-26core: rework how we match mount units against each otherLennart Poettering
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