summaryrefslogtreecommitdiff
path: root/src/libsystemd
AgeCommit message (Collapse)Author
2015-01-06core: add new logic for services to store file descriptors in PID 1Lennart Poettering
With this change it is possible to send file descriptors to PID 1, via sd_pid_notify_with_fds() which PID 1 will store individually for each service, and pass via the usual fd passing logic on next invocation. This is useful for enable daemon reload schemes where daemons serialize their state to /run, push their fds into PID 1 and terminate, restoring their state on next start from the data in /run and passed in from PID 1. The fds are kept by PID 1 as long as no POLLHUP or POLLERR is seen on them, and the service they belong to are either not dead or failed, or have a job queued.
2015-01-05sd-bus: sync kdbus.hDaniel Mack
Catch up with latest changes in kdbus.ko: * Signals can be sent as unicast now, hence they need to be marked as such with the KDBUS_MSG_SIGNAL in the message flags. * Follow ioctl number change for KDBUS_CMD_FREE
2015-01-05systemctl: fix waiting for jobs when using direct connections to PID 1 for dbusLennart Poettering
2015-01-05machined,bus-proxy: fix connecting to containersLennart Poettering
2014-12-30tree-wide: spelling fixesVeres Lajos
https://github.com/vlajos/misspell_fixer https://github.com/torstehu/systemd/commit/b6fdeb618cf2f3ce1645b3315f15f482710c7ffa Thanks to Torstein Husebo <torstein@huseboe.net>.
2014-12-30bus: replace ENOSYS return codes with EBADR/ENOTSUPZbigniew Jędrzejewski-Szmek
ENOSYS is used to signify compiled-out functionality. Using it for different kinds of error is misleading. For BUS_ERROR_SLEEP_VERB_NOT_SUPPORTED, logind-action.c uses ENOTSUP already, so changing it to ENOTSUP makes the dbus and action paths behave the same.
2014-12-30bus: add sd_bus_emit_object_{added/removed}()David Herrmann
This implements two new helpers, discussed on systemd-devel about 1 year ago: sd_bus_emit_object_added() sd_bus_emit_object_removed() Both calls are equivalent to their respective counterpart sd_bus_emit_interfaces_{added/removed}(), but can figure out the list of interfaces themselves, instead of requiring the caller to provide them. Furthermore, both calls properly deal with builtin interfaces provided via org.freedesktop.DBus.* and alike. Both calls simply traverse a node and all its parent nodes to figure out a list of all interfaces registered as vtable or fallback. It then appends each of them, similar to the interfaces_{added/removed}() helpers. Note that interfaces_{added/removed}() runs a parent traversal for *each* passed interface. Therefore, it can simply bail out, once it found a parent node that implements a given interface. With object_{added/removed}() we cannot know the registered interfaces in advance, thus, we cannot run one traversal per node. Instead, we run a single traversal and remember all interfaces that we added. Therefore, a child-interface overrides all conflicting parent-interfaces. We keep a "Set *s" context to track those while climbing up the tree.
2014-12-30bus: fix capabilities on big-endianDavid Herrmann
The kernel provides capabilities as a u32 array, sd-bus uses an u8 array. This works fine on little-endian as both are encoded the same way. However, this fails on big-endian if we do not perform sufficient byte-swapping on each u32 entry. This patch makes sd-bus use u32, too. We avoid changing any kernel provided data so we can keep pointing into kdbus pool buffers which contain u32 arrays.
2014-12-30bus: drop creds->capability_sizeDavid Herrmann
The number of available caps can be read from /proc/sys/kernel/cap_last_cap during runtime. Our helper cap_last_cap() does that, so there's no reason to remember the size of any capability cache. We can just pre-allocate arrays with a suitable size for all available caps and reject any higher caps. The kernel capability API uses u32 as base so make sure we do the same. Note that this is specified by POSIX, so it's unlikely to change.
2014-12-29machinectl: add "enable" and "disable" verbs for enabling/disabling ↵Lennart Poettering
systemd-nspawn for containers This is basically just a shortcut for "systemctl enable systemd-nspawn@<foobar>.service", but does escaping.
2014-12-29machinectl: add new "start" verb to start a container as a service in nspawnLennart Poettering
2014-12-29bus: fix typoDavid Herrmann
Drop spurious 'we'.
2014-12-29rtnl: recv_message - don't enforce sender uidTom Gundersen
All we care about is that the kernel (pid==0) sent the message. Verifying the sender uid seems to break when using userns. Reported by Stéphane Graber.
2014-12-29sd-rtnl: rtnl_call - don't dispatch wqueue after timeout has passedTom Gundersen
Only a minor change as the timeout would be hit soon thereafetr at the next loop.
2014-12-29sd-rtnl: rtnl_poll - fix typoTom Gundersen
This caused rtnl_poll to always return true immediately in sd_rtnl_call().
2014-12-29sd-rtnl: recv_message - drop message when peeking failsTom Gundersen
Read the message form the socket or we will loop trying to read the same message repeatedly.
2014-12-29sd-rtnl: recv_message - don't fail on interruptTom Gundersen
We should just try again instead.
2014-12-29sd-rtnl: recv_message - log when dropping messageTom Gundersen
We drop messages received from the wrong uid/pid, log this at debug level.
2014-12-28libsystemd: Fix minor typo in commentSylvain Plantefève
2014-12-25bus: remove spurious include of <sys/capability.h>Filipe Brandenburger
They do not use any functions from libcap directly. The CAP_SYS_ADMIN constant in use by bus-objects.c comes from <linux/capability.h> imported through "missing.h". The "missing.h" header is imported through "util.h" which gets imported in "bus-util.h". Tested that everything builds cleanly after this change.
2014-12-24sd-bus: rename sd_bus_open_system_container() to sd_bus_open_system_machine()Lennart Poettering
Pretty much everywhere else we use the generic term "machine" when referring to containers in API, so let's do though in sd-bus too. In particular, since the concept of a "container" exists in sd-bus too, but as part of the marshalling system.
2014-12-23busctl: when introspecting objects, optionally limit output by interface nameLennart Poettering
2014-12-23sd-bus: teach x-container-unix: bus protoocol to connect to the namespace of ↵Lennart Poettering
a PID instead of a container name
2014-12-23core: rearrange code so that libsystemd/sd-bus/ does not include header ↵Lennart Poettering
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!
2014-12-22sd-bus: ignore KDBUS_ITEM_TIMESTAMP in kernel messagesDaniel Mack
Kernel notifications carry a timestamp now, so make sure bus_kernel_translate_message() doesn't complain when it stumbles across them.
2014-12-20sd-bus: sync kdbus.h (ABI break)Daniel Mack
Sync kdbus.h with upstream changes: * Two optional cancellation points where added for synchronously blocking KDBUS_CMD_SEND commands: A sigmask to change the mask of accepted signals before the task is put to sleep, and a generic file descriptor that can be written to, in order to cancel the command. Both methods are currently unused. * The KDBUS_CMD_CANCEL ioctl was removed. sd-bus was never using that command, so there's no change needed. * Some kerneldoc fixes
2014-12-19machined: add new GetImage() bus call for retrieving the bus path for an imageLennart Poettering
2014-12-19LLDP: Add support for networkctlSusant Sahani
2014-12-18networkd: add FDB supportAlin Rauta
2014-12-12bus: send attach flags on BUS_MAKEDavid Herrmann
Make sure to set send-attach-flags on BUS_MAKE. These control which information is revealed about the bus-owner.
2014-12-12bus: fix assert() on HELLO error-pathDavid Herrmann
Make sure we don't call into any bus_kernel_*() functions before b->is_kernel is set to true. Hard-code the CMD_FREE just like the other helpers do.
2014-12-11bus: sync with kdbus.gitDavid Herrmann
Changes: * bloom parameters are returned in an offset via HELLO * FREE now takes items just like any other ioctl
2014-12-11treewide: correct spacing near eol in code commentsTorstein Husebø
2014-12-11sd-bus: correct spacing near eol in code commentsTorstein Husebø
2014-12-11libsystemd: add sd-hwdb libraryTom Gundersen
This is libudev-hwdb, but decoupled from libudev and in the libsystemd style. The core code is unchanged, apart from the following minor changes: - hwdb.bin located in /**/systemd/hwdb/ take preference over the ones located in /**/udev/ - properties are stored internally in an OrderedHashmap, rather than a linked list. - a new API call allows individual properties to be queried directly, rather than iterating over them all - the iteration over properties have been moved inside the library, rather than exposing a list directly - the unused 'flags' parameter was dropped
2014-12-11bus: sync with kdbus.gitDavid Herrmann
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.
2014-12-11bus: zero cmd_free before passing to ioctlDavid Herrmann
Make sure the whole cmd_free object is zeroed before passing it into the kernel. This makes valgrind happy and makes us future proof.
2014-12-11bus: fix memfd-cache regarding memfd offsetsDavid Herrmann
We must restore part->mmap_begin when poping memfds from the memfd-cache. We rely on the memfds to be unsealed, so we can be sure that we own the whole FD. Therefore, simply set part->mmap_begin to the same as part->data. This fixes test-bus-kernel-benchmark.
2014-12-10sd-bus: make BUS_ERROR_MAP_ELF_USE() use a const variableLennart Poettering
2014-12-10sd-bus: move common errors src/shared/bus-errors.h → ↵Lennart Poettering
src/libsystemd/sd-bus/bus-common-errors.h Stuff in src/shared/ should not use stuff from src/libsystemd/ really.
2014-12-10kdbus: downgrade warning if we cannot patch kdbus attach mask to DEBUG if ↵Lennart Poettering
kdbus is not available
2014-12-10util: introduce our own gperf based capability listLennart Poettering
This way, we can ensure we have a more complete, up-to-date list of capabilities around, always.
2014-12-09run: introduce timer support optionWaLyong Cho
Support timer options --on-active=, --on-boot=, --on-startup=, --on-unit-active=, --on-unit-inactive=, --on-calendar=. Each options corresponding with OnActiveSec=, OnBootSec=, OnStartupSec=, OnUnitActiveSec=, OnUnitInactiveSec=, OnCalendar= of timer respectively. And OnCalendar= and WakeSystem= supported by --timer-property= option like --property= of systemd-run. And if --unit= option and timer options are specified the command can be omitted. In this case, systemd-run assumes the target service is already loaded. And just try to generate transient timer unit only.
2014-12-09sd-bus: get rid of PID starttime conceptLennart Poettering
As kdbus no longer exports this, remove all traces from sd-bus too
2014-12-09sd-bus: properly support passing memfds around with offset/size parametersLennart Poettering
2014-12-09bus: sync with kdbus-git (ABI break)David Herrmann
kdbus-git gained two new features: * memfd offsets: This allows to specify a 'start' offset in kdbus_memfd so you can send partial memfd hunks instead of always the full memfd * KDBUS_HELLO_UNPRIVILEGED: If passed during HELLO, the client will be treated as unprivileged.
2014-12-09sd-rtnl: fix size check in sd_rtnl_message_append_string()Lennart Poettering
2014-12-09sd-bus: catch up with current kdbus, don't do matches on kdbus monitor ↵Lennart Poettering
connections
2014-12-08bus-proxy: fix compat with autostarted servicesLennart Poettering
2014-12-08networkd: manager - enumerate addresses globally, rather than per-linkTom Gundersen
The kernel always returns all addresses, rather than only for the given link, so let's only enumerate once.