summaryrefslogtreecommitdiff
path: root/src/core
AgeCommit message (Collapse)Author
2015-02-26core: emit changes for NFailedUnits propertyLucas De Marchi
By notifying the clients when this property is changed it's possible to allow "system health monitor" tools to get transitions like running<->degraded. This is an alternative to send changes on the SystemState property since the latter is more difficult to derive.
2015-02-26unit: When stopping due to BindsTo=, log which unit caused itColin Walters
I'm trying to track down a relatively recent change in systemd which broke OSTree; see https://bugzilla.gnome.org/show_bug.cgi?id=743891 Systemd started to stop sysroot.mount, and this patch should help me debug why at least. While we're here, "break" on the first unit we find that will deactivate, as there's no point in further iteration.
2015-02-25unit: use weaker dependencies between mount and device units in --user modeLennart Poettering
When running in user mode unmounting of mount units when a device vanishes is unlikely to work, and even if it would work is already done by PID 1 anyway. HEnce, when creating implicit dependencies between mount units and their backing devices, created a Wants= type dependency in --user mode, but leave a BindsTo= dependency in --system mode.
2015-02-23remove unused includesThomas Hindoe Paaboel Andersen
This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
2015-02-20core, shared: in deserializing, match same files reached via different pathsMichal Schmidt
When dbus.socket is updated like this: -ListenStream=/var/run/dbus/system_bus_socket +ListenStream=/run/dbus/system_bus_socket ... and daemon-reload is performed, bad things happen. During deserialization systemd does not recognize that the two paths refer to the same named socket and replaces the socket file with a new one. As a result, applications hang when they try talking to dbus. Fix this by finding a match not only when the path names are equal, but also when they point to the same inode. In socket_address_equal() it is necessary to move the address size comparison into the abstract sockets branch. For path name sockets the comparison must not be done and for other families it is redundant (their sizes are constant and checked by socket_address_verify()). FIFOs and special files can also have multiple pathnames, so compare the inodes for them as well. Note that previously the pathname checks used streq_ptr(), but the paths cannot be NULL. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1186018
2015-02-18everywhere: remove configurability of sysv runlevel to target mappingLennart Poettering
With this change runlevel 2, 3, 4 are mapped to multi-user.target for good, and 5 to graphical.target. This was already the previous mapping but is now no longer reconfigurable, but hard-coded into the core. This should generally simplify things, but also fix one bug: the sysv-generator previously generated symlinks to runlevel[2-5].target units, which possibly weren't picked up if these aliases were otherwise only referenced by the real names "multi-user.target" and "graphical.target". We keep compat aliases "runlevel[2345].target" arround for cases where this target name is explicitly requested.
2015-02-18core: rework policykit hookupLennart Poettering
- Always issue selinux access check as early as possible, and PK check as late as possible. - Introduce a new policykit action for altering environment - Open most remaining bus calls to unprivileged clients via PK
2015-02-18logind: open up most bus calls for unpriviliged processes, using PolicyKitLennart Poettering
Also, allow clients to alter their own objects without any further priviliges. i.e. this allows clients to kill and lock their own sessions without involving PK.
2015-02-14core: make RuntimeDirectory honor SELinux labelsZbigniew Jędrzejewski-Szmek
https://bugzilla.redhat.com/show_bug.cgi?id=1192726
2015-02-12include <poll.h> instead of <sys/poll.h>Thomas Hindoe Paaboel Andersen
include-what-you-use automatically does this and it makes finding unnecessary harder to spot. The only content of poll.h is a include of sys/poll.h so should be harmless.
2015-02-12Add missing includes in header filesThomas Hindoe Paaboel Andersen
This fixes various issues found by globally reordering the include sections of all .c files.
2015-02-12exec: also evaluate working_directory_missing_ok when not applying chrootsLennart Poettering
2015-02-12core: disarm shutdown watchdog if we fail to set timeoutLennart Poettering
Better safe than sorry, if drivers are stupid, and reset immediately on device closing if the timeout could not be initialized. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=777735
2015-02-12core: don't fail to run services in --user instances if $HOME is missingLennart Poettering
Otherwise we cannot even invoke systemd-exit.service anymore, thus not even exit. https://bugs.freedesktop.org/show_bug.cgi?id=83100 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=759320
2015-02-11core: don't watch for socket events when service is in SERVICE_STOPLennart Poettering
If a service has an ExecStop= program that uses the socket the service was activated by to tell it to terminate, then that should not be used as trigger to start the service again. http://lists.freedesktop.org/archives/systemd-devel/2015-February/028058.html
2015-02-11core: correct a log messageLennart Poettering
The log message talks specifically about services, though it actually applies to any kind of unit.
2015-02-11core: remove unneeded <libgen.h> includeCristian Rodríguez
execute.c only uses basename (the GNU version in <string.h>)
2015-02-05bus: sync with kdbus (ABI break)David Herrmann
2015-02-04core: don't reset log level to NOTICE if we get quiet on the kernel cmdlineLennart Poettering
quiet should really just have an effect on the stuff we dump on the console, not what we log elsewhere. Hence: debug on kernel cmdline → interpreted by every tool, turns up log levels to "debug" everywhere. quiet on kernel cmdline → interpreted only by PID 1 (and obviously the kernel) no alteration of the max log level, but turns off status output. http://lists.freedesktop.org/archives/systemd-devel/2014-December/026271.html
2015-02-03core: open up DefaultDependencies= property for transient unitsLennart Poettering
2015-02-03core: busname_supported() should cache what it detectsJohannes Hölzl
Add the missing "static" to actually make this a cache.
2015-02-03core: use some nice macros where appropriateLennart Poettering
2015-02-03loopback-setup: simplify code a bitLennart Poettering
2015-02-03loopback-setup: no need to redefine LOOPBACK_IFINDEX, we already have it in ↵Lennart Poettering
missing.h
2015-02-03util: rework strappenda(), and rename it strjoina()Lennart Poettering
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.
2015-02-01config_parse_set_status: put signals in the correct setMichael Olbrich
This was broken when the code was rearranged in "1e2fd62d70ff core/load-fragment.c: correct argument sign and split up long lines"
2015-02-01Add a snprinf wrapper which checks that the buffer was big enoughZbigniew Jędrzejewski-Szmek
If we scale our buffer to be wide enough for the format string, we should expect that the calculation was correct. char_array_0() invocations are removed, since snprintf nul-terminates the output in any case. A similar wrapper is used for strftime calls, but only in timedatectl.c.
2015-01-31core/cgroup: fix embarrassing typoZbigniew Jędrzejewski-Szmek
https://github.com/docker/docker/issues/10280
2015-01-30core: make setting the shutdown watchdog configuration via dbus workMaxim Mikityanskiy
https://bugs.freedesktop.org/show_bug.cgi?id=88284
2015-01-30Revert "core: make setting the shutdown watchdog configuration via dbus work"Kay Sievers
This reverts commit df6e44c4affced590b0d19c594d9301ffd436591. systemd --version segfaults. Starting program: /usr/lib/systemd/systemd --version Missing separate debuginfos, use: debuginfo-install systemd-216-16.fc21.x86_64 [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". systemd 218 +PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN Program received signal SIGSEGV, Segmentation fault. 0x000055555557c9be in main (argc=2, argv=0x7fffffffe4d8) at src/core/main.c:1832 1832 arg_shutdown_watchdog = m->shutdown_watchdog; (gdb) bt (gdb) bt full m = 0x0
2015-01-29core: make setting the shutdown watchdog configuration via dbus workMaxim Mikityanskiy
https://bugs.freedesktop.org/show_bug.cgi?id=88284
2015-01-28core/mount: add dependencies to dynamically mounted mounts tooMartin Pitt
Add unit dependencies for dynamic (i. e. not from fstab) mounts. With that, mount units properly bind to their underlying device, and thus get automatically stopped/unmounted when the underlying device goes away. This cleans up stale mounts from unplugged devices. Thanks to Lennart Poettering for pointing out the fix!
2015-01-28core: output unit status output strings to console, only if we actually are ↵Lennart Poettering
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.
2015-01-28manager: fix minor typoLennart Poettering
2015-01-28manager: when we immediately reboot due to 7x C-A-D within 2s, mention this ↵Lennart Poettering
on the console too
2015-01-28core: when the user hits Ctrl-Alt-Del more than 7x per 2s, reboot immediatelyLennart Poettering
This should be useful for cases where clean rebooting doesn't work, and the user wants to hurry up the reboot.
2015-01-28core: if two start jobs for the same swap device node are queued, only ↵Lennart Poettering
dispatch one of them at a time If two start jobs for two seperate .swap device nodes are queued, which then turns out to be referring to the same device node, refuse dispatching more than one of them at the same time. This should solve an issue when the same swap partition is found via GPT auto-discovery and via /etc/fstab, where one uses a symlink path, and the other the raw devce node. So far we might have ended up invoking mkswap on the same node at the very same time with the two device node names. With this change only one mkswap should be executed at a time. THis mkswap should have immediate effect on the other swap unit, due to the state in /proc/swaps changing, and thus suppressing actual invocation of the second mkswap. http://lists.freedesktop.org/archives/systemd-devel/2015-January/027314.html
2015-01-28swap: simplify a few things by making use of new LIST_FOREACH_OTHERS macroLennart Poettering
2015-01-28swap: properly specify errno when loggingLennart Poettering
2015-01-27core: explain why failing to set up the crash handler is not a real problemLennart Poettering
http://lists.freedesktop.org/archives/systemd-devel/2015-January/027428.html
2015-01-26treewide: fix multiple typosTorstein Husebø
2015-01-23mount-setup: Do not bother with /proc/bus/usbCristian Rodríguez
Current systemd requires kernel >= 3.7 per the README file but CONFIG_USB_DEVICEFS disappeared from the kernel in upstream commit fb28d58b72aa9215b26f1d5478462af394a4d253 (kernel 3.5-rc1)
2015-01-23core,shutdown: don't bother with unmounting any mounts below /sys, /proc, ↵Lennart Poettering
/dev when shutting down After all, mounts below these directories are pretty much guaranteed to be virtual, and it's hence unnecessary to unmount them during shutdown. Moreover, in less-priviliged containers we might lack the rights to unmount them, hence don't even try. http://lists.freedesktop.org/archives/systemd-devel/2015-January/027113.html
2015-01-23mount-setup: /selinux, /cgroup, /dev/cgroup are sooo old, don't bother with ↵Lennart Poettering
them anymore
2015-01-23core: add a property that shows the current memory usage of a unitLennart Poettering
This is exposed the memory.usage_in_bytes cgroup property on the bus, and makes "systemctl status" show it in its default output.
2015-01-23importd: when listing transfers, show progress percentageLennart Poettering
With this change the pull protocol implementation processes will pass progress data to importd which then passes this information on via the bus. We use sd_notify() as generic transport for this communication, making importd listen to them, while matching the incoming messages to the right transfer.
2015-01-23core: zero size notify messages are OKLennart Poettering
2015-01-22Assorted format fixesZbigniew Jędrzejewski-Szmek
Types used for pids and uids in various interfaces are unpredictable. Too bad.
2015-01-20util: make http url validity checks more generic, and move them to util.cLennart Poettering
2015-01-19cgroup: fix typoDaniel Mack