summaryrefslogtreecommitdiff
path: root/src/core/unit.c
AgeCommit message (Collapse)Author
2014-11-28log: fix order of log_unit_struct() to match other logging callsLennart Poettering
Also, while we are at it, introduce some syntactic sugar for creating ERRNO= and MESSAGE= structured logging fields.
2014-11-27log: rearrange log function namingLennart Poettering
- 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.
2014-11-06core: get rid of condition.c and move the remaining call into util.cLennart Poettering
That way only one file with condition code remaining, in src/shared/, rather than src/core/. Next step: dropping the "-util" suffix from condition-util.[ch].
2014-11-06core: introduce the concept of AssertXYZ= similar to ConditionXYZ=, but ↵Lennart Poettering
fatal for a start job if not met
2014-10-30Convert the rest to sd_bus_errnomapZbigniew Jędrzejewski-Szmek
I tried to preserve most errno values, but in some cases they were inconsistent (different errno values for the same error name) or just mismatched.
2014-10-28core: send sigabrt on watchdog timeout to get the stacktraceUmut Tezduyar Lindskog
if sigabrt doesn't do the job, follow regular shutdown routine, sigterm > sigkill.
2014-10-27manager: convert ephemeral to enumZbigniew Jędrzejewski-Szmek
In preparation for subsequent changes.
2014-10-28job: optionally, when a job timeout is hit, also execute a failure actionLennart Poettering
2014-10-23unit: adjust for the possibility of set_move() failingMichal Schmidt
2014-10-23unit: place reservations before merging other's dependenciesMichal Schmidt
With the hashmap implementation that uses chaining the reservations merely ensure that the merging won't result in long bucket chains. With a future alternative implementation it will additionally reserve memory to make sure the merging won't fail.
2014-10-08unit: move UnitDependency to unit-nameLukas Nykryn
2014-10-02Rename user_runtime to user_runtime_dirZbigniew Jędrzejewski-Szmek
This makes this function name similar to user_config_home() and makes it match the name of the environment variable.
2014-10-02add a transient user unit directorySteven Allen
This patch adds a transient user unit directory under `$XDG_RUNTIME_DIR/systemd/user/` and stores transient user-instance units (such as those created by `systemd-run --user`) under there instead of putting them in $XDG_CONFIG_HOME/systemd/user/. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=67331
2014-09-15hashmap: introduce hash_ops to make struct Hashmap smallerMichal Schmidt
It is redundant to store 'hash' and 'compare' function pointers in struct Hashmap separately. The functions always comprise a pair. Store a single pointer to struct hash_ops instead. systemd keeps hundreds of hashmaps, so this saves a little bit of memory.
2014-08-30Fix a few more typosRuben Kerkhof
2014-08-21core: unify how we generate the prefix string when dumping unit stateLennart Poettering
2014-08-18core: minor modernizationsLennart Poettering
2014-08-18units: fix BindsTo= logic when applied relative to services with Type=oneshotLennart Poettering
Start jobs for Type=oneshot units are successful when the unit state transition activating → inactive took place. In such a case all units that BindsTo= on it previously would continue to run, even though the unit they dependet on was actually already gone.
2014-08-07core: warn when merged units have conflicting dependenciesZbigniew Jędrzejewski-Szmek
A unit should not Conflict with itself. It also does not make much sense for a unit to be After or Before itself, or to trigger itself in some way. If one of those dependency types is encountered, warn, instead of dropping it silently like other dependency types. % build/systemd-analyze verify test/loopy3.service ... Dependency Conflicts dropped when merging unit loopy4.service into loopy3.service Dependency ConflictedBy dropped when merging unit loopy4.service into loopy3.service
2014-08-07core: do not add dependencies to selfZbigniew Jędrzejewski-Szmek
Adds a pair of files which cause a segfault (also with systemd-analyze verify). https://bugzilla.redhat.com/show_bug.cgi?id=1124843
2014-07-20path-lookup: make SYSTEMD_UNIT_PATH more flexibleZbigniew Jędrzejewski-Szmek
It can now contain more than one directory, and can be used to only prepend, not totally override, the normal load path.
2014-06-30cryptsetup: allow x-systemd.device-timeoutZbigniew Jędrzejewski-Szmek
https://bugs.freedesktop.org/show_bug.cgi?id=54210
2014-06-30Move x-systemd-device.timeout handling from core to fstab-generatorZbigniew Jędrzejewski-Szmek
Instead of adjusting job timeouts in the core, let fstab-generator write out a dropin snippet with the appropriate JobTimeout. x-systemd-device.timeout option is removed from Options= line in the generated unit. The functions to write dropins are moved from core/unit.c to shared/dropin.c, to make them available outside of core. generator.c is moved to libsystemd-label, because it now uses functions defined in dropin.c, which are in libsystemd-label.
2014-05-24Fix several small typosJonathan Boulle
2014-05-22cgroups: simplify CPUQuota= logicLennart Poettering
Only accept cpu quota values in percentages, get rid of period definition. It's not clear whether the CFS period controllable per-cgroup even has a future in the kernel, hence let's simplify all this, hardcode the period to 100ms and only accept percentage based quota values.
2014-05-22cgroup: rework startup logicLennart Poettering
Introduce a (unsigned long) -1 as "unset" state for cpu shares/block io weights, and keep the startup unit set around all the time.
2014-05-22core: add startup resource control optionWaLyong Cho
Similar to CPUShares= and BlockIOWeight= respectively. However only assign the specified weight during startup. Each control group attribute is re-assigned as weight by CPUShares=weight and BlockIOWeight=weight after startup. If not CPUShares= or BlockIOWeight= be specified, then the attribute is re-assigned to each default attribute value. (default cpu.shares=1024, blkio.weight=1000) If only CPUShares=weight or BlockIOWeight=weight be specified, then that implies StartupCPUShares=weight and StartupBlockIOWeight=weight.
2014-05-16core: make sure to serialize jobs for all unitsLennart Poettering
Previously we wouldn't serialize jobs for units that themselves have nothing to serialize. http://lists.freedesktop.org/archives/systemd-devel/2014-May/019051.html
2014-05-15Make sure that keys are properly removed from hashmapZbigniew Jędrzejewski-Szmek
This is a speculative fix for https://bugzilla.redhat.com/show_bug.cgi?id=1088865. Even though I cannot find a code path that where this would be an issue, for consistency, if we assume that cgroup_path might have been set before we got to unit_deserialize, we should make sure that the unit is removed from the hashmap before we free the key. This seems to be the only place where the key could be prematurely freed, leading to hashmap corruption.
2014-04-25core: expose CFS CPU time quota as high-level unit propertiesLennart Poettering
2014-03-19core: rework context initialization/destruction logicLennart Poettering
Let's automatically initialize the kill, exec and cgroup contexts of the various unit types when the object is constructed, instead of invididually in type-specific code. Also, when PrivateDevices= is set, set DevicePolicy= to closed.
2014-03-19core: when PrivateTmp= is set for a unit, make sure to order it after /tmp ↵Lennart Poettering
and /var/tmp are mounted
2014-03-18core: drop CAP_MKNOD when PrivateDevices= is setLennart Poettering
2014-03-17core, libsystemd, systemd, timedate, udev: spelling fixesMiklos Vajna
2014-03-12core: introduce system state enumLennart Poettering
The system state knows the states starting → running/degraded/maintenance → stopping, where: starting = system startup running = normal operation degraded = at least one unit is currently in failed state maintenance = rescue/emergency mode is active or queued stopping = system shutdown
2014-03-07Make tables for DEFINE_STRING_TABLE_LOOKUP consistentDaniel Mack
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.
2014-03-06core: correctly unregister PIDs from PID hashtablesLennart Poettering
2014-03-05missing: if RLIMIT_RTTIME is not defined by the libc, then we need a new ↵Lennart Poettering
define for the max number of rlimits, too
2014-03-04Introduce strv_consume which takes ownershipZbigniew Jędrzejewski-Szmek
This mirrors set_consume and makes the common use a bit nicer.
2014-03-03bus: add sd_bus_track object for tracking peers, and port core over to itLennart Poettering
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.
2014-02-26exec: imply NoNewPriviliges= only when seccomp filters are used in user modeLennart Poettering
2014-02-24core: add global settings for enabling CPUAccounting=, MemoryAccounting=, ↵Lennart Poettering
BlockIOAccounting= for all units at once
2014-02-24core: gc half-created stub unitsLennart Poettering
2014-02-20macro: introduce a nice macro for disabling -Wformat-nonliteral temporarilyLennart Poettering
2014-02-20core/unit: fix unit_add_target_dependencies() for units with no dependenciesDaniel Mack
For units without any dependencies, r needs to be initialized to 0. Otherwise, the return value of unit_add_target_dependencies() is unspecified.
2014-02-18util: generalize code that checks whether PIDs are alive or unwaited forLennart Poettering
2014-02-17core: fix property changes in transient unitsLennart Poettering
2014-02-17unit: slice dependencies should not be subject to DefaultDependenciesLennart Poettering
2014-02-17core: rework cgroup mask propagationLennart Poettering
Previously a cgroup setting down tree would result in cgroup membership additions being propagated up the tree and to the siblings, however a unit could never lose cgroup memberships again. With this change we'll make sure that both cgroup additions and removals propagate properly.
2014-02-13core: make StopWhenUnneeded work in conjunction with units that failLennart Poettering
during their start job https://bugzilla.redhat.com/show_bug.cgi?id=997031