summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Prep v230: Move installed headersSven Eden2017-06-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The headers are now installed into /usr/include/elogind/systemd and the pkg-config file now returns -I/usr/include/elogind for CFLAGS. Further /usr/include/elogind contains symlinks to the headers, so existing packages already including <elogind/sd-login.h> will not be broken. This way no software has to change their include lines anywhere to support elogind any more. All they have to do is either add LIBSYSTEMD_CFLAGS or LIBELOGIND_CFLAGS from pkg-config and be done with it. So most patching can be avoided, just some configure adaption is needed. However, this can lead to systemd/elogind bug confusion if there is anything mixed up on a system that shouldn't. Downstreams, chose any of the two ways to your own discretion! See https://bugs.freedesktop.org/show_bug.cgi?id=101251
* Prep v230: Apply missing upstream fixes and updates (8/8) src/systemd.Sven Eden2017-06-16
|
* Prep v230: Apply missing upstream fixes and updates (7/8) src/shared.Sven Eden2017-06-16
|
* Prep v230: Apply missing upstream fixes and updates (6/8) src/login.Sven Eden2017-06-16
|
* Prep v230: Apply missing upstream fixes and updates (5/8) src/libelogind.Sven Eden2017-06-16
|
* Prep v230: Apply missing upstream fixes and updates (4/8) src/core.Sven Eden2017-06-16
|
* Prep v230: Apply missing upstream fixes and updates (3/8) src/cgroups-agent.Sven Eden2017-06-16
|
* Prep v230: Apply missing upstream fixes and updates (2/8) src/basic.Sven Eden2017-06-16
|
* Prep v230: Apply missing upstream fixes and updates (1/8) root build files.Sven Eden2017-06-16
|
* Prep v230: Update POT files to upstreamSven Eden2017-06-16
|
* basic: remove rm_rf_and_free, add rm_rf_physical_and_free, use ↵Evgeny Vereshchagin2017-06-16
| | | | | | | | | | | | rm_rf_physical_and_freep in tests (#3292) Some distros don't mount /tmp as tmpfs. For example: https://lists.ubuntu.com/archives/ubuntu-cloud/2016-January/001009.html Some tests: * print 'Attempted to remove disk file system, and we can't allow that.' * don't really cleanup /tmp
* core: update CGroupBlockIODeviceBandwidth to record both rbps and wbpsTejun Heo2017-06-16
| | | | | | | | | | | | | | | | CGroupBlockIODeviceBandwith is used to keep track of IO bandwidth limits for legacy cgroup hierarchies. Unlike the unified hierarchy counterpart CGroupIODeviceLimit, a CGroupBlockIODeviceBandwiddth records either a read or write limit and has a couple issues. * There's no way to clear specific config entry. * When configs are cleared for an IO direction of a unit, the kernel settings aren't cleared accordingly creating discrepancies. This patch updates CGroupBlockIODeviceBandwidth so that it behaves similarly to CGroupIODeviceLimit - each entry records both rbps and wbps limits and is cleared if both are at default values after kernel settings are updated.
* core: introduce CGroupIOLimitType enumsTejun Heo2017-06-16
| | | | | | | | | | | Currently, there are two cgroup IO limits, bandwidth max for read and write, and they are hard-coded in various places. This is fine for two limits but IO is expected to grow more limits - low, high and max limits for bandwidth and IOPS - and hard-coding each limit won't make sense. This patch replaces hard-coded limits with an array indexed by CGroupIOLimitType and accompanying string and default value tables so that new limits can be added trivially.
* basic: define HEXDIGITSDaniel Kahn Gillmor2017-06-16
| | | | | define HEXDIGITS alongside DIGITS, and use it where it's already useful. We'll use it again shortly when parsing MAC addresses.
* missing.h: add BTRFS_IOC_QUOTA_RESCAN_WAIT (#3266)Stefan Saraev2017-06-16
|
* logind: introduce LockedHint and SetLockedHint (#3238)Victor Toso2017-06-16
| | | | | Desktop environments can keep this property up to date to allow applications to easily track session's Lock status.
* po, catalog - add Bulgarian translationAlexander Shopov2017-06-16
|
* locale-util: mark special_glyph() as _const_Zbigniew Jędrzejewski-Szmek2017-06-16
| | | | | | | | _const_ means that the caller can assume that the function will return the same result every time (and will not modify global memory). special_glyph() meets this: even though it depends on global memory, that part of global memory is not expected to change. This allows the calls to special_glyph() to be optimized, even if -flto is not used.
* tree-wide: rename draw_special_char to special_glyphZbigniew Jędrzejewski-Szmek2017-06-16
| | | | | | | | | That function doesn't draw anything on it's own, just returns a string, which sometimes is more than one character. Also remove "DRAW_" prefix from character names, TREE_* and ARROW and BLACK_CIRCLE are unambigous on their own, don't draw anything, and are always used as an argument to special_glyph(). Rename "DASH" to "MDASH", as there's more than one type of dash.
* core: rework how we flush incoming traffic when a socket unit goes downLennart Poettering2017-06-16
| | | | | | | | | Previously, we'd simply close and reopen the socket file descriptors. This is problematic however, as we won't transition through the SOCKET_CHOWN state then, and thus the file ownership won't be correct for the sockets. Rework the flushing logic, and actually read any queued data from the sockets for flushing, and accept any queued messages and disconnect them.
* core: add io controller support on the unified hierarchyTejun Heo2017-06-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On the unified hierarchy, blkio controller is renamed to io and the interface is changed significantly. * blkio.weight and blkio.weight_device are consolidated into io.weight which uses the standardized weight range [1, 10000] with 100 as the default value. * blkio.throttle.{read|write}_{bps|iops}_device are consolidated into io.max. Expansion of throttling features is being worked on to support work-conserving absolute limits (io.low and io.high). * All stats are consolidated into io.stats. This patchset adds support for the new interface. As the interface has been revamped and new features are expected to be added, it seems best to treat it as a separate controller rather than trying to expand the blkio settings although we might add automatic translation if only blkio settings are specified. * io.weight handling is mostly identical to blkio.weight[_device] handling except that the weight range is different. * Both read and write bandwidth settings are consolidated into CGroupIODeviceLimit which describes all limits applicable to the device. This makes it less painful to add new limits. * "max" can be used to specify the maximum limit which is equivalent to no config for max limits and treated as such. If a given CGroupIODeviceLimit doesn't contain any non-default configs, the config struct is discarded once the no limit config is applied to cgroup. * lookup_blkio_device() is renamed to lookup_block_device(). Signed-off-by: Tejun Heo <htejun@fb.com>
* tree-wide: introduce new SOCKADDR_UN_LEN() macro, and use it everywhereLennart Poettering2017-06-16
| | | | | | | | | | The macro determines the right length of a AF_UNIX "struct sockaddr_un" to pass to connect() or bind(). It automatically figures out if the socket refers to an abstract namespace socket, or a socket in the file system, and properly handles the full length of the path field. This macro is not only safer, but also simpler to use, than the usual offsetof() + strlen() logic.
* core: use an AF_UNIX/SOCK_DGRAM socket for cgroup agent notificationLennart Poettering2017-06-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dbus-daemon currently uses a backlog of 30 on its D-bus system bus socket. On overloaded systems this means that only 30 connections may be queued without dbus-daemon processing them before further connection attempts fail. Our cgroups-agent binary so far used D-Bus for its messaging, and hitting this limit hence may result in us losing cgroup empty messages. This patch adds a seperate cgroup agent socket of type AF_UNIX/SOCK_DGRAM. Since sockets of these types need no connection set up, no listen() backlog applies. Our cgroup-agent binary will hence simply block as long as it can't enqueue its datagram message, so that we won't lose cgroup empty messages as likely anymore. This also rearranges the ordering of the processing of SIGCHLD signals, service notification messages (sd_notify()...) and the two types of cgroup notifications (inotify for the unified hierarchy support, and agent for the classic hierarchy support). We now always process events for these in the following order: 1. service notification messages (SD_EVENT_PRIORITY_NORMAL-7) 2. SIGCHLD signals (SD_EVENT_PRIORITY_NORMAL-6) 3. cgroup inotify and cgroup agent (SD_EVENT_PRIORITY_NORMAL-5) This is because when receiving SIGCHLD we invalidate PID information, which we need to process the service notification messages which are bound to PIDs. Hence the order between the first two items. And we want to process SIGCHLD metadata to detect whether a service is gone, before using cgroup notifications, to decide when a service is gone, since the former carries more useful metadata. Related to this: https://bugs.freedesktop.org/show_bug.cgi?id=95264 https://github.com/elogind/elogind/issues/1961
* logind: enforce a limit on inhibitors we hand outLennart Poettering2017-06-16
| | | | | | | | For similar reasons as the recent addition of a limit on sessions. Note that we don't enforce a limit on inhibitors per-user currently, but there's an implicit one, since each inhibitor takes up one fd, and fds are limited via RLIMIT_NOFILE, and the limit on the number of processes per user.
* logind: expose more configuration settings as bus propertiesLennart Poettering2017-06-16
|
* logind: don't include session lists in PropertyChanged messagesLennart Poettering2017-06-16
| | | | | | | | | | | | | | | | | If we have a lot of simultaneous sessions we really shouldn't send the full list of active sessions with each PropertyChanged message for user and seat objects, as that can become quite substantial data, we probably shouldn't dump on the bus on each login and logout. Note that the global list of sessions doesn't send out changes like this either, it only supports requesting the session list with ListSessions(). If cients want to get notified about sessions coming and going they should subscribe to SessionNew and SessionRemoved signals, and clients generally do that already. This is kind of an API break, but then again the fact that this was included was never documented.
* logind: process session/inhibitor fds at higher priorityLennart Poettering2017-06-16
| | | | | | | Let's make sure we process session and inhibitor pipe fds (that signal sessions/inhibtors going away) at a higher priority than new bus calls that might create new sessions or inhibitors. This helps ensuring that the number of open sessions stays minimal.
* logind: enforce a limit on current user sessionsLennart Poettering2017-06-16
| | | | | | | | | | | We really should put limits on all resources we manage, hence add one to the number of concurrent sessions, too. This was previously unbounded, hence set a relatively high limit of 8K by default. Note that most PAM setups will actually invoke pam_elogind prefixed with "-", so that the return code of pam_elogind is ignored, and the login attempt succeeds anyway. On systems like this the session will be created but is not tracked by elogind.
* core: make unit_has_mask_realized() consider controller enable stateTejun Heo2017-06-16
| | | | | | | | | | | | | | unit_has_mask_realized() determines whether the specified unit has its cgroups set up properly given the desired target_mask; however, on the unified hierarchy, controllers need to be enabled explicitly for children and the mask of enabled controllers can deviate from target_mask. Only considering target_mask in unit_has_mask_realized() can lead to false positives and skipping enabling the requested controllers. This patch adds unit->cgroup_enabled_mask to track which controllers are enabled and updates unit_has_mask_realized() to also consider enable_mask. Signed-off-by: Tejun Heo <htejun@fb.com>
* machined: support non-btrfs file systems with "machinectl clone"Lennart Poettering2017-06-16
| | | | | | | | Fall back to a normal copy operation when the backing file system isn't btrfs, and hence doesn't support cheap snapshotting. Of course, this will be slow, but given that the execution is asynchronous now, this should be OK. Fixes: #1308
* copy: adjust directory times after writing to the directoryLennart Poettering2017-06-16
| | | | | | When recursively copying a directory tree, fix up the file times after having created all contents in it, so that our changes don't end up altering any of the directory times.
* copy: return the right error when we can't open a fileLennart Poettering2017-06-16
|
* copy: also copy AF_UNIX socketsLennart Poettering2017-06-16
| | | | | | | | We previously would fail with EOPNOTSUPP when encountering an AF_UNIX socket in the directory tree to copy. Fix that, and copy them too (even if they are dead in the result). Fixes: #2914
* parse-util: fix conversion from size_t on s390 (#3147)Lubomir Rintel2017-06-16
| | | | | | | | On s390 size_t is an unsigned long, nor an unsigned int. They both are of the same size and can be cast to each other safely, but the compiler still seems unhappy about incompatible pointers. Fixes: 7c2da2ca8
* basic/mount-util: recognize pvfs2 as network fs (#3140)Zbigniew Jędrzejewski-Szmek2017-06-16
| | | | Added to kernel 4.6.
* tree-wide: rename hidden_file to hidden_or_backup_file and optimizeZbigniew Jędrzejewski-Szmek2017-06-16
| | | | | | | | | | | In standard linux parlance, "hidden" usually means that the file name starts with ".", and nothing else. Rename the function to convey what the function does better to casual readers. Stop exposing hidden_file_allow_backup which is rather ugly and rewrite hidden_file to extract the suffix first. Note that hidden_file_allow_backup excluded files with "~" at the end, which is quite confusing. Let's get rid of it before it gets used in the wrong place.
* basic/dirent-util: do not call hidden_file_allow_backup from ↵Zbigniew Jędrzejewski-Szmek2017-06-16
| | | | | | | | dirent_is_file_with_suffix If the file name is supposed to end in a suffix, there's not need to check the name against a list of "special" file names, which is slow. Instead, just check that the name doens't start with a period.
* path-util: Add hidden suffixes for ucf (#3131)Martin Pitt2017-06-16
| | | | | | | | | ucf is a standard Debian helper for managing configuration file upgrades which need more interaction or elaborate merging than conffiles managed by dpkg. Ignore its temporary and backup files similarly to the *.dpkg-* ones to avoid creating units for them in generators. https://bugs.debian.org/775903
* build-sys: improve compat with older kernel headersLennart Poettering2017-06-16
| | | | | | | | In 4.2 kernel headers, some netlink defines are missing that we need. missing.h already can add them in, but currently makes this dependent on a definition that these kernels already have. Change the check hence to check for the newest definition in the table, so that the whole bunch of definitions as added in on all kernels lacking this.
* elogind --user: call pam_loginuid when creating user@.service (#3120)Zbigniew Jędrzejewski-Szmek2017-06-16
| | | | | | | | | | | | | This way the user service will have a loginuid, and it will be inherited by child services. This shouldn't change anything as far as elogind itself is concerned, but is nice for various services spawned from by elogind --user that expect a loginuid. pam_loginuid(8) says that it should be enabled for "..., crond and atd". user@.service should behave similarly to those two as far as audit is concerned. https://bugzilla.redhat.com/show_bug.cgi?id=1328947#c28
* nspawn: don't try to patch UIDs/GIDs of procfs and suchlikeLennart Poettering2017-06-16
|
* nspawn: make -U a tiny bit smarterLennart Poettering2017-06-16
| | | | | With this change -U will turn on user namespacing only if the kernel actually supports it and otherwise gracefully degrade to non-userns mode.
* tree-wide: use mdash instead of a two minusesZbigniew Jędrzejewski-Szmek2017-06-16
|
* networkd: bump MTU to 1280 for interfaces which have IPv6 enabled (#3077)Susant Sahani2017-06-16
| | | | | | | | | | | | IPv6 protocol requires a minimum MTU of 1280 bytes on the interface. This fixes #3046. Introduce helper link_ipv6_enabled() to figure out whether IPV6 is enabled. Introduce network_has_static_ipv6_addresses() to find out if any static ipv6 address configured. If IPv6 is not configured on any interface that is SLAAC, DHCPv6 and static IPv6 addresses not configured, then IPv6 will be automatically disabled for that interface, that is we write "1" to /proc/sys/net/ipv6/conf//disable_ipv6.
* tree-wide: don't assume CLOCK_BOOTIME is generally availableLennart Poettering2017-06-16
| | | | | | | | | | | | Before we invoke now(CLOCK_BOOTTIME), let's make sure we actually have that clock, since now() will otherwise hit an assert. Specifically, let's refuse CLOCK_BOOTTIME early in sd-event if the kernel doesn't actually support it. This is a follow-up for #3037, and specifically: https://github.com/elogind/elogind/pull/3037#issuecomment-210199167
* shared: move unit-specific code from bus-util.h to bus-unit-util.hLennart Poettering2017-06-16
| | | | | | | Previously we'd have generally useful sd-bus utilities in bust-util.h, intermixed with code that is specifically for writing clients for PID 1, wrapping job and unit handling. Let's split the latter out and move it into bus-unit-util.c, to make the sources a bit short and easier to grok.
* core,systemctl: add bus API to retrieve processes of a unitLennart Poettering2017-06-16
| | | | | | | | | | | | | | | This adds a new GetProcesses() bus call to the Unit object which returns an array consisting of all PIDs, their process names, as well as their full cgroup paths. This is then used by "systemctl status" to show the per-unit process tree. This has the benefit that the client-side no longer needs to access the cgroupfs directly to show the process tree of a unit. Instead, it now uses this new API, which means it also works if -H or -M are used correctly, as the information from the specific host is used, and not the one from the local system. Fixes: #2945
* logind: use type to determine graphical sessions (#3071)Michał Bartoszkiewicz2017-06-16
|
* basic: user-utils.c needs missing.h for secure_getenv (#3059)michaelolbrich2017-06-16
| | | | | | | Otherwise building may fail with: src/basic/user-util.c: In function 'get_home_dir': src/basic/user-util.c:343:9: error: implicit declaration of function 'secure_getenv' [-Werror=implicit-function-declaration]
* networkd: allow setting of multicast querier for linux bridge (#3051)Susant Sahani2017-06-16
|