summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2016-07-04tests: fix memory leak in test_strv_fnmatch (#3653)Evgeny Vereshchagin
==1447== 4 bytes in 1 blocks are definitely lost in loss record 1 of 1 ==1447== at 0x4C2BBAD: malloc (vg_replace_malloc.c:299) ==1447== by 0x5350F19: strdup (in /usr/lib64/libc-2.23.so) ==1447== by 0x4E9D435: strv_new_ap (strv.c:166) ==1447== by 0x4E9D5FA: strv_new (strv.c:199) ==1447== by 0x10E665: test_strv_fnmatch (test-strv.c:693) ==1447== by 0x10EAD5: main (test-strv.c:763) ==1447==
2016-07-02Merge pull request #3641 from 0xAX/unset-cloexec-for-stdfsLennart Poettering
basic/fd-util: introduce stdio_unset_cloexec() function
2016-07-02treewide: use stdio_unset_cloexec() functionAlexander Kuleshov
2016-07-02basic/fd-util: introduce stdio_unset_cloexec() functionAlexander Kuleshov
There are some places in the systemd which are use the same pattern: fd_cloexec(STDIN_FILENO, false); fd_cloexec(STDOUT_FILENO, false); fd_cloexec(STDERR_FILENO, false); to unset CLOEXEC for standard file descriptors. This patch introduces the stdio_unset_cloexec() function to hide this and make code cleaner.
2016-07-02Merge pull request #3637 from dobyrch/calendar-rangesLennart Poettering
Allow date and time ranges in OnCalendar
2016-07-02sd-resolve: use close_many() (#3643)0xAX
2016-07-01calendarspec: use ".." notation for ranges of weekdaysDouglas Christman
For backwards compatibility, both the new format (Mon..Wed) and the old format (Mon-Wed) are supported.
2016-07-01calendarspec: allow ranges in date and time specificationsDouglas Christman
Resolves #3042
2016-07-01manager: Fixing a debug printf formatting mistake (#3640)Kyle Walker
A 'llu' formatting statement was used in a debugging printf statement instead of a 'PRIu64'. Correcting that mistake here.
2016-06-30Merge pull request #3634 from disneyworldguy/v2sigchldLennart Poettering
manager: Only invoke a single sigchld per unit within a cleanup cycle
2016-06-30Fix #3236 (#3633)Lennart Poettering
* networkd: condition_test() can return a negative error, handle that If a condition check fails with an error we should not consider the check successful. Fix that. We should probably also improve logging in this case, but for now, let's just unbreak this breakage. Fixes: #3236 * condition: handle unrecognized architectures nicer When we encounter a check for an architecture we don't know we should not let the condition check fail with an error code, but instead simply return false. After all the architecture might just be newer than the ones we know, in which case it's certainly not our local one. Fixes: #3236
2016-06-30Merge pull request #3596 from poettering/machine-cleanMartin Pitt
make "machinectl clean" asynchronous, and open it up via PolicyKit
2016-06-30sd-event: expose the event loop iteration counter via ↵Lennart Poettering
sd_event_get_iteration() (#3631) This extends the existing event loop iteration counter to 64bit, and exposes it via a new function sd_event_get_iteration(). This is helpful for cases like issue #3612. After all, since we maintain the counter anyway, we might as well expose it. (This also fixes an unrelated issue in the man page for sd_event_wait() where micro and milliseconds got mixed up)
2016-06-30manager: Only invoke a single sigchld per unit within a cleanup cycleKyle Walker
By default, each iteration of manager_dispatch_sigchld() results in a unit level sigchld event being invoked. For scope units, this results in a scope_sigchld_event() which can seemingly stall for workloads that have a large number of PIDs within the scope. The stall exhibits itself as a SIG_0 being initiated for each u->pids entry as a result of pid_is_unwaited(). v2: This patch resolves this condition by only paying to cost of a sigchld in the underlying scope unit once per sigchld iteration. A new "sigchldgen" member resides within the Unit struct. The Manager is incremented via the sd event loop, accessed via sd_event_get_iteration, and the Unit member is set to the same value as the manager each time that a sigchld event is invoked. If the Manager iteration value and Unit member match, the sigchld event is not invoked for that iteration.
2016-06-30Merge pull request #3608 from teg/sd-device-driver-idLennart Poettering
sd-device: handle the 'drivers' pseudo-subsystem correctly
2016-06-30journalctl: Make temporary files directory configurable (#3574)ottopotto
journalctl: Use env variable TMPDIR to save temporary files
2016-06-30sd-event: expose the event loop iteration counter via sd_event_get_iteration()Lennart Poettering
This extends the existing event loop iteration counter to 64bit, and exposes it via a new function sd_event_get_iteration(). This is helpful for cases like issue #3612. After all, since we maintain the counter anyway, we might as well expose it. (This also fixes an unrelated issue in the man page for sd_event_wait() where micro and milliseconds got mixed up)
2016-06-29Merge pull request #3516 from fsateler/shared-basicLennart Poettering
build-sys: Convert libshared into a private shared library
2016-06-29Merge pull request #3622 from keszybz/journalctl-this-bootLennart Poettering
Make `journalctl --directory=... --boot 0` work
2016-06-29sd-bus: Fix a read after free error in bus-match. (#3624) (#3625)Weng Xuetian
The loop on bus_match_run should break and return immediately if bus->match_callbacks_modified is true. Otherwise the loop may access free'd data.
2016-06-28systemctl mask of an non-existent unit should print a warning (#3521)Susant Sahani
fixes https://bugzilla.redhat.com/show_bug.cgi?id=842060
2016-06-28journalct: allow --boot=0 to DTRT with --file/--directoryZbigniew Jędrzejewski-Szmek
--boot=0 magically meant "this boot", but when used with --file/--directory it should simply refer to the last boot found in the specified journal. This way, --boot and --list-boots are consistent. Fixes #3603.
2016-06-28journalctl: use simpler variable names in get_boots()Zbigniew Jędrzejewski-Szmek
Those are just local variables and ref_boot_offset is especially obnoxious.
2016-06-28journalct: do no allow --this-boot to take argumentsZbigniew Jędrzejewski-Szmek
Before --this-boot was deprecated in a331b5e6d47243, it did not take any arguments.
2016-06-28journalctl: allow --file/--directory with --boot or --list-bootsZbigniew Jędrzejewski-Szmek
It works mostly fine, and can be quite useful to examine data from another system. OTOH, a single boot id doesn't make sense with --merge, so mixing with --merge is still not allowed.
2016-06-28Remove blank line in the output of “systemctl show” (#3614)Lénaïc Huard
“systemctl show” added an extra blank line after the dump of the EnvironmentFile property of the unit.
2016-06-28resolved: add test for route-only domain filtering (#3609)Martin Pitt
With commit 6f7da49d00 route-only domains do not get put into resolv.conf's "search" list any more. Add a comment about the tri-state, to clarify its semantics and why we are passing a bool parameter into an int type. Also add a test case for it.
2016-06-27basic/strv: introduce STRV_IGNORE macro (#3601)0xAX
to hide casting of '-1' strings and make code cleaner.
2016-06-27basic: pass flags to the fnmatch (#3606)Evgeny Vereshchagin
Fixes: ``` $ systemctl list-unit-files 'hey\*' 0 unit files listed. $ systemctl list-unit-files | grep hey hey\x7eho.service static ```
2016-06-27sd-device: new_from_subsystem_sysnam - support a real subsystem called 'drivers'Tom Gundersen
We support writing out tags and db files in case a real subsystem called 'drivers' exists, so there is no reason to refuse parsing it.
2016-06-27sd-device: device_id - set correctly for 'drivers'Tom Gundersen
The 'drivers' pseudo-subsystem needs special treatment. These pseudo-devices are found under /sys/bus/drivers/, so needs the real subsystem encoded in the device_id in order to be resolved. The reader side already assumed this to be the case.
2016-06-26sd-device: enumerator - do not abort enumeration if a device failsTom Gundersen
Collect the errors and return to the caller, but continue enumerating all devices.
2016-06-26Merge pull request #3572 from poettering/machinectl-shell-fixMartin Pitt
machinectl: interpret options placed between "shell" verb and machine name
2016-06-26machinectl: verify image existance on "start" and "enable" (#3579)Lennart Poettering
Let's make sure we catch early when a machine doesn't exist that is attempted to be started or enabled as system service.
2016-06-26networkd: use strv_fnmatch() (#3605)0xAX
2016-06-26Merge pull request #3600 from poettering/fstab-generator-fixesMartin Pitt
Fstab generator fixes
2016-06-26basic/strv: use SWAP_TWO() macro (#3602)0xAX
2016-06-25nspawn: fix uid patching logic (#3599)Lennart Poettering
An incorrectly set if/else chain caused aus to apply the access mode of a symlink to the directory it is located in. Yuck. Fixes: #3547
2016-06-24build-sys: Add new libsystemd-shared private libraryFelipe Sateler
Link as many binaries as possible with it, to save storage space. Preserve the static libshared and libbasic for use in libraries, nss modules and udev. Libraries need to be static in order to avoid polluting the symbol namespace. Udev needs to be static so downstream can avoid strict version dependencies with the systemd package, and this can complicate upgrade scenarios.
2016-06-24fstab-generator: minor simplificationLennart Poettering
2016-06-24fstab-generator: skip fsck for /usr on non-device file systemsLennart Poettering
We do the same already for the root device, hence follow the scheme for /usr too. (Also add some explanatory comments.)
2016-06-24fstab-generator: don't skip /usr handling if root handling didn't work correctlyLennart Poettering
Let's follow the same logic for all mounts here: log errors, and exit the process uncleanly ultimately, but do not skip further mounts if we encounter a problem with an earlier one. Fixes: #2344
2016-06-24systemctl: fix an error condition from "-1" to something meaningfulLennart Poettering
We really shouldn't make up errors like "-1", but use proper errno definitions.
2016-06-24fstab-generator: fix checking of fstab_node_to_udev_node() resultLennart Poettering
We have to check for OOM here, let's add that. There's really no point in checking for path_is_absolute() on the result however, as there's no particular reason why that should be refused. Also, we don't have similar checks for the other mount devices the generator deals with, hence don't bother with it here either. Let's remove that check. (And it shouldn't return made-up errors like "-1" in this case anyway.)
2016-06-24fstab-generator: document why we copy the root device into the usr device if ↵Lennart Poettering
unset Let's a comment about this, to avoid questions popping up like in #2344.
2016-06-24fstab-generator: let's use path_equal() for comparing pathsLennart Poettering
2016-06-24pid1: restore console color support for containers (#3595)Franck Bui
Commit 3a18b60489504056f9b0b1a139439cbfa60a87e1 introduced a regression that disabled the color mode for container. This patch fixes this.
2016-06-24machined: make sure CleanPool() method is opened up in the dbus policyLennart Poettering
The method is already hooked up to PolicyKit, hence let's open this up via the bus policy language too. Fixes: #3585
2016-06-24machined: "machinectl clean" can take a while, do it asynchronously from a ↵Lennart Poettering
background process This is a follow-up to 5d2036b5f3506bd0ff07042aee8d69c26db32298, and also makes the "machinectl clean" verb asynchronous, after all it's little more than a series of image removals. The changes required to make this happen are a bit more comprehensive as we need to pass information about deleted images back to the client, as well as information about the image we failed on if we failed on one. Hence, create a temporary file in /tmp, serialize that data into, and read it from the parent after the operation is complete.
2016-06-24machined: don't bother explicitly closing the errno pipeLennart Poettering
There's no point in explicitly closing the errno pipe, if we exit right after anyway. It doesn't hurt doing this either, but let's do this the same way for all cases where we use the "Operation" object right now, and in all other cases we do not close the pipe explicitly, hence don't do so here either.