summaryrefslogtreecommitdiff
path: root/src/core
AgeCommit message (Collapse)Author
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-19core: Beef up PrivateDevices=Lennart Poettering
Also mount /dev/kdbus, /dev/mqueue and /dev/hugepages into the /dev for namespaced services.
2014-03-19core: expose missing busname properties on the busLennart Poettering
2014-03-19core: by default .busname units should be activatingLennart Poettering
2014-03-19busname: introduce Activating directiveDaniel Mack
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.
2014-03-18core: add new AcceptFD= setting to .busname unitsLennart Poettering
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.
2014-03-18util: replace close_nointr_nofail() by a more useful safe_close()Lennart Poettering
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.
2014-03-18core: drop CAP_MKNOD when PrivateDevices= is setLennart Poettering
2014-03-18core: remount /sys/fs/cgroup/ read-only after we mounted all controllersLennart Poettering
Given that glibc searches for /dev/shm by just looking for any tmpfs we should be more careful with providing tmpfs instances arbitrary code might end up writing to.
2014-03-18cgroup: it's not OK to invoke alloca() in loopsLennart Poettering
2014-03-17core, libsystemd, systemd, timedate, udev: spelling fixesMiklos Vajna
2014-03-16Use strlen even for constant stringsJosh Triplett
GCC optimizes strlen("string constant") to a constant, even with -O0. Thus, replace patterns like sizeof("string constant")-1 with strlen("string constant") where possible, for clarity. In particular, for expressions intended to add up the lengths of components going into a string, this often makes it clearer that the expression counts the trailing '\0' exactly once, by putting the +1 for the '\0' at the end of the expression, rather than hidden in a sizeof in the middle of the expression.
2014-03-14Do not return -1 (EINVAL) on allocation errorZbigniew Jędrzejewski-Szmek
2014-03-14machine-id-setup: use path_kill_slashes and modernizationsZbigniew Jędrzejewski-Szmek
2014-03-14machine-id: add --root option to operate on an alternate fs treeGreg KH
This makes it possible to initialize the /etc/machine-id file on an arbitrary filesystem hierarchy. This helps systems that wish to run this at image creation time in a subdirectory, or from initramfs before pivot-root is called. [tomegun: converted to using _cleanup_free_ macros]
2014-03-12socket.c: make use of union sockaddr_unionDaniel Buch
2014-03-12manager: use system state enum where appropriateLennart Poettering
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-11core: support globbing matches in DeviceAllow= when checking for device groupsLennart Poettering
2014-03-11dbus: suppress duplicate and misleading messagesLennart Poettering
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
2014-03-08fix off by one error in array index assertionDave Reisner
Since the index is already post-incremented when the array is appended to, this assertion can be wrongly reached when the array is at capacity (with the NULL terminator). The bug is reproducible on shutdown with the following settings in /etc/systemd/system.conf: LogTarget=journal-or-kmsg LogColor=yes LogLocation=yes Reported by Thermi on IRC.
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-07sd-bus: add support for policy upload on activator connectionsDaniel Mack
Activator connections may upload policy when registering to the bus. This patch contains code to translate between BusNamePolicy objects and the kdbus specific items.
2014-03-07busname: add parser for bus name policiesDaniel Mack
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.
2014-03-07busname: don't drop 'service' from the result stringLennart Poettering
2014-03-07manager: flush memory stream before using the bufferDaniel Mack
When the manager receives a SIGUSR2 signal, it opens a memory stream with open_memstream(), uses the returned file handle for logging, and dumps the logged content with log_dump(). However, the char* buffer is only safe to use after the file handle has been flushed with fflush, as the man pages states: When the stream is closed (fclose(3)) or flushed (fflush(3)), the locations pointed to by ptr and sizeloc are updated to contain, respectively, a pointer to the buffer and the current size of the buffer. These values remain valid only as long as the caller performs no further output on the stream. If further output is performed, then the stream must again be flushed before trying to access these variables. Without that call, dump remains NULL and the daemon crashes in log_dump().
2014-03-07core/busname: add lookup string for BUSNAME_FAILURE_SERVICE_FAILED_PERMANENTDaniel Mack
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.
2014-03-07gpt-auto-generator: automatically find the root disk of the systemLennart Poettering
When run in an initrd and no root= argument is set (or is set to root=gpt-auto) we will automatically look for the root partition on the same disk the EFI ESP is located on. Since we look for swap, /home and /srv on the disk the root partition is located on, we hence have a fully discoverable chain: Firmware discovers the EFI ESP partition → the initrd discovers the root partition → the host OS discovers swap, /home, and /srv. Note that this requires an EFI boot loader that sets the LoaderDevicePartUUID EFI variable, such as Gummiboot.
2014-03-07fstab-generator: merge /proc/cmdline parsing loops into oneLennart Poettering
2014-03-06util: move more intellegince into parse_proc_cmdline()Lennart Poettering
Already split variable assignments before invoking the callback. And drop "rd." settings if we are not in an initrd.
2014-03-06core: include partition label in .device description fieldsLennart Poettering
2014-03-06core: correctly unregister PIDs from PID hashtablesLennart Poettering
2014-03-06util: add timeout to generator executionLennart Poettering
2014-03-05core: don't override NoNewPriviliges= from SystemCallFilter= if it is ↵Lennart Poettering
already explicitly set
2014-03-05core: make the LimitXYZ= properties settable for transient service unitsLennart 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-05core: when passing resource limit values to client, map RLIM_INFINITY into ↵Lennart Poettering
portable value (uint64_t) -1
2014-03-04Do not print invalid UTF-8 in error messagesZbigniew Jędrzejewski-Szmek
Inexplicably, 550a40ec ('core: do not print invalid utf-8 in error messages') only fixed two paths. Convert all of them now.
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-03core: fix assert when trying to serialize non-initialized bus peer tracker ↵Lennart Poettering
object
2014-03-03core: add missing show-status.[ch]Lennart Poettering
2014-03-03conf-parser: config_parse_path_strv() is not generic, so let's move it into ↵Lennart Poettering
load-fragment.c The parse code actually checked for specific lvalue names, which is really wrong for supposedly generic parsers...
2014-03-03core: move config_parse_set_status() into load-fragment.cLennart Poettering
Let's keep specific config parsers close to where they are needed. Only the really generic ones should be defined in conf-parser.[ch].
2014-03-03core: move ShowStatus type into the coreLennart Poettering
Let's make the scope of the show-status stuff a bit smaller, and make it private to the core, rather than shared API in shared/.
2014-03-03conf-parse: rename config_parse_level() to config_parse_log_level()Lennart Poettering
"level" is a bit too generic, let's clarify what kind of level we are referring to here.
2014-03-03core: introduce new RuntimeDirectory= and RuntimeDirectoryMode= unit settingsLennart Poettering
As discussed on the ML these are useful to manage runtime directories below /run for services.
2014-03-03execute: no need to include seccomp.h from execute.hLennart Poettering
2014-03-03execute: free directory path if we fail to remove it because we cannot ↵Lennart Poettering
allocate a thread
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-26mount: don't fire PropertiesChanged signals for mounts that are stoppedLennart Poettering