]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
7 years agobuild-sys: add mkosi hookup (#3731)
Lennart Poettering [Sat, 16 Jul 2016 00:00:44 +0000 (02:00 +0200)] 
build-sys: add mkosi hookup (#3731)

This adds a build script and a settings file for "mkosi", a tool for putting
together full, bootable disk images for container managers of EFI systems and
VMs.

With these files it's enough to type "mkosi" in the project directory to
generate a bootable Fedora 24 OS image with a version of systemd compiled fresh
from the working tree.

See https://github.com/systemd/mkosi

7 years agonetworkd: fix for 3692 (#3699)
Susant Sahani [Fri, 15 Jul 2016 16:50:51 +0000 (22:20 +0530)] 
networkd: fix for 3692 (#3699)

We should look that the kind is invalid rather than pointer is NULL.

7 years agorules: UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG property (#3714)
Rusty Bird [Fri, 15 Jul 2016 16:47:42 +0000 (16:47 +0000)] 
rules: UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG property (#3714)

Sometimes, the persistent storage rules should be skipped for a subset
of devices. For example, the Qubes operating system prevents dom0 from
parsing untrusted block device content (such as filesystem metadata) by
shipping a custom 60-persistent-storage.rules, patched to bail out early
if the device name matches a hardcoded pattern.

As a less brittle and more flexible alternative, this commit adds a line
to the two relevant .rules files which makes them test the value of the
UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG device property, modeled
after the various DM_UDEV_DISABLE_*_RULES_FLAG properties.

7 years agotree-wide: get rid of selinux_context_t (#3732)
Zbigniew Jędrzejewski-Szmek [Fri, 15 Jul 2016 16:44:02 +0000 (12:44 -0400)] 
tree-wide: get rid of selinux_context_t (#3732)

https://github.com/SELinuxProject/selinux/commit/9eb9c9327563014ad6a807814e7975424642d5b9
deprecated selinux_context_t. Replace with a simple char* everywhere.

Alternative fix for #3719.

7 years agoudev: Line buffer 'udev monitor' output (#3733)
Stef Walter [Fri, 15 Jul 2016 10:24:34 +0000 (12:24 +0200)] 
udev: Line buffer 'udev monitor' output (#3733)

Callers of the 'udev monitor' tool expect to see output when
an event occurs. The stdio buffering defeats that. This patch
switches it to line buffering.

7 years agozsh-completion: fix option ordering in set-x11-keymap (#3646)
ntzrmtthihu777 [Fri, 15 Jul 2016 08:59:45 +0000 (03:59 -0500)] 
zsh-completion: fix option ordering in set-x11-keymap (#3646)

7 years agomacros: provide %_systemdgeneratordir and %_systemdusergeneratordir (#3672)
Zbigniew Jędrzejewski-Szmek [Fri, 15 Jul 2016 07:35:49 +0000 (03:35 -0400)] 
macros: provide %_systemdgeneratordir and %_systemdusergeneratordir (#3672)

... as requested in
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/DJ7HDNRM5JGBSA4HL3UWW5ZGLQDJ6Y7M/.
Adding the macro makes it marginally easier to create generators
for outside projects.

I opted for "generatordir" and "usergeneratordir" to match
%unitdir and %userunitdir. OTOH, "_systemd" prefix makes it obvious
that this is related to systemd. "%_generatordir" would be to generic
of a name.

7 years agonetwork-ndisc: avoid VLAs (#3725)
Daniel Mack [Fri, 15 Jul 2016 02:56:11 +0000 (04:56 +0200)] 
network-ndisc: avoid VLAs (#3725)

Do not allocate objects of dynamic and potentially large size on the stack
to avoid both clang compilation errors and unpredictable runtime behavior
on exotic platforms. Use the heap for that instead.

While at it, refactor the code a bit. Access 's->domain' via
NDISC_DNSSL_DOMAIN(), and refrain from allocating 'x' independently, but
rather reuse 's' if we're dealing with a new entry to the set.

Fixes #3717

7 years agocorrect information about implicit dependencies (#3730)
Michal Soltys [Fri, 15 Jul 2016 02:20:45 +0000 (04:20 +0200)] 
correct information about implicit dependencies (#3730)

systemd.special.xml: corrections about implicit
dependencies for basic.target, sysinit.target and shutdown.target.

systemd.target.xml: corrections about implicit dependencies for
target units in general.

7 years agoMerge pull request #3709 from poettering/journald-shutdown-sync
Zbigniew Jędrzejewski-Szmek [Fri, 15 Jul 2016 01:47:49 +0000 (21:47 -0400)] 
Merge pull request #3709 from poettering/journald-shutdown-sync

journald-related shutdown fixes for slow I/O

7 years agoFix tablet detection, by replicating decision tree of non-multi-touch axes (#3724)
Andreas Pokorny [Thu, 14 Jul 2016 20:42:10 +0000 (22:42 +0200)] 
Fix tablet detection, by replicating decision tree of non-multi-touch axes (#3724)

Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
7 years agohwdb: add axis corrections for the Lenovo V360 touchpad (#3712)
Peter Hutterer [Thu, 14 Jul 2016 07:28:53 +0000 (17:28 +1000)] 
hwdb: add axis corrections for the Lenovo V360 touchpad (#3712)

https://bugs.freedesktop.org/show_bug.cgi?id=96875

7 years agobasic/mount-util: recognize ocfs2 as network fs (#3713)
Valentin Vidić [Thu, 14 Jul 2016 05:34:36 +0000 (07:34 +0200)] 
basic/mount-util: recognize ocfs2 as network fs (#3713)

7 years agoshutdown: already sync IO before we enter the final killing spree 3709/head
Lennart Poettering [Tue, 12 Jul 2016 15:26:52 +0000 (17:26 +0200)] 
shutdown: already sync IO before we enter the final killing spree

This way, slow IO journald has to wait for can't cause it to reach the killing
spree timeout and is hit by SIGKILL in addition to SIGTERM.

7 years agoshutdown: use 90s SIGKILL timeout
Lennart Poettering [Tue, 12 Jul 2016 15:18:43 +0000 (17:18 +0200)] 
shutdown: use 90s SIGKILL timeout

There's really no reason to use 10s here, let's instead default to 90s like we
do for everything else.

The SIGKILL during the final killing spree is in most regards the fourth level
of a safety net, after all: any normal service should have already been stopped
during the normal service shutdown logic, first via SIGTERM and then SIGKILL,
and then also via SIGTERM during the finall killing spree before we send
SIGKILL. And as a fourth level safety net it should only be required in
exceptional cases, which means it's safe to rais the default timeout, as normal
shutdowns should never be delayed by it.

Note that journald excludes itself from the normal service shutdown, and relies
on the final killing spree to terminate it (this is because it wants to cover
the normal shutdown phase's complete logging). If the system's IO is
excessively slow, then the 10s might not be enough for journald to sync
everything to disk and logs might get lost during shutdown.

7 years agoVarious fixes for typos found by lintian (#3705)
Michael Biebl [Tue, 12 Jul 2016 10:52:11 +0000 (12:52 +0200)] 
Various fixes for typos found by lintian (#3705)

7 years agoman: fix indefinite articles (#3694)
Jakub Wilk [Tue, 12 Jul 2016 09:58:14 +0000 (11:58 +0200)] 
man: fix indefinite articles (#3694)

7 years agoseccomp: only abort on syscall name resolution failures (#3701)
Luca Bruno [Tue, 12 Jul 2016 09:55:26 +0000 (11:55 +0200)] 
seccomp: only abort on syscall name resolution failures (#3701)

seccomp_syscall_resolve_name() can return a mix of positive and negative
(pseudo-) syscall numbers, while errors are signaled via __NR_SCMP_ERROR.
This commit lets the syscall filter parser only abort on real parsing
failures, letting libseccomp handle pseudo-syscall number on its own
and allowing proper multiplexed syscalls filtering.

7 years agoMerge pull request #3702 from torstehu/fix-typo
Michael Biebl [Tue, 12 Jul 2016 00:47:25 +0000 (02:47 +0200)] 
Merge pull request #3702 from torstehu/fix-typo

treewide: fix typos and remove accidental repetition of words

7 years agotreewide: fix typos and remove accidental repetition of words 3702/head
Torstein Husebø [Sun, 10 Jul 2016 12:48:23 +0000 (14:48 +0200)] 
treewide: fix typos and remove accidental repetition of words

7 years agoman: improve wording for calendar spec's repetition values (#3687) 3501/head
Ivan Shapovalov [Fri, 8 Jul 2016 19:08:07 +0000 (23:08 +0400)] 
man: improve wording for calendar spec's repetition values (#3687)

7 years agonspawn-completion: implementation of shell completion of --notify-ready (#3679)
Alessandro Puccetti [Fri, 8 Jul 2016 15:44:20 +0000 (17:44 +0200)] 
nspawn-completion: implementation of shell completion of --notify-ready (#3679)

Relative to: https://github.com/systemd/systemd/pull/3474

7 years agorules: block: add support for pmem devices (#3683)
bgbhpe [Fri, 8 Jul 2016 15:43:56 +0000 (11:43 -0400)] 
rules: block: add support for pmem devices (#3683)

Persistent memory devices can be exposed as block devices as /dev/pmemN
and /dev/pmemNs.  pmemN is the raw device and is byte-addressable from
within the kernel and when mmapped by applications from a DAX-mounted
file system.  pmemNs has the block translation table (BTT) layered on top,
offering atomic sector/block access.  Both pmemN and pmemNs are expected
to contain file systems.

blkid(8) and lsblk(8) seem to correctly report on pmemN and pmemNs.
systemd v219 will populate /dev/disk/by-uuid/ when, for example, mkfs is
used on pmem, but systemd v228 does not.

Add pmem to the whitelist.

7 years agoudevadm: explicitly relabel /etc/udev/hwdb.bin after rename (#3686)
Michal Sekletar [Fri, 8 Jul 2016 15:43:05 +0000 (17:43 +0200)] 
udevadm: explicitly relabel /etc/udev/hwdb.bin after rename (#3686)

This is basically the same change as ea68351.

7 years agoMerge pull request #3680 from joukewitteveen/pam-env
Evgeny Vereshchagin [Fri, 8 Jul 2016 14:33:12 +0000 (17:33 +0300)] 
Merge pull request #3680 from joukewitteveen/pam-env

Follow up on #3503 (pass service env vars to PAM sessions)

7 years agoexecute: Do not alter call-by-ref parameter on failure 3680/head
Jouke Witteveen [Thu, 7 Jul 2016 10:41:52 +0000 (12:41 +0200)] 
execute: Do not alter call-by-ref parameter on failure

Prevent free from being called on (a part of) the call-by-reference
variable env when setup_pam fails.

7 years agocore: queue loading transient units after setting their properties (#3676)
David Michael [Fri, 8 Jul 2016 03:43:01 +0000 (20:43 -0700)] 
core: queue loading transient units after setting their properties (#3676)

The unit load queue can be processed in the middle of setting the
unit's properties, so its load_state would no longer be UNIT_STUB
for the check in bus_unit_set_properties(), which would cause it to
incorrectly return an error.

7 years agocgroup: fix memory cgroup limit regression on kernel 3.10 (#3673)
Daniel Mack [Fri, 8 Jul 2016 02:29:35 +0000 (04:29 +0200)] 
cgroup: fix memory cgroup limit regression on kernel 3.10 (#3673)

Commit da4d897e ("core: add cgroup memory controller support on the unified
hierarchy (#3315)") changed the code in src/core/cgroup.c to always write
the real numeric value from the cgroup parameters to the
"memory.limit_in_bytes" attribute file.

For parameters set to CGROUP_LIMIT_MAX, this results in the string
"18446744073709551615" being written into that file, which is UINT64_MAX.
Before that commit, CGROUP_LIMIT_MAX was special-cased to the string "-1".

This causes a regression on CentOS 7, which is based on kernel 3.10, as the
value is interpreted as *signed* 64 bit, and clamped to 0:

[root@n54 ~]# echo 18446744073709551615 >/sys/fs/cgroup/memory/user.slice/memory.limit_in_bytes
[root@n54 ~]# cat /sys/fs/cgroup/memory/user.slice/memory.limit_in_bytes
0

[root@n54 ~]# echo -1 >/sys/fs/cgroup/memory/user.slice/memory.limit_in_bytes
[root@n54 ~]# cat /sys/fs/cgroup/memory/user.slice/memory.limit_in_bytes
9223372036854775807

Hence, all units that are subject to the limits enforced by the memory
controller will crash immediately, even though they have no actual limit
set. This happens to for the user.slice, for instance:

[  453.577153] Hardware name: SeaMicro SM15000-64-CC-AA-1Ox1/AMD Server CRB, BIOS Estoc.3.72.19.0018 08/19/2014
[  453.587024]  ffff880810c56780 00000000aae9501f ffff880813d7fcd0 ffffffff816360fc
[  453.594544]  ffff880813d7fd60 ffffffff8163109c ffff88080ffc5000 ffff880813d7fd28
[  453.602120]  ffffffff00000202 fffeefff00000000 0000000000000001 ffff880810c56c03
[  453.609680] Call Trace:
[  453.612156]  [<ffffffff816360fc>] dump_stack+0x19/0x1b
[  453.617324]  [<ffffffff8163109c>] dump_header+0x8e/0x214
[  453.622671]  [<ffffffff8116d20e>] oom_kill_process+0x24e/0x3b0
[  453.628559]  [<ffffffff81088dae>] ? has_capability_noaudit+0x1e/0x30
[  453.634969]  [<ffffffff811d4155>] mem_cgroup_oom_synchronize+0x575/0x5a0
[  453.641721]  [<ffffffff811d3520>] ? mem_cgroup_charge_common+0xc0/0xc0
[  453.648299]  [<ffffffff8116da84>] pagefault_out_of_memory+0x14/0x90
[  453.654621]  [<ffffffff8162f4cc>] mm_fault_error+0x68/0x12b
[  453.660233]  [<ffffffff81642012>] __do_page_fault+0x3e2/0x450
[  453.666017]  [<ffffffff816420a3>] do_page_fault+0x23/0x80
[  453.671467]  [<ffffffff8163e308>] page_fault+0x28/0x30
[  453.676656] Task in /user.slice/user-0.slice/user@0.service killed as a result of limit of /user.slice/user-0.slice/user@0.service
[  453.688477] memory: usage 0kB, limit 0kB, failcnt 7
[  453.693391] memory+swap: usage 0kB, limit 9007199254740991kB, failcnt 0
[  453.700039] kmem: usage 0kB, limit 9007199254740991kB, failcnt 0
[  453.706076] Memory cgroup stats for /user.slice/user-0.slice/user@0.service: cache:0KB rss:0KB rss_huge:0KB mapped_file:0KB swap:0KB inactive_anon:0KB active_anon:0KB inactive_file:0KB active_file:0KB unevictable:0KB
[  453.725702] [ pid ]   uid  tgid total_vm      rss nr_ptes swapents oom_score_adj name
[  453.733614] [ 2837]     0  2837    11950      899      23        0             0 (systemd)
[  453.741919] Memory cgroup out of memory: Kill process 2837 ((systemd)) score 1 or sacrifice child
[  453.750831] Killed process 2837 ((systemd)) total-vm:47800kB, anon-rss:3188kB, file-rss:408kB

Fix this issue by special-casing the UINT64_MAX case again.

7 years agoexecute: Cleanup the environment early
Jouke Witteveen [Thu, 7 Jul 2016 10:36:33 +0000 (12:36 +0200)] 
execute: Cleanup the environment early

By cleaning up before setting up PAM we maintain control of overriding
behavior in setting variables. Otherwise, pam_putenv is in control.
This also makes sure we use a cleaned up environment in replacing
variables in argv.

7 years agobasic: log: Increase static buffer for source file location (#3674)
Daniel Mack [Thu, 7 Jul 2016 04:30:34 +0000 (06:30 +0200)] 
basic: log: Increase static buffer for source file location (#3674)

Commit d054f0a4 ("tree-wide: use xsprintf() where applicable") used a
semantic patch approach to change a number of locations from

  snprintf(buf, sizeof(buf), FMT, ...)

to

  xsprintf(buf, FMT, ...)

The problem is that xsprintf() wraps the snprintf() in an
assert_message_se(), so if snprintf() reports an overflow of the
destination buffer, the binary will now terminate.

This hit a user running a version of systemd that was built from a
deeply nested system path.

Fix this by

a) Switching back to snprintf() for this particular case. We should really
rather truncate the location string than crash in such situations.

b) Increasing the size of that static string buffer, to make the event more
unlikely.

7 years agoman: networkd bonding remove 802.3ad from transmit hash policy (#3666)
Susant Sahani [Wed, 6 Jul 2016 05:42:03 +0000 (11:12 +0530)] 
man: networkd bonding remove 802.3ad from transmit hash policy (#3666)

The xmit_hash_policy does not have 802.3ad value. Remove this
from man.

7 years agohwdb: Update database of Bluetooth company identifiers
Marcel Holtmann [Tue, 5 Jul 2016 19:13:32 +0000 (21:13 +0200)] 
hwdb: Update database of Bluetooth company identifiers

7 years agoMerge pull request #3638 from whot/udev-prop-touchpad-integration
Lennart Poettering [Tue, 5 Jul 2016 17:25:59 +0000 (10:25 -0700)] 
Merge pull request #3638 from whot/udev-prop-touchpad-integration

tag touchpads as internal/external

7 years agosystemd-run: really make -E an alias for --setenv (#3654)
Michał Bartoszkiewicz [Tue, 5 Jul 2016 17:23:23 +0000 (19:23 +0200)] 
systemd-run: really make -E an alias for --setenv (#3654)

systemd-run --help says:
  -E --setenv=NAME=VALUE          Set environment

7 years agoMerge pull request #3652 from torstehu/fix-typo
Martin Pitt [Mon, 4 Jul 2016 15:24:38 +0000 (17:24 +0200)] 
Merge pull request #3652 from torstehu/fix-typo

treewide: fix typos and add manpage interlinking.

7 years agoman: add link to sd_bus_add_match to busctl.xml 3652/head
Torstein Husebø [Fri, 24 Jun 2016 13:32:57 +0000 (15:32 +0200)] 
man: add link to sd_bus_add_match to busctl.xml

7 years agotreewide: fix typos
Torstein Husebø [Thu, 12 May 2016 09:23:35 +0000 (11:23 +0200)] 
treewide: fix typos

7 years agotests: fix memory leak in test_strv_fnmatch (#3653)
Evgeny Vereshchagin [Mon, 4 Jul 2016 08:11:07 +0000 (11:11 +0300)] 
tests: fix memory leak in test_strv_fnmatch (#3653)

==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==

7 years agoMerge pull request #3650 from fsateler/shared-basic-fallout
Evgeny Vereshchagin [Mon, 4 Jul 2016 00:45:58 +0000 (03:45 +0300)] 
Merge pull request #3650 from fsateler/shared-basic-fallout

fix fallout from libsystemd-shared

7 years agotests: Install missing libraries for things installed in /usr too 3650/head
Felipe Sateler [Sun, 3 Jul 2016 22:56:54 +0000 (18:56 -0400)] 
tests: Install missing libraries for things installed in /usr too

7 years agobuild-sys: link test-keymap-util against libsystemd-shared
Felipe Sateler [Sun, 3 Jul 2016 22:32:48 +0000 (18:32 -0400)] 
build-sys: link test-keymap-util against libsystemd-shared

7 years agotests: run file via libtool to determine shell scripts
Felipe Sateler [Sun, 3 Jul 2016 15:19:38 +0000 (11:19 -0400)] 
tests: run file via libtool to determine shell scripts

The actual output file might be a wrapper script, so lets follow the indirection

Fixes: #3644
7 years agotests: follow RUNPATH when installing missing libraries
Felipe Sateler [Sun, 3 Jul 2016 15:17:13 +0000 (11:17 -0400)] 
tests: follow RUNPATH when installing missing libraries

Fixes #3630

7 years agoMerge pull request #3641 from 0xAX/unset-cloexec-for-stdfs
Lennart Poettering [Sat, 2 Jul 2016 22:22:14 +0000 (15:22 -0700)] 
Merge pull request #3641 from 0xAX/unset-cloexec-for-stdfs

basic/fd-util: introduce stdio_unset_cloexec() function

7 years agotreewide: use stdio_unset_cloexec() function 3641/head
Alexander Kuleshov [Sat, 2 Jul 2016 17:42:01 +0000 (23:42 +0600)] 
treewide: use stdio_unset_cloexec() function

7 years agobasic/fd-util: introduce stdio_unset_cloexec() function
Alexander Kuleshov [Sat, 2 Jul 2016 17:38:47 +0000 (23:38 +0600)] 
basic/fd-util: introduce stdio_unset_cloexec() function

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.

7 years agoMerge pull request #3637 from dobyrch/calendar-ranges
Lennart Poettering [Sat, 2 Jul 2016 16:03:20 +0000 (09:03 -0700)] 
Merge pull request #3637 from dobyrch/calendar-ranges

Allow date and time ranges in OnCalendar

7 years agosd-resolve: use close_many() (#3643)
0xAX [Sat, 2 Jul 2016 15:17:26 +0000 (18:17 +0300)] 
sd-resolve: use close_many() (#3643)

7 years agocalendarspec: use ".." notation for ranges of weekdays 3637/head
Douglas Christman [Fri, 1 Jul 2016 02:26:07 +0000 (22:26 -0400)] 
calendarspec: use ".." notation for ranges of weekdays

For backwards compatibility, both the new format (Mon..Wed) and
the old format (Mon-Wed) are supported.

7 years agocalendarspec: allow ranges in date and time specifications
Douglas Christman [Fri, 1 Jul 2016 00:16:05 +0000 (20:16 -0400)] 
calendarspec: allow ranges in date and time specifications

Resolves #3042

7 years agoupdate TODO
Lennart Poettering [Sat, 2 Jul 2016 01:39:26 +0000 (18:39 -0700)] 
update TODO

7 years agomanager: Fixing a debug printf formatting mistake (#3640)
Kyle Walker [Fri, 1 Jul 2016 17:03:35 +0000 (13:03 -0400)] 
manager: Fixing a debug printf formatting mistake (#3640)

A 'llu' formatting statement was used in a debugging printf statement
instead of a 'PRIu64'. Correcting that mistake here.

7 years agohwdb: add a 70-touchpad.hwdb to tag internal vs external touchpads 3638/head
Peter Hutterer [Fri, 1 Jul 2016 01:10:33 +0000 (11:10 +1000)] 
hwdb: add a 70-touchpad.hwdb to tag internal vs external touchpads

Add a new key ID_INPUT_TOUCHPAD_INTEGRATION=internal|external so we have a
single source for figuring out which touchpads are built-in.

Fairly simple approach: bluetooth is external, usb is external unless it's an
Apple touchpad. Everything else is internal.

7 years agorules: set ID_BUS for bluetooth, rmi and i8042
Peter Hutterer [Fri, 1 Jul 2016 05:12:34 +0000 (15:12 +1000)] 
rules: set ID_BUS for bluetooth, rmi and i8042

Something has to so we can have udev rules rely on this. Right now the ID_BUS
setting is inconsistent: usb is set, ata and pci are set, bluetooth is not
set, rmi is too new to be featured.

70-mouse even relied on bluetooth even though it was never set

7 years agoMerge pull request #3634 from disneyworldguy/v2sigchld
Lennart Poettering [Thu, 30 Jun 2016 22:57:39 +0000 (15:57 -0700)] 
Merge pull request #3634 from disneyworldguy/v2sigchld

manager: Only invoke a single sigchld per unit within a cleanup cycle

7 years agoFix #3236 (#3633)
Lennart Poettering [Thu, 30 Jun 2016 22:56:23 +0000 (15:56 -0700)] 
Fix #3236 (#3633)

* 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
7 years agoMerge pull request #3596 from poettering/machine-clean
Martin Pitt [Thu, 30 Jun 2016 19:30:35 +0000 (21:30 +0200)] 
Merge pull request #3596 from poettering/machine-clean

make "machinectl clean" asynchronous, and open it up via PolicyKit

7 years agoman: minor typo "has already has happened" (#3635)
Lukas Lösche [Thu, 30 Jun 2016 19:25:51 +0000 (21:25 +0200)] 
man: minor typo "has already has happened" (#3635)

7 years agosd-event: expose the event loop iteration counter via sd_event_get_iteration() (...
Lennart Poettering [Thu, 30 Jun 2016 19:25:07 +0000 (12:25 -0700)] 
sd-event: expose the event loop iteration counter via 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)

7 years agomanager: Only invoke a single sigchld per unit within a cleanup cycle 3634/head
Kyle Walker [Thu, 30 Jun 2016 19:12:18 +0000 (15:12 -0400)] 
manager: Only invoke a single sigchld per unit within a cleanup cycle

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.

7 years agoMerge pull request #3608 from teg/sd-device-driver-id
Lennart Poettering [Thu, 30 Jun 2016 16:47:52 +0000 (09:47 -0700)] 
Merge pull request #3608 from teg/sd-device-driver-id

sd-device: handle the 'drivers' pseudo-subsystem correctly

7 years agojournalctl: Make temporary files directory configurable (#3574)
ottopotto [Thu, 30 Jun 2016 14:59:06 +0000 (17:59 +0300)] 
journalctl: Make temporary files directory configurable (#3574)

journalctl: Use env variable TMPDIR to save temporary files

7 years agosd-event: expose the event loop iteration counter via sd_event_get_iteration() 3631/head
Lennart Poettering [Thu, 30 Jun 2016 02:03:26 +0000 (19:03 -0700)] 
sd-event: expose the event loop iteration counter via sd_event_get_iteration()

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)

7 years agotest: check resolved generated resolv.conf in networkd-test (#3628)
Martin Pitt [Thu, 30 Jun 2016 13:44:22 +0000 (15:44 +0200)] 
test: check resolved generated resolv.conf in networkd-test (#3628)

* test: check resolved generated resolv.conf in networkd-test

Directly verify the contents of /run/systemd/resolve/resolv.conf instead of
/etc/resolv.conf. The latter might be a plain file or a symlink to something
else (like Debian's resolvconf output), and in these cases we cannot make
strong assumptions about the contents.

Drop the "/etc/resolv.conf is a symlink" conditions and the "resolv.conf can
have at most three nameservers" alternatives, as we know that resolved always
adds all nameservers.

Explicitly start resolved at the start of a test to ensure that it is running.

* test: get along with existing system search domains in resolv.conf

The previous change has uncovered a bug in the tests: Existing search domains
can exist in resolv.conf which test_search_domains{,_too_long} didn't take into account.

As existing domains take some of the "max 6 domains" and "max 255 chars" limit,
don't expect that the last items from our test data actually appears in the
output, just the first few.

7 years agoMerge pull request #3516 from fsateler/shared-basic
Lennart Poettering [Wed, 29 Jun 2016 20:38:50 +0000 (22:38 +0200)] 
Merge pull request #3516 from fsateler/shared-basic

build-sys: Convert libshared into a private shared library

7 years agoMerge pull request #3622 from keszybz/journalctl-this-boot
Lennart Poettering [Wed, 29 Jun 2016 20:25:08 +0000 (22:25 +0200)] 
Merge pull request #3622 from keszybz/journalctl-this-boot

Make `journalctl --directory=... --boot 0` work

7 years agosd-bus: Fix a read after free error in bus-match. (#3624) (#3625)
Weng Xuetian [Wed, 29 Jun 2016 20:22:12 +0000 (13:22 -0700)] 
sd-bus: Fix a read after free error in bus-match. (#3624) (#3625)

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.

7 years agosystemctl mask of an non-existent unit should print a warning (#3521)
Susant Sahani [Tue, 28 Jun 2016 20:27:07 +0000 (01:57 +0530)] 
systemctl mask of an non-existent unit should print a warning (#3521)

fixes https://bugzilla.redhat.com/show_bug.cgi?id=842060

7 years agojournalct: allow --boot=0 to DTRT with --file/--directory 3622/head
Zbigniew Jędrzejewski-Szmek [Tue, 28 Jun 2016 20:12:47 +0000 (16:12 -0400)] 
journalct: allow --boot=0 to DTRT with --file/--directory

--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.

7 years agojournalctl: use simpler variable names in get_boots()
Zbigniew Jędrzejewski-Szmek [Tue, 28 Jun 2016 19:49:03 +0000 (15:49 -0400)] 
journalctl: use simpler variable names in get_boots()

Those are just local variables and ref_boot_offset is especially
obnoxious.

7 years agojournalct: do no allow --this-boot to take arguments
Zbigniew Jędrzejewski-Szmek [Tue, 28 Jun 2016 19:39:56 +0000 (15:39 -0400)] 
journalct: do no allow --this-boot to take arguments

Before --this-boot was deprecated in a331b5e6d47243, it did not take
any arguments.

7 years agojournalctl: allow --file/--directory with --boot or --list-boots
Zbigniew Jędrzejewski-Szmek [Tue, 28 Jun 2016 19:27:07 +0000 (15:27 -0400)] 
journalctl: allow --file/--directory with --boot or --list-boots

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.

7 years agoRemove blank line in the output of “systemctl show” (#3614)
Lénaïc Huard [Tue, 28 Jun 2016 18:15:33 +0000 (20:15 +0200)] 
Remove blank line in the output of “systemctl show” (#3614)

“systemctl show” added an extra blank line after the dump of the
EnvironmentFile property of the unit.

7 years agoman: clarify NotifyAccess overriding (#3620)
Luca Bruno [Tue, 28 Jun 2016 18:14:08 +0000 (20:14 +0200)] 
man: clarify NotifyAccess overriding (#3620)

Type=notify has a magic overriding case where a NotifyAccess=none
is turned into a NotifyAccess=main for sanity purposes.
This makes docs more clear about such behavior:
https://github.com/systemd/systemd/blob/2787d83c28b7565ea6f80737170514e5e6186917/src/core/service.c#L650:L651

7 years agoresolved: add test for route-only domain filtering (#3609)
Martin Pitt [Tue, 28 Jun 2016 16:18:27 +0000 (18:18 +0200)] 
resolved: add test for route-only domain filtering (#3609)

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.

7 years agoAdded Indonesian translation (#3615)
Andika Triwidada [Tue, 28 Jun 2016 08:14:27 +0000 (15:14 +0700)] 
Added Indonesian translation (#3615)

7 years agobasic/strv: introduce STRV_IGNORE macro (#3601)
0xAX [Mon, 27 Jun 2016 21:26:07 +0000 (00:26 +0300)] 
basic/strv: introduce STRV_IGNORE macro (#3601)

to hide casting of '-1' strings and make code cleaner.

7 years agobasic: pass flags to the fnmatch (#3606)
Evgeny Vereshchagin [Mon, 27 Jun 2016 12:47:37 +0000 (15:47 +0300)] 
basic: pass flags to the fnmatch (#3606)

Fixes:
```
$ systemctl list-unit-files 'hey\*'

0 unit files listed.

$ systemctl list-unit-files | grep hey
hey\x7eho.service                          static
```

7 years agosd-device: new_from_subsystem_sysnam - support a real subsystem called 'drivers' 3608/head
Tom Gundersen [Mon, 27 Jun 2016 07:58:59 +0000 (09:58 +0200)] 
sd-device: new_from_subsystem_sysnam - support a real subsystem called 'drivers'

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.

7 years agosd-device: device_id - set correctly for 'drivers'
Tom Gundersen [Sun, 26 Jun 2016 21:05:27 +0000 (23:05 +0200)] 
sd-device: device_id - set correctly for 'drivers'

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.

7 years agosd-device: enumerator - do not abort enumeration if a device fails
Tom Gundersen [Sun, 26 Jun 2016 20:36:46 +0000 (22:36 +0200)] 
sd-device: enumerator - do not abort enumeration if a device fails

Collect the errors and return to the caller, but continue enumerating all devices.

7 years agoMerge pull request #3572 from poettering/machinectl-shell-fix
Martin Pitt [Sun, 26 Jun 2016 15:46:23 +0000 (17:46 +0200)] 
Merge pull request #3572 from poettering/machinectl-shell-fix

machinectl: interpret options placed between "shell" verb and machine name

7 years agocatalog: make support URL to show in shipped catalog entries configurable (#3597)
Lennart Poettering [Sun, 26 Jun 2016 15:43:37 +0000 (17:43 +0200)] 
catalog: make support URL to show in shipped catalog entries configurable (#3597)

Let's allow distros to change the support URL to expose in catalog entries by
default. It doesn't make sense to direct end-users to the upstream project for
common errors.

This adds a --with-support-url= switch to configure, which allows overriding
the default at build-time.

Fixes: #2516
7 years agomachinectl: verify image existance on "start" and "enable" (#3579)
Lennart Poettering [Sun, 26 Jun 2016 15:41:33 +0000 (17:41 +0200)] 
machinectl: verify image existance on "start" and "enable" (#3579)

Let's make sure we catch early when a machine doesn't exist that is attempted
to be started or enabled as system service.

7 years agonetworkd: use strv_fnmatch() (#3605)
0xAX [Sun, 26 Jun 2016 15:37:24 +0000 (18:37 +0300)] 
networkd: use strv_fnmatch() (#3605)

7 years agoman: document what Authenticated: in the systemd-resolve output actually means (...
Lennart Poettering [Sun, 26 Jun 2016 15:35:22 +0000 (17:35 +0200)] 
man: document what Authenticated: in the systemd-resolve output actually means (#3571)

My educated guess is that #3561 was filed due to confusion around the
systemd-resolve "Data Authenticated:" output.  Let's try to clean up the
confusion a bit, and document what it means in the man page.

7 years agoMerge pull request #3600 from poettering/fstab-generator-fixes
Martin Pitt [Sun, 26 Jun 2016 10:46:17 +0000 (12:46 +0200)] 
Merge pull request #3600 from poettering/fstab-generator-fixes

Fstab generator fixes

7 years agobasic/strv: use SWAP_TWO() macro (#3602)
0xAX [Sun, 26 Jun 2016 10:37:00 +0000 (13:37 +0300)] 
basic/strv: use SWAP_TWO() macro (#3602)

7 years agonspawn: fix uid patching logic (#3599)
Lennart Poettering [Sat, 25 Jun 2016 04:04:43 +0000 (06:04 +0200)] 
nspawn: fix uid patching logic (#3599)

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
7 years agobuild-sys: Add new libsystemd-shared private library 3516/head
Felipe Sateler [Sat, 25 Jun 2016 02:14:25 +0000 (22:14 -0400)] 
build-sys: Add new libsystemd-shared private library

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.

7 years agobuild-sys: do not recompile everything for libsystemd
Felipe Sateler [Sat, 25 Jun 2016 02:10:37 +0000 (22:10 -0400)] 
build-sys: do not recompile everything for libsystemd

7 years agofstab-generator: minor simplification 3600/head
Lennart Poettering [Fri, 24 Jun 2016 19:22:05 +0000 (21:22 +0200)] 
fstab-generator: minor simplification

7 years agofstab-generator: skip fsck for /usr on non-device file systems
Lennart Poettering [Fri, 24 Jun 2016 19:07:18 +0000 (21:07 +0200)] 
fstab-generator: skip fsck for /usr on non-device file systems

We do the same already for the root device, hence follow the scheme for /usr
too.

(Also add some explanatory comments.)

7 years agofstab-generator: don't skip /usr handling if root handling didn't work correctly
Lennart Poettering [Fri, 24 Jun 2016 19:04:48 +0000 (21:04 +0200)] 
fstab-generator: don't skip /usr handling if root handling didn't work correctly

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
7 years agosystemctl: fix an error condition from "-1" to something meaningful
Lennart Poettering [Fri, 24 Jun 2016 19:03:47 +0000 (21:03 +0200)] 
systemctl: fix an error condition from "-1" to something meaningful

We really shouldn't make up errors like "-1", but use proper errno definitions.

7 years agofstab-generator: fix checking of fstab_node_to_udev_node() result
Lennart Poettering [Fri, 24 Jun 2016 19:01:22 +0000 (21:01 +0200)] 
fstab-generator: fix checking of fstab_node_to_udev_node() result

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.)

7 years agofstab-generator: document why we copy the root device into the usr device if unset
Lennart Poettering [Fri, 24 Jun 2016 19:00:11 +0000 (21:00 +0200)] 
fstab-generator: document why we copy the root device into the usr device if unset

Let's a comment about this, to avoid questions popping up like in #2344.

7 years agofstab-generator: let's use path_equal() for comparing paths
Lennart Poettering [Fri, 24 Jun 2016 18:59:51 +0000 (20:59 +0200)] 
fstab-generator: let's use path_equal() for comparing paths

7 years agoMerge pull request #3587 from martinpitt/master
Evgeny Vereshchagin [Fri, 24 Jun 2016 16:44:18 +0000 (19:44 +0300)] 
Merge pull request #3587 from martinpitt/master

Fix some test issues

7 years agotest: merge check_nspawn() into run_nspawn() 3587/head
Martin Pitt [Fri, 24 Jun 2016 14:23:39 +0000 (16:23 +0200)] 
test: merge check_nspawn() into run_nspawn()

This makes nspawn tests symmetric with run_qemu() which also exits with 1 if
QEMU is not available.