Lennart Poettering [Wed, 20 Jul 2016 11:39:23 +0000 (13:39 +0200)]
core: make sure RequestStop signal is send directed
This was accidentally left commented out for debugging purposes, let's fix that
and make the signal directed again.
Lennart Poettering [Wed, 20 Jul 2016 09:16:53 +0000 (11:16 +0200)]
cgroup: suppress sending follow-up SIGCONT after sending SIGCONT/SIGKILL anyway
Lennart Poettering [Wed, 20 Jul 2016 09:16:05 +0000 (11:16 +0200)]
core: when forcibly killing/aborting left-over unit processes log about it
Let's lot at LOG_NOTICE about any processes that we are going to
SIGKILL/SIGABRT because clean termination of them didn't work.
This turns the various boolean flag parameters to cg_kill(), cg_migrate() and
related calls into a single binary flags parameter, simply because the function
now gained even more parameters and the parameter listed shouldn't get too
long.
Logging for killing processes is done either when the kill signal is SIGABRT or
SIGKILL, or on explicit request if KILL_TERMINATE_AND_LOG instead of LOG_TERMINATE
is passed. This isn't used yet in this patch, but is made use of in a later
patch.
Lennart Poettering [Wed, 20 Jul 2016 09:14:48 +0000 (11:14 +0200)]
util: don't send SIGCONT following a SIGCONT or SIGKILL in kill_and_sigcont()
Lennart Poettering [Wed, 20 Jul 2016 09:14:18 +0000 (11:14 +0200)]
logind: minor coding style improvements
mulkieran [Wed, 20 Jul 2016 03:15:22 +0000 (23:15 -0400)]
man: revise entry about specifying a file path (#3739)
* Specifying a device node has an effect much larger than a simple shortcut
for a field/value match, so the original sentence is no longer a good way
to start the paragraph.
* Specifying a device node causes matches to be generated for all ancestor
devices of the device specified, not just its parents.
* Indicates that the path must be absolute, but that it may be a link.
* Eliminates a few typos.
Zbigniew Jędrzejewski-Szmek [Tue, 19 Jul 2016 19:24:23 +0000 (15:24 -0400)]
man: mention that locale changes might require initramfs to be rebuilt (#3754)
https://bugzilla.redhat.com/show_bug.cgi?id=1151651
Also explain what localectl does a bit better:
https://bugzilla.redhat.com/show_bug.cgi?id=1357861
Lennart Poettering [Tue, 19 Jul 2016 19:17:49 +0000 (21:17 +0200)]
Merge pull request #3685 from kinvolk/alessandro/inaccessible-paths
namespace: unify limit behavior on non-directory paths
Evgeny Vereshchagin [Tue, 19 Jul 2016 18:11:41 +0000 (21:11 +0300)]
Merge pull request #3636 from poettering/logs-show-utf8
improve handling of trailing newline in journal logging
Lennart Poettering [Tue, 19 Jul 2016 12:27:05 +0000 (14:27 +0200)]
sd-journal: suppress empty lines
Let's make sure our logging APIs is in sync with how stdout/stderr logging
works.
Alessandro Puccetti [Thu, 7 Jul 2016 09:17:00 +0000 (11:17 +0200)]
doc,core: Read{Write,Only}Paths= and InaccessiblePaths=
This patch renames Read{Write,Only}Directories= and InaccessibleDirectories=
to Read{Write,Only}Paths= and InaccessiblePaths=, previous names are kept
as aliases but they are not advertised in the documentation.
Renamed variables:
`read_write_dirs` --> `read_write_paths`
`read_only_dirs` --> `read_only_paths`
`inaccessible_dirs` --> `inaccessible_paths`
Alessandro Puccetti [Wed, 6 Jul 2016 07:48:58 +0000 (09:48 +0200)]
namespace: unify limit behavior on non-directory paths
Despite the name, `Read{Write,Only}Directories=` already allows for
regular file paths to be masked. This commit adds the same behavior
to `InaccessibleDirectories=` and makes it explicit in the doc.
This patch introduces `/run/systemd/inaccessible/{reg,dir,chr,blk,fifo,sock}`
{dile,device}nodes and mounts on the appropriate one the paths specified
in `InacessibleDirectories=`.
Based on Luca's patch from https://github.com/systemd/systemd/pull/3327
Lennart Poettering [Sat, 2 Jul 2016 00:10:26 +0000 (17:10 -0700)]
man: document that sd_journal_print() strips trailing whitespace
Lennart Poettering [Fri, 1 Jul 2016 00:41:19 +0000 (17:41 -0700)]
journalctl: make sure that journalctl's --all switch also has an effect on json output
With this change, binary record data is formatted as string if --all is
specified when using json output. This is inline with the effect of --all on
the other available output modes.
Fixes: #3416
Lennart Poettering [Fri, 1 Jul 2016 00:37:21 +0000 (17:37 -0700)]
sd-journal: when formatting log messages, implicitly strip trailing whitespace
When converting log messages from human readable text into binary records to
send off to journald in sd_journal_print(), strip trailing whitespace in the
log message. This way, handling of logs made via syslog(), stdout/stderr and
sd_journal_print() are treated the same way: trailing (but not leading)
whitespace is automatically removed, in particular \n and \r. Note that in case
of syslog() and stdout/stderr based logging the stripping takes place
server-side though, while for the native protocol based transport this takes
place client-side. This is because in the former cases conversion from
free-form human-readable strings into structured, binary log records takes
place on the server-side while for journal-native logging it happens on the
client side, and after conversion into binary records we probably shouldn't
alter the data anymore.
See: #3416
Lennart Poettering [Tue, 19 Jul 2016 10:30:34 +0000 (12:30 +0200)]
mkosi: make sure we fail on error
Harald Hoyer [Tue, 19 Jul 2016 10:10:09 +0000 (12:10 +0200)]
kernel-install: recognize /boot/efi mountpoint (#3751)
install everything in /boot/efi, if this is a mountpoint
Atrotors [Tue, 19 Jul 2016 09:43:15 +0000 (19:43 +1000)]
update 60-evdev to include rules for ASUS UX305 touchpad (#3698)
Zbigniew Jędrzejewski-Szmek [Mon, 18 Jul 2016 23:03:08 +0000 (19:03 -0400)]
Merge pull request #3749 from phomes/trivial-fixes3
Trivial fixes3
Thomas Hindoe Paaboel Andersen [Mon, 18 Jul 2016 20:42:09 +0000 (22:42 +0200)]
resolved: replace bitwise and with logical and
Thomas Hindoe Paaboel Andersen [Mon, 18 Jul 2016 20:31:34 +0000 (22:31 +0200)]
treewide: remove unused variables
Thomas Hindoe Paaboel Andersen [Mon, 18 Jul 2016 20:14:23 +0000 (22:14 +0200)]
basic: fix whitespace
Thomas Hindoe Paaboel Andersen [Mon, 18 Jul 2016 20:09:57 +0000 (22:09 +0200)]
network: fix indentation
Jan Janssen [Mon, 18 Jul 2016 19:19:32 +0000 (21:19 +0200)]
sd-boot: Fix waiting for keyboard input (#3735)
WaitForKeyEx may never return on some UEFI systems depending
on firmware, hardware configuration and the phase of the moon.
Use ConIn->WaitForKey unconditionally instead.
Fixes #3632
Marcel Holtmann [Mon, 18 Jul 2016 12:56:46 +0000 (14:56 +0200)]
hwdb: Update database of Bluetooth company identifiers
tblume [Mon, 18 Jul 2016 10:23:08 +0000 (12:23 +0200)]
nspawn: decrease mkdir error logging in /sys to debug priority (#3748)
Such mkdir errors happen for example when trying to mkdir /sys/fs/selinux.
/sys is documented to be readonly in the container, so mkdir errors below /sys
can be expected.
They shouldn't be logged as warnings since they lead users to think that
there is something wrong.
Lennart Poettering [Mon, 18 Jul 2016 09:12:47 +0000 (11:12 +0200)]
Merge pull request #3745 from keszybz/fix-make-nulstr-confusion
Fix make nulstr confusion
Daniel Mack [Mon, 18 Jul 2016 07:54:06 +0000 (09:54 +0200)]
Merge pull request #3746 from keszybz/trivial-fixes
Trivial fixes
Zbigniew Jędrzejewski-Szmek [Tue, 28 Jun 2016 19:12:01 +0000 (15:12 -0400)]
Drop parentheses in two places
Zbigniew Jędrzejewski-Szmek [Tue, 28 Jun 2016 17:55:58 +0000 (13:55 -0400)]
systemd-resolve: remove spurious newline with no global settings
Zbigniew Jędrzejewski-Szmek [Tue, 28 Jun 2016 17:51:30 +0000 (13:51 -0400)]
systemd-resolve: use plural "DNS Servers"
Usually multiple DNS servers are configured, and it looks strange to have
singular in the heading.
Zbigniew Jędrzejewski-Szmek [Sun, 17 Jul 2016 19:25:01 +0000 (15:25 -0400)]
basic/strv: add an extra NUL after strings in strv_make_nulstr
strv_make_nulstr was creating a nulstr which was not a valid nulstr,
because it was missing the terminating NUL. This didn't cause any issues,
because strv_parse_nulstr correctly parsed the result, using the
separately specified length.
But it's confusing to have something called nulstr which really isn't.
It is likely that somebody will try to use strv_make_nulstr() in
some other place, incorrectly.
This patch changes strv_parse_nulstr() to produce a valid nulstr, and
changes the output length parameter to be the minimum number of bytes
which can be later on parsed by strv_parse_nulstr(). This allows the
only user in ask-password-api to be slightly simplified.
Based-on-patch-by: Jean-Sébastien Bour <jean-sebastien@bour.name>
Fixes #3689.
Jean-Sébastien Bour [Sat, 9 Jul 2016 00:38:00 +0000 (02:38 +0200)]
basic/strv: exhibit strv_make_nulstr missing final NUL char (systemd/systemd#3689)
Lukáš Nykrýn [Sat, 16 Jul 2016 19:04:13 +0000 (21:04 +0200)]
manager: don't skip sigchld handler for main and control pid for services (#3738)
During stop when service has one "regular" pid one main pid and one
control pid and the sighld for the regular one is processed first the
unit_tidy_watch_pids will skip the main and control pid and does not
remove them from u->pids(). But then we skip the sigchld event because we
already did one in the iteration and there are two pids in u->pids.
v2: Use general unit_main_pid() and unit_control_pid() instead of
reaching directly to service structure.
Michael Biebl [Sat, 16 Jul 2016 16:51:45 +0000 (18:51 +0200)]
man: mention system-shutdown hook directory in synopsis (#3741)
The distinction between systemd-shutdown the binary vs system-shutdown
the hook directory (without the 'd') is not immediately obvious and can
be quite confusing if you are looking for a directory which doesn't exist.
Therefore explicitly mention the hook directory in the synopsis with a
trailing slash to make it clearer which is which.
Zbigniew Jędrzejewski-Szmek [Sat, 16 Jul 2016 15:09:25 +0000 (11:09 -0400)]
man: replace dash with mdash where appropriate
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
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.
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.
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.
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.
ntzrmtthihu777 [Fri, 15 Jul 2016 08:59:45 +0000 (03:59 -0500)]
zsh-completion: fix option ordering in set-x11-keymap (#3646)
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.
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
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.
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
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>
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
Valentin Vidić [Thu, 14 Jul 2016 05:34:36 +0000 (07:34 +0200)]
basic/mount-util: recognize ocfs2 as network fs (#3713)
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.
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.
Michael Biebl [Tue, 12 Jul 2016 10:52:11 +0000 (12:52 +0200)]
Various fixes for typos found by lintian (#3705)
Jakub Wilk [Tue, 12 Jul 2016 09:58:14 +0000 (11:58 +0200)]
man: fix indefinite articles (#3694)
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.
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
Torstein Husebø [Sun, 10 Jul 2016 12:48:23 +0000 (14:48 +0200)]
treewide: fix typos and remove accidental repetition of words
Ivan Shapovalov [Fri, 8 Jul 2016 19:08:07 +0000 (23:08 +0400)]
man: improve wording for calendar spec's repetition values (#3687)
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
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.
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.
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)
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.
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.
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.
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.
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.
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.
Marcel Holtmann [Tue, 5 Jul 2016 19:13:32 +0000 (21:13 +0200)]
hwdb: Update database of Bluetooth company identifiers
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
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
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.
Torstein Husebø [Fri, 24 Jun 2016 13:32:57 +0000 (15:32 +0200)]
man: add link to sd_bus_add_match to busctl.xml
Torstein Husebø [Thu, 12 May 2016 09:23:35 +0000 (11:23 +0200)]
treewide: fix typos
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==
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
Felipe Sateler [Sun, 3 Jul 2016 22:56:54 +0000 (18:56 -0400)]
tests: Install missing libraries for things installed in /usr too
Felipe Sateler [Sun, 3 Jul 2016 22:32:48 +0000 (18:32 -0400)]
build-sys: link test-keymap-util against libsystemd-shared
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
Felipe Sateler [Sun, 3 Jul 2016 15:17:13 +0000 (11:17 -0400)]
tests: follow RUNPATH when installing missing libraries
Fixes #3630
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
Alexander Kuleshov [Sat, 2 Jul 2016 17:42:01 +0000 (23:42 +0600)]
treewide: use 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.
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
0xAX [Sat, 2 Jul 2016 15:17:26 +0000 (18:17 +0300)]
sd-resolve: use close_many() (#3643)
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.
Douglas Christman [Fri, 1 Jul 2016 00:16:05 +0000 (20:16 -0400)]
calendarspec: allow ranges in date and time specifications
Resolves #3042
Lennart Poettering [Sat, 2 Jul 2016 01:39:26 +0000 (18:39 -0700)]
update TODO
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.
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.
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
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
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
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
Lukas Lösche [Thu, 30 Jun 2016 19:25:51 +0000 (21:25 +0200)]
man: minor typo "has already has happened" (#3635)
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)
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.
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
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
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)
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.