summaryrefslogtreecommitdiff
path: root/src/core/busname.c
Commit message (Collapse)AuthorAge
* core: do not spawn jobs or touch other units during coldpluggingIvan Shapovalov2015-03-07
| | | | | | | | | | | | | Because the order of coldplugging is not defined, we can reference a not-yet-coldplugged unit and read its state while it has not yet been set to a meaningful value. This way, already active units may get started again. We fix this by deferring such actions until all units have been at least somehow coldplugged. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=88401
* core: busname_supported() should cache what it detectsJohannes Hölzl2015-02-03
| | | | Add the missing "static" to actually make this a cache.
* util: rework strappenda(), and rename it strjoina()Lennart Poettering2015-02-03
| | | | | | After all it is now much more like strjoin() than strappend(). At the same time, add support for NULL sentinels, even if they are normally not necessary.
* core: output unit status output strings to console, only if we actually are ↵Lennart Poettering2015-01-28
| | | | | | | | | changing unit state Unit _start() and _stop() implementations can fail with -EAGAIN to delay execution temporarily. Thus, we should not output status messages before invoking these calls, but after, and only when we know that the invocation actually made a change.
* sd-bus: sync kdbus.h (API break)Daniel Mack2015-01-12
| | | | | Just a simple variable rename, and a dropped flag that sd-bus didn't make use of.
* core: rearrange code so that libsystemd/sd-bus/ does not include header ↵Lennart Poettering2014-12-23
| | | | | | | files from core Stuff in src/shared or src/libsystemd should *never* include code from src/core or any of the tools, so don't do that here either. It's not OK!
* busname: fix CMD_FREE ioctlDaniel Mack2014-12-22
| | | | The KDBUS_CMD_FREE ioctl struct has a size field now, which needs to be set.
* unit: handle nicely of certain unit types are not supported on specific systemsLennart Poettering2014-12-15
| | | | | | | | | | | | 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.
* bus: sync with kdbus.gitDavid Herrmann2014-12-11
| | | | | | | | | | Sync up with recent kdbus changed: * several ioctls gained .size and .items members (but still unused) * CMD_SEND gained its own ioctl structure * several members of kdbus_msg were dropped as they were only used during SEND, not during RECV etc. * CMD_RECV and CMD_SEND now share a kdbus_reply member which contains the offset and size of the returned message.
* treewide: more log_*_errno + return simplificationsMichal Schmidt2014-11-28
|
* core: two more log_unit_*_errno() conversionsMichal Schmidt2014-11-28
|
* core: convert log_unit_*() to log_unit_*_errno()Michal Schmidt2014-11-28
| | | | | | Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_unit_(debug|info|notice|warning|error|emergency)\(([^"]+), "(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_unit_\1_errno(\2, \5, "\3%m"\4);/'
* treewide: no need to negate errno for log_*_errno()Michal Schmidt2014-11-28
| | | | It corrrectly handles both positive and negative errno values.
* treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt2014-11-28
| | | | | | | | | | | | | 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().
* log: rearrange log function namingLennart Poettering2014-11-27
| | | | | | | | | | - 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.
* sd-bus: update peeking into receieved messages, with recent kernel change we ↵Lennart Poettering2014-11-26
| | | | need to FREE them after all
* core: show log message about process triggering kdbus service activationLennart Poettering2014-11-25
|
* core: send sigabrt on watchdog timeout to get the stacktraceUmut Tezduyar Lindskog2014-10-28
| | | | | if sigabrt doesn't do the job, follow regular shutdown routine, sigterm > sigkill.
* bus: factor out bus policy itemsDaniel Mack2014-09-08
| | | | | In order to re-use the policy definitions, factor them out into their own files.
* Print kdbus path when opening failsZbigniew Jędrzejewski-Szmek2014-07-26
| | | | This makes it easier to debug what is going on.
* busname: CLD_KILLED was used twiceLukas Nykryn2014-07-25
|
* doc: grammatical correctionsJan Engelhardt2014-06-28
|
* Fix spelling mistake, proces -> processColin Ian King2014-06-07
|
* kdbus: when uploading bus name policy, resolve users/groups out-of-processLennart Poettering2014-06-05
| | | | | It's not safe invoking NSS from PID 1, hence fork off worker processes that upload the policy into the kernel for busnames.
* core: by default .busname units should be activatingLennart Poettering2014-03-19
|
* busname: introduce Activating directiveDaniel Mack2014-03-19
| | | | | | | | Add a new config 'Activating' directive which denotes whether a busname is actually registered on the bus. It defaults to 'yes'. If set to 'no', the .busname unit only uploads policy, which will remain active as long as the unit is running.
* core: add new AcceptFD= setting to .busname unitsLennart Poettering2014-03-18
| | | | | | | | | | | | | | | | | AcceptFD= defaults to true, thus making sure that by default fd passing is enabled for all activatable names. Since for normal bus connections fd passing is enabled too by default this makes sure fd passing works correctly regardless whether a service is already activated or not. Making this configurable on both busname units and in bus connections is messy, but unavoidable since busnames are established and may queue messages before the connection feature negotiation is done by the service eventually activated. Conversely, feature negotiation on bus connections takes place before the connection acquires its names. Of course, this means developers really should make sure to keep the settings in .busname units in sync with what they later intend to negotiate.
* util: replace close_nointr_nofail() by a more useful safe_close()Lennart Poettering2014-03-18
| | | | | | | | | | | | | | | safe_close() automatically becomes a NOP when a negative fd is passed, and returns -1 unconditionally. This makes it easy to write lines like this: fd = safe_close(fd); Which will close an fd if it is open, and reset the fd variable correctly. By making use of this new scheme we can drop a > 200 lines of code that was required to test for non-negative fds or to reset the closed fd variable afterwards.
* sd-bus: add support for policy upload on activator connectionsDaniel Mack2014-03-07
| | | | | | Activator connections may upload policy when registering to the bus. This patch contains code to translate between BusNamePolicy objects and the kdbus specific items.
* busname: add parser for bus name policiesDaniel Mack2014-03-07
| | | | | | | | | | | | | | | | | There are three directives to specify bus name polices in .busname files: * AllowUser [username] [access] * AllowGroup [groupname] [access] * AllowWorld [access] Where [access] is one of * 'see': The user/group/world is allowed to see a name on the bus * 'talk': The user/group/world is allowed to talk to a name * 'own': The user/group/world is allowed to own a name There is no user added yet in this commit.
* busname: don't drop 'service' from the result stringLennart Poettering2014-03-07
|
* core/busname: add lookup string for BUSNAME_FAILURE_SERVICE_FAILED_PERMANENTDaniel Mack2014-03-07
| | | | | | | When a busname unit enters BUSNAME_FAILURE_SERVICE_FAILED_PERMANENT, the serialization will not be able to look up the result as string via busname_result_to_string(). This leads to an assertion trap during daemon-reexec.
* api: in constructor function calls, always put the returned object pointer ↵Lennart Poettering2014-02-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* bus: when we cannot bus activate a service because we go down, drop oneLennart Poettering2014-01-27
| | | | message from the queue
* core: no need to list properties for PropertiesChanged messages anymoreLennart Poettering2013-12-22
| | | | Since the vtable includes this information anyway, let's just use that
* bus: when a busname unit refuses to activate a service it should flush the queueLennart Poettering2013-12-16
|
* busname: improve condition checkLennart Poettering2013-12-05
|
* bus: add .busname unit type to implement kdbus-style bus activationLennart Poettering2013-12-02