summaryrefslogtreecommitdiffstats
path: root/src/core/dbus-unit.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* dbus: suppress duplicate and misleading messagesLennart Poettering2014-03-111-10/+2
| | | | | | | | When we try to send a signal on a connection we didn't hae the time to process the Disconnected message yet, don't generate multiple warning messages, but only a single debug message. https://bugs.freedesktop.org/show_bug.cgi?id=75874
* bus: add sd_bus_track object for tracking peers, and port core over to itLennart Poettering2014-03-031-13/+21
| | | | | | | | | | | | | | | | | | | 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.
* api: in constructor function calls, always put the returned object pointer ↵Lennart Poettering2014-02-201-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* core: fix property changes in transient unitsLennart Poettering2014-02-171-3/+0
|
* core: fix oom checkLennart Poettering2014-01-311-1/+1
|
* Use enums to make it obvious what boolean params meanZbigniew Jędrzejewski-Szmek2013-12-261-2/+2
| | | | Suggested-by: Russ Allbery <rra@debian.org>
* core: no need to list properties for PropertiesChanged messages anymoreLennart Poettering2013-12-221-18/+14
| | | | Since the vtable includes this information anyway, let's just use that
* bus: decorate the various object vtables with SD_BUS_VTABLE_PROPERTY_CONST ↵Lennart Poettering2013-12-221-47/+47
| | | | where appropriate
* core: fix Unit.SetProperties argument parsingDavid Herrmann2013-12-111-8/+0
| | | | | | SetProperties has signature "ba(sv)", but the bus_unit_set_properties() helper already does a enter_container('a', "sv") so we have to skip it in bus_unit_method_set_properties().
* service: add the ability for units to join other unit's PrivateNetwork= and ↵Lennart Poettering2013-11-271-0/+1
| | | | PrivateTmp= namespaces
* core: replace OnFailureIsolate= setting by a more generic OnFailureJobMode= ↵Lennart Poettering2013-11-261-1/+2
| | | | setting and make use of it where applicable
* core: fix bus serialization of conditionsLennart Poettering2013-11-251-1/+4
|
* core: don't warn loudly if we cannot send a bus signal to a disconnected clientLennart Poettering2013-11-221-4/+2
|
* core: fix deserialization of StartTransientUnit() parametersLennart Poettering2013-11-211-1/+10
|
* bus: rework message handlers to always take an error argumentLennart Poettering2013-11-211-79/+87
| | | | | | | | | | | | | | | | | | | | Message handler callbacks can be simplified drastically if the dispatcher automatically replies to method calls if errors are returned. Thus: add an sd_bus_error argument to all message handlers. When we dispatch a message handler and it returns negative or a set sd_bus_error we send this as message error back to the client. This means errors returned by handlers by default are given back to clients instead of rippling all the way up to the event loop, which is desirable to make things robust. As a side-effect we can now easily turn the SELinux checks into normal function calls, since the method call dispatcher will generate the right error replies automatically now. Also, make sure we always pass the error structure to all property and method handlers as last argument to follow the usual style of passing variables for return values as last argument.
* bus: let's simplify things by getting rid of unnecessary bus parametersLennart Poettering2013-11-211-19/+19
|
* core: convert PID 1 to libsystemd-busLennart Poettering2013-11-201-717/+591
| | | | | | | | | | | | | | | | | | | | | | 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.
* bus: remove static introspection file exportKay Sievers2013-10-211-1/+1
|
* list: make our list macros a bit easier to use by not requring type spec on ↵Lennart Poettering2013-10-141-2/+2
| | | | | | | 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.
* cgroup: only check once when mode is UNIT_CHECKGao feng2013-08-281-1/+1
| | | | | | If the mode is UNIT_CHECK,it means we only want to check if the paramaters are valid. the first round of cycle already did this check, no need to check again.
* systemd,systemctl: export condition status and show failing conditionZbigniew Jędrzejewski-Szmek2013-07-181-62/+115
| | | | | | | | | | | | | | | | | | | | | | | $ systemctl --user status hoohoo hoohoo.service Loaded: loaded (/home/zbyszek/.config/systemd/user/hoohoo.service; static) Active: inactive (dead) start condition failed at Tue 2013-06-25 18:08:42 EDT; 1s ago ConditionPathExists=/tmp/hoo was not met Full information is exported over D-Bus: [(condition, trigger, negate, param, state),...] where state is one of "failed" (<0), "untested" (0), "OK" (>0). I've decided to use 0 for "untested", because it might be useful to differentiate different types of failure later on, without breaking compatibility. systemctl shows the failing condition, if there was a non-trigger failing condition, or says "none of the trigger conditions were met", because there're often many trigger conditions, and they must all fail for the condition to fail, so printing them all would consume a lot of space, and bring unnecessary attention to something that is quite low-level.
* core: simplify drop-in writing logic a bitLennart Poettering2013-07-111-23/+13
| | | | let's make use of some format string magic!
* core: when writing drop-in files, name them directly after the property we setLennart Poettering2013-07-111-2/+2
| | | | | | Mapping from "FooBar" to "foo-bar" is unnecessary and makes it hard to handle many different properties with the same code, hence, let's just not do it.
* user-sessions: rely on PID 1 to kill sessionsLennart Poettering2013-07-101-0/+57
| | | | | | | As we want to centralized cgroup access we should stop killing the user sessions directly from the systemd-user-sessions service. Instead, rely on PID 1 doing this by adding the right ordering dependencies to the session scope units.
* unit: save description/slice of transient units to /runLennart Poettering2013-07-101-0/+15
| | | | This is necessary so that these properties survive a daemon reload.
* core: while we are reloading don't suppress bus signalsLennart Poettering2013-07-101-20/+32
| | | | | | | While we are reloading we shouldn't suppress adding units to the bus queue when there are no subscribers, simply because we might not have deserialized the subscribers list yet. Hence, during reloading always assume we have subscribers.
* machined: sync to /run after job completedLennart Poettering2013-07-021-12/+20
|
* core: add support to run transient units in arbitrary slicesLennart Poettering2013-07-011-0/+19
|
* core: move ControlGroup and Slice properties out of the dbus "Unit" interfaceLennart Poettering2013-07-011-2/+5
| | | | | | | | | | | Slice/ControlGroup only really makes sense for unit types which actually have cgroups attached to them, hence move them out of the generic Unit interface and into the specific unit type interfaces. These fields will continue to be part of Unit though, simply because things are a log easier that way. However, regardless how this looks internally we should keep things clean and independent of the specific implementation of the inside.
* core: allow setting of the description string for transient unitsLennart Poettering2013-07-011-0/+33
|
* core: add transient unitsLennart Poettering2013-06-281-4/+14
| | | | | | | | | | | | | | | | | | 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.
* unit: make sure the dropins we write are high-priorityLennart Poettering2013-06-281-2/+1
|
* dbus: add infrastructure for changing multiple properties at once on units ↵Lennart Poettering2013-06-271-0/+88
| | | | | | | | | | | | | | | | and hook some cgroup attributes up to it This introduces two bus calls to make runtime changes to selected bus properties, optionally with persistence. This currently hooks this up only for three cgroup atributes, but this brings the infrastructure to add more changable attributes. This allows setting multiple attributes at once, and takes an array rather than a dictionary of properties, in order to implement simple resetting of lists using the same approach as when they are sourced from unit files. This means, that list properties are appended to by this call, unless they are first reset via assigning the empty list.
* core: general cgroup reworkLennart Poettering2013-06-271-529/+1
| | | | | | | | | | | | | | | | Replace the very generic cgroup hookup with a much simpler one. With this change only the high-level cgroup settings remain, the ability to set arbitrary cgroup attributes is removed, so is support for adding units to arbitrary cgroup controllers or setting arbitrary paths for them (especially paths that are different for the various controllers). This also introduces a new -.slice root slice, that is the parent of system.slice and friends. This enables easy admin configuration of root-level cgrouo properties. This replaces DeviceDeny= by DevicePolicy=, and implicitly adds in /dev/null, /dev/zero and friends if DeviceAllow= is used (unless this is turned off by DevicePolicy=).
* logind: add infrastructure to keep track of machines, and move to slicesLennart Poettering2013-06-201-4/+1
| | | | | | | | | | | | | | | | | | | | - This changes all logind cgroup objects to use slice objects rather than fixed croup locations. - logind can now collect minimal information about running VMs/containers. As fixed cgroup locations can no longer be used we need an entity that keeps track of machine cgroups in whatever slice they might be located. Since logind already keeps track of users, sessions and seats this is a trivial addition. - nspawn will now register with logind and pass various bits of metadata along. A new option "--slice=" has been added to place the container in a specific slice. - loginctl gained commands to list, introspect and terminate machines. - user.slice and machine.slice will now be pulled in by logind.service, since only logind.service requires this slice.
* core: expose a "Slice" property on Unit objects on the busLennart Poettering2013-06-181-0/+20
|
* move _cleanup_ attribute in front of the typeHarald Hoyer2013-04-181-2/+2
| | | | http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html
* nspawn: introduce the new /machine/ tree in the cgroup tree and move ↵Lennart Poettering2013-04-161-1/+1
| | | | | | | | | | | | | | containers there Containers will now carry a label (normally derived from the root directory name, but configurable by the user), and the container's root cgroup is /machine/<label>. This label is called "machine name", and can cover both containers and VMs (as soon as libvirt also makes use of /machine/). libsystemd-login can be used to query the machine name from a process. This patch also includes numerous clean-ups for the cgroup code.
* Replace s/Dropin/DropIn/Zbigniew Jędrzejewski-Szmek2013-04-021-1/+1
|
* Introspect and monitor dropin configurationOleksii Shevchuk2013-04-021-0/+1
|
* Use bus_maybe_send_reply() where applicableColin Walters2013-03-191-3/+3
| | | | | | | | | This is a followup to: commit 1a37b9b9043ef83e9900e460a9a1fccced3acf89 It will fix denial messages from dbus-daemon between gdm and systemd-logind on logging into GNOME due to this. See the previous commit for more details.
* unit: rework resource management APILennart Poettering2013-02-271-134/+195
| | | | | | | | | This introduces a new static list of known attributes and their special semantics. This means that cgroup attribute values can now be automatically translated from user to kernel notation for command line set settings, too. This also adds proper support for multi-line attributes.
* honor SELinux labels, when creating and writing config filesHarald Hoyer2013-02-141-0/+1
| | | | | | | Also split out some fileio functions to fileio.c and provide a SELinux aware pendant in fileio-label.c see https://bugzilla.redhat.com/show_bug.cgi?id=881577
* unit: optionally allow making cgroup attribute changes persistentLennart Poettering2013-01-191-26/+77
|
* systemctl: add new "get-cgroup-attr" to query current cgroup attribute valueLennart Poettering2013-01-181-0/+89
| | | | Also adds a pair of bus calls for this to the daemon.
* core: add bus API and systemctl commands for altering cgroup parameters ↵Lennart Poettering2013-01-141-3/+247
| | | | during runtime
* core/dbus-unit: modernize styleZbigniew Jędrzejewski-Szmek2013-01-061-52/+42
|
* selinux: remove anything PID1-specific from selinux-access.[ch] so that we ↵Lennart Poettering2012-10-021-1/+1
| | | | can reuse it in logind
* selinux: rework selinux access check logicLennart Poettering2012-10-021-70/+104
| | | | | | | | | | | | | | a) Instead of parsing the bus messages inside of selinux-access.c simply pass everything pre-parsed in the functions b) implement the access checking with a macro that resolves to nothing on non-selinux builds c) split out the selinux checks into their own sources selinux-util.[ch] d) this unifies the job creation code behind the D-Bus calls Manager.StartUnit() and Unit.Start().
* selinux: prefer source path over fragment pathLennart Poettering2012-09-181-2/+2
|