summaryrefslogtreecommitdiff
path: root/src/core
AgeCommit message (Collapse)Author
2016-03-14Merge pull request #2834 from coling/masterZbigniew Jędrzejewski-Szmek
2016-03-14device: Ensure we have sysfs path before comparing.Colin Guthrie
In some cases we do not have a udev device when setting up a unit (certainly the code gracefully handles this). However, we do then go on to compare the path via path_equal which will assert if a null value is passed in. See https://bugs.mageia.org/show_bug.cgi?id=17766 Not sure if this is the correct fix, but it avoids the crash
2016-03-10Merge pull request #2794 from jhol/dont-unmount-initramfs-mountsDaniel Mack
core/mount: Don't unmount initramfs mounts
2016-03-09Merge pull request #2793 from fbuihuu/fstab-generator-automount-optionZbigniew Jędrzejewski-Szmek
fstab-generator: fix automounts to not mount automatically
2016-03-04fstab-generator: fix automount option and don't start associated mount unit ↵Franck Bui
at boot Without this patch applied the mount unit with 'automount' option was still pulled by local-fs.target and thus was activated during the boot process which defeats the purpose of the 'automount' option: $ grep /mnt /etc/fstab /dev/vdb1 /mnt ext2 defaults,x-systemd.automount 0 0 $ reboot ... $ mount | grep mnt systemd-1 on /mnt type autofs (rw,relatime,fd=34,pgrp=1,timeout=0,minproto=5,maxproto=5,direct) /dev/vdb1 on /mnt type ext2 (rw,relatime) $ systemctl status mnt.mount | grep Active Active: active (mounted) since Thu 2016-03-03 21:36:22 CET; 42s ago With the patch applied: $ reboot ... $ mount | grep mnt systemd-1 on /mnt type autofs (rw,relatime,fd=22,pgrp=1,timeout=0,minproto=5,maxproto=5,direct) $ systemctl status mnt.mount | grep Active Active: inactive (dead) $ ls /mnt lost+found $ systemctl status mnt.mount | grep Active Active: active (mounted) since Thu 2016-03-03 21:47:32 CET; 4s ago
2016-03-04core/mount: Don't unmount initramfs mountsJoel Holdsworth
A mount within /run/initramfs is indicative that the mount was created by initramfs init and will be unmounted by initramfs shutdown. It is unlikely that such a mount point would even be unmountable by the the main system, for example in the case of the root file- system being loop-mounted from a file in a /run/initramfs mount.
2016-03-04core/failure-action: Set job-modes to replace-irreversiblyJoel Holdsworth
Up until now, the failure action has launched reboot.target and poweroff.target with a less aggressive job mode than "systemctl reboot" does. This has meant that the reboot and power- off operations can stall if there are any conflicts with the target during rebooting.
2016-03-01selinux: always try to load the full selinux dbZbigniew Jędrzejewski-Szmek
https://github.com/systemd/systemd/pull/2508#issuecomment-190901170 Maybe fixes https://bugzilla.redhat.com/show_bug.cgi?id=1308771.
2016-02-29Merge pull request #2771 from 0xAX/core-kernel-timestamp-cleanupLennart Poettering
core: use DUAL_TIMESTAMP_NULL to reset kernel_timestamp
2016-02-29core: use DUAL_TIMESTAMP_NULL to reset kernel_timestampAlexander Kuleshov
instead of direct reset of kernel_timestamp fields.
2016-02-28Merge pull request #2753 from phomes/trivial-fixes2Zbigniew Jędrzejewski-Szmek
Trivial fixes
2016-02-26tree-wide: indentation fixesThomas Hindoe Paaboel Andersen
2016-02-26clock-util: make clock_is_localtime() testable and add initial testsMartin Pitt
Add path argument to clock_is_localtime() and default to "/etc/adjtime" if it's NULL. This makes the function testable. Add test-clock: initial test cases for some scenarios, using a temporary file. This also checks the behaviour with a NULL (i. e. the system's /etc/adjtime) file.
2016-02-25Merge pull request #2671 from 0xAX/move-pager-open-to-one-placeZbigniew Jędrzejewski-Szmek
tree-wide: merge pager_open_if_enabled() to the pager_open()
2016-02-26tree-wide: merge pager_open_if_enabled() to the pager_open()Alexander Kuleshov
Many subsystems define own pager_open_if_enabled() function which checks '--no-pager' command line argument and open pager depends on its value. All implementations of pager_open_if_enabled() are the same. Let's merger this function with pager_open() from the shared/pager.c and remove pager_open_if_enabled() from all subsytems to prevent code duplication.
2016-02-23tree-wide: minor formatting inconsistency cleanupsVito Caputo
2016-02-22tree-wide: make ++/-- usage consistent WRT spacingVito Caputo
Throughout the tree there's spurious use of spaces separating ++ and -- operators from their respective operands. Make ++ and -- operator consistent with the majority of existing uses; discard the spaces.
2016-02-20core: exclude .slice units from "systemctl isolate"Lennart Poettering
Fixes: #1969
2016-02-18core: revert "core: resolve specifier in config_parse_exec()"Evgeny Vereshchagin
This reverts commit cb48dfca6a8bc15d9081651001a16bf51e03838a. Exec*-settings resolve specifiers twice: %%U -> config_parse_exec [cb48dfca6a8] -> %U -> service_spawn -> 0 Fixes #2637
2016-02-16Merge pull request #2623 from poettering/networkd-fixesZbigniew Jędrzejewski-Szmek
Networkd, resolved, build-sys fixes
2016-02-16core: fix assertion checkLennart Poettering
Fixes: #2632
2016-02-16main: no need to set errno manuallyAlexander Kuleshov
If we are not PID 1 and started as init, we executing systemctl with execv(). Here no need to set errno manually, because in a failure case, because the execv() anyway will set errno depends on a error.
2016-02-13service: remove unnecessary checkAlexander Kuleshov
We call dual_timestamp_serialize() only if the s->watchdog_timestamp is set. But the dual_timestamp_serialize() already checks a given dual timestamp by the call of the dual_timestamp_is_set(). So we can remove this check safely.
2016-02-13Merge pull request #2603 from poettering/drop-compat-libsZbigniew Jędrzejewski-Szmek
Some spring cleaning
2016-02-13core: drop Capabilities= settingLennart Poettering
The setting is hardly useful (since its effect is generally reduced to zero due to file system caps), and with the advent of ambient caps an actually useful replacement exists, hence let's get rid of this. I am pretty sure this was unused and our man page already recommended against its use, hence this should be a safe thing to remove.
2016-02-12core: fix indenting in dump outputLennart Poettering
Fixes: #2593
2016-02-11Remove kdbus custom endpoint supportDaniel Mack
This feature will not be used anytime soon, so remove a bit of cruft. The BusPolicy= config directive will stay around as compat noop.
2016-02-11core: use correct enumThomas Hindoe Paaboel Andersen
from e903182e5b0daa941de47a9c08c824106cec7fe0
2016-02-11core: don't choke if a unit another unit triggers vanishes during reloadLennart Poettering
Fixes: #1981
2016-02-10Merge pull request #2574 from zonque/netclass-removeLennart Poettering
cgroup: remove support for NetClass= directive
2016-02-10cgroup: remove support for NetClass= directiveDaniel Mack
Support for net_cls.class_id through the NetClass= configuration directive has been added in v227 in preparation for a per-unit packet filter mechanism. However, it turns out the kernel people have decided to deprecate the net_cls and net_prio controllers in v2. Tejun provides a comprehensive justification for this in his commit, which has landed during the merge window for kernel v4.5: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=bd1060a1d671 As we're aiming for full support for the v2 cgroup hierarchy, we can no longer support this feature. Userspace tool such as nftables are moving over to setting rules that are specific to the full cgroup path of a task, which obsoletes these controllers anyway. This commit removes support for tweaking details in the net_cls controller, but keeps the NetClass= directive around for legacy compatibility reasons.
2016-02-10core: treat JobTimeout=0 as equivalent to JobTimeout=infinityLennart Poettering
Corrects an incompatibility introduced with 36c16a7cdd6c33d7980efc2cd6a2211941f302b4. Fixes: #2537
2016-02-10core: simplify how we parse TimeoutSec=, TimeoutStartSec= and TimeoutStopSec=Lennart Poettering
Let's make things more obvious by placing the parse_usec() invocation directly in config_parse_service_timeout().
2016-02-10core: set RLIMIT_CORE to unlimited by defaultLennart Poettering
The kernel sets RLIMIT_CORE to 0 by default. Let's bump this to unlimited by default (for systemd itself and all processes we fork off), so that the coredump hooks have an effect if they honour it. Bumping RLIMIT_CORE of course would have the effect that "core" files will end up on the system at various places, if no coredump hook is used. To avoid this, make sure PID1 sets the core pattern to the empty string by default, so that this logic is disabled. This change in defaults should be useful for all systems where coredump hooks are used, as it allows useful usage of RLIMIT_CORE from these hooks again. OTOH systems that expect that coredumps are placed under the name "core" in the current directory will break with this change. Given how questionnable this behaviour is, and given that no common distro makes use of this by default it shouldn't be too much of a loss. Also, the old behaviour may be restored by explicitly configuring a "core_pattern" of "core", and setting the default system RLIMIT_CORE to 0 again via system.conf.
2016-02-10Merge pull request #2569 from zonque/removalsMartin Pitt
Remove some old cruft
2016-02-10tree-wide: remove Emacs lines from all filesDaniel Mack
This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
2016-02-10Merge pull request #2564 from poettering/fix-2467Daniel Mack
Fix for #2467
2016-02-10core: make the StartLimitXYZ= settings generic and apply to any kind of ↵Lennart Poettering
unit, not just services This moves the StartLimitBurst=, StartLimitInterval=, StartLimitAction=, RebootArgument= from the [Service] section into the [Unit] section of unit files, and thus support it in all unit types, not just in services. This way we can enforce the start limit much earlier, in particular before testing the unit conditions, so that repeated start-up failure due to failed conditions is also considered for the start limit logic. For compatibility the four options may also be configured in the [Service] section still, but we only document them in their new section [Unit]. This also renamed the socket unit failure code "service-failed-permanent" into "service-start-limit-hit" to express more clearly what it is about, after all it's only triggered through the start limit being hit. Finally, the code in busname_trigger_notify() and socket_trigger_notify() is altered to become more alike. Fixes: #2467
2016-02-09Merge pull request #2565 from poettering/fix-2315Zbigniew Jędrzejewski-Szmek
2016-02-09core: clarify which unit file is masked in error messageLennart Poettering
After all, the masked unit file error might be returned when enqueuing a unit that is not masked but requires a masked unit. In this case it should really be clear which unit is meant here.
2016-02-09core: change internal error code for masked units from EBADR to ESHUTDOWNLennart Poettering
This commit changes the mapping of the BUS_ERROR_UNIT_MASKED error to ESHUTDOWN. This error is used whenever the transaction engine is asked to operate on a masked unit. ESHUTDOWN is what is used for the similar case when the unit file enable/disable logic hits a masked unit file, hence is a natural candidate to be used here too. Background: before this patch both "job type not applicable" and "unit masked" where mapped to EBADR, which transaction_add_job_and_dependencies() then checked for. It actually wanted to check exclusively for the former error condition, not the latter but due to the same mapping this failed to work. This patch semi-undoes an accidental change made in caffa4ef700fdd0eadd6c0b2ef9925611672a1bc, however restores the error number to ESHUTDOWN instead of the original ENOSYS (for the reasons indicated above). To make this easier to grok for the future, I added comments to explaining which error conditions are checked for. Fixes: #2315
2016-02-07treewide: fix typos and spacingTorstein Husebø
2016-02-04core: rework job_get_timeout() to use usec_t and handle USEC_INFINITY time ↵Lennart Poettering
events correctly
2016-02-03core: move service_unwatch_control_pid() call into service_enter_running()Lennart Poettering
When we enter the running state we should forget about any control processes, in all cases, and not just when hit a reload timeout...
2016-02-03core: log about path_is_mount_point() errorsLennart Poettering
We really shouldn't fail silently, but print a log message about these errors. Also make sure to attach error codes to all log messages where that makes sense. (While we are at it, add a couple of (void) casts to functions where we knowingly ignore return values.)
2016-02-03core: when a service's ExecStartPre= times out, skip ExecStop=Lennart Poettering
This makes sure we never run two control processes at the same time, we cannot keep track off. This introduces a slight change of behaviour but cleans up the definition of ExecStop= and ExecStopPost=. The former is now invoked only if the service managed to start-up correctly. The latter is called even if start-up failed half-way. Thus, ExecStopPost= may be used as clean-up step for both successful and failed start-up attempts, but ExecStop='s purpose is clearly defined as being responsible for shutting down the service and nothing else. The precise behaviour of this was not documented yet. This commit adds the necessary docs. Fixes: #1254
2016-02-03resolved: apply epoch to system time from PID 1Lennart Poettering
For use in timesyncd we already defined a compile-time "epoch" value, which is based on the mtime of the NEWS file, and specifies a point in time we know lies in the past at runtime. timesyncd uses this to filter out nonsensical timestamp file data, and bump the system clock to a time that is after the build time of systemd. This patch adds similar bumping code to earliest PID 1 initialization, so that the system never continues operation with a clock that is in the 1970ies or even 1930s.
2016-02-03Merge pull request #2512 from 0xAX/mount-setupLennart Poettering
mount-setup: introduce mount_points_setup
2016-02-03manager: print fatal error if early mount failedAlexander Kuleshov
The mount_setup_early() can fail and if it will occur, there is no sense to make selinux setup and etc.
2016-02-03mount-setup: introduce mount_points_setupAlexander Kuleshov
The mount_setup_early() and mount_setup() contain almost the same pieces of code which calls mount_one() for a certain mount point from the mount_table. This patch introduces mount_points_setup() helper to prevent code duplication.