systemd/.git
7 years agoMerge pull request #7844 from yuwata/bash-completion
Zbigniew Jędrzejewski-Szmek [Mon, 15 Jan 2018 09:51:29 +0000 (13:51 +0400)]
Merge pull request #7844 from yuwata/bash-completion

update bash completions

7 years agoMerge pull request #7855 from poettering/log-h-includes
Zbigniew Jędrzejewski-Szmek [Mon, 15 Jan 2018 09:43:09 +0000 (13:43 +0400)]
Merge pull request #7855 from poettering/log-h-includes

log.h #include cleanups

7 years agoMerge pull request #7871 from sourcejedi/log_mounts
Zbigniew Jędrzejewski-Szmek [Mon, 15 Jan 2018 09:34:06 +0000 (13:34 +0400)]
Merge pull request #7871 from sourcejedi/log_mounts

core: fix output (logging) for mount units (#7603)

7 years agoMerge pull request #7872 from mineo/coredumpctl-zsh-completion
Zbigniew Jędrzejewski-Szmek [Mon, 15 Jan 2018 09:28:14 +0000 (13:28 +0400)]
Merge pull request #7872 from mineo/coredumpctl-zsh-completion

Fix the ZSH completion on `coredumpctl gdb <tab>`

7 years agocore: prevent spurious retries of umount
Alan Jenkins [Sat, 13 Jan 2018 17:22:46 +0000 (17:22 +0000)]
core: prevent spurious retries of umount

Testing the previous commit with `systemctl stop tmp.mount` logged the
reason for failure as expected, but unexpectedly the message was repeated
32 times.

The retry is a special case for umount; it is only supposed to cover the
case where the umount command was _successful_, but there was still some
remaining mount(s) underneath.  Fix it by making sure to test the first
condition :).

Re-tested with and without a preceding `mount --bind /mnt /tmp`,
and using `findmnt` to check the end result.

7 years agozsh/coredumpctl: Never sort the completion candidates
Wieland Hoffmann [Sat, 13 Jan 2018 14:23:28 +0000 (15:23 +0100)]
zsh/coredumpctl: Never sort the completion candidates

That way, they're always sorted by date. I do not know how to make ZSH sort
them by PID through some option, but that doesn't seem very useful in the first
place.

7 years agozsh/coredumpctl: Fix the completion
Wieland Hoffmann [Sat, 13 Jan 2018 12:43:28 +0000 (13:43 +0100)]
zsh/coredumpctl: Fix the completion

An output from coredumpctl list is like

> TIME                            PID   UID   GID SIG COREFILE  EXE
> Sun 2016-05-29 18:44:03 CEST  14578  1000  1000   6 none      /tmp/pacaurtmp-wieland/python33/src/Python-3.3.6/python

  ^1  ^2         ^3       ^4    ^5

, but the previous sub() command turns that into

> TIMEPID   UID   GID SIG COREFILE  EXE
> Sun2016-05-29 18:44:03 CEST  14578  1000  1000   6 none      /tmp/pacaurtmp-wieland/python33/src/Python-3.3.6/python
  ^1            ^2       ^3    ^4     ^5

so the whole pipeline generated entries like

$UID:$DESCRIPTION

but that's not useful and probably not what was supposed to happen.

This now generates entries like

$PID:$DESCRIPTION

which make everything work.

Note that with this commmit, the completions will be sorted by PID by
ZSH.

7 years agocore: fix output (logging) for mount units (#7603)
Alan Jenkins [Sat, 13 Jan 2018 12:30:43 +0000 (12:30 +0000)]
core: fix output (logging) for mount units (#7603)

Documentation - systemd.exec - strongly implies mount units get logging.

It is safe for mounts to depend on systemd-journald.socket.  There is no
cyclic dependency generated.  This is because the root, -.mount, was
already deliberately set to EXEC_OUTPUT_NULL.  See comment in
mount_load_root_mount().  And /run is excluded from being a mount unit.

Nor does systemd-journald depend on /var.  It starts earlier, initially
logging to /run.

Tested before/after using `systemctl stop tmp.mount`.

7 years agodbus-execute: define bus_set_transient_errno() only if HAVE_SECCOMP (#7869)
0xAX [Fri, 12 Jan 2018 23:48:53 +0000 (00:48 +0100)]
dbus-execute: define bus_set_transient_errno() only if HAVE_SECCOMP (#7869)

in other way we will get a warning during build:

../src/core/dbus-util.h:55:13: warning: ‘bus_set_transient_errno’
defined but not used [-Wunused-function]

    int bus_set_transient_##function(

7 years agologin: avoid external process call
Max Harmathy [Fri, 12 Jan 2018 13:16:43 +0000 (14:16 +0100)]
login: avoid external process call

Use a shell builtin of posix shells insteaf of calling 'which'.
See also http://stackoverflow.com/a/677212

7 years agoprocess-util: make our freeze() routine do something useful
Michal Sekletar [Fri, 12 Jan 2018 12:05:48 +0000 (13:05 +0100)]
process-util: make our freeze() routine do something useful

When we crash we freeze() our-self (or possibly we reboot the machine if
that is configured). However, calling pause() is very unhelpful thing to
do. We should at least continue to do what init systems being doing
since 70's and that is reaping zombies. Otherwise zombies start to
accumulate on the system which is a very bad thing. As that can prevent
admin from taking manual steps to reboot the machine in somewhat
graceful manner (e.g. manually stopping services, unmounting data
volumes  and calling reboot -f).

Fixes #7783

7 years agoMerge pull request #7865 from fbuihuu/restore-termination-of-bus-connection-first
Lennart Poettering [Fri, 12 Jan 2018 16:24:56 +0000 (17:24 +0100)]
Merge pull request #7865 from fbuihuu/restore-termination-of-bus-connection-first

Restore termination of bus connection first

7 years agoComment the fact that some tools need to termintate their bus connect first
Franck Bui [Fri, 12 Jan 2018 15:20:36 +0000 (16:20 +0100)]
Comment the fact that some tools need to termintate their bus connect first

7 years agomount: make sure we terminate the bus connection first, and then close the pager
Franck Bui [Fri, 12 Jan 2018 15:11:46 +0000 (16:11 +0100)]
mount: make sure we terminate the bus connection first, and then close the pager

See cf647b69baee4c478d3909c327e3d917e1563f44 commit message for details.

7 years agoRevert "tree-wide: use _cleanup_(sd_bus_flush_close_unrefp) at various appropriate...
Franck Bui [Fri, 12 Jan 2018 15:09:21 +0000 (16:09 +0100)]
Revert "tree-wide: use  _cleanup_(sd_bus_flush_close_unrefp) at various appropriate places"

This reverts commit 0b3c84eb7da3a8c28ac248a68228f6a7edbb2e19.

The removal of _cleanup_() usages was done on purpose, see
cf647b69baee4c478d3909c327e3d917e1563f44.

Fixes: #3543

7 years agosupport LZMA concatenated files
Matthew Thode [Thu, 11 Jan 2018 16:48:43 +0000 (10:48 -0600)]
support LZMA concatenated files

The xz format supports concatenated files, images are sometimes created
and shipped with it to increase compression.

https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1742744 is
the source bug for this issue.

7 years agoMerge pull request #7851 from msekletar/dbus-error-logging
Lennart Poettering [Thu, 11 Jan 2018 22:37:04 +0000 (23:37 +0100)]
Merge pull request #7851 from msekletar/dbus-error-logging

dbus: propagate errors from bus_init_system() and bus_init_api()

7 years agobootctl: add newline after printf (#7856)
winnerman-pythian [Thu, 11 Jan 2018 17:01:57 +0000 (12:01 -0500)]
bootctl: add newline after printf (#7856)

Upon error condition, a newline is not printed, leading to the shell prompt jamming against this line.

7 years agoMerge pull request #7833 from keszybz/netdev-relaxed
Lennart Poettering [Thu, 11 Jan 2018 16:14:49 +0000 (17:14 +0100)]
Merge pull request #7833 from keszybz/netdev-relaxed

Avoid spurious warnings about unknown sections in .netdev files

7 years agoupdate TODO
Lennart Poettering [Thu, 11 Jan 2018 14:10:29 +0000 (15:10 +0100)]
update TODO

7 years agounit: log when we cannot add a watch on a specific PID
Lennart Poettering [Thu, 11 Jan 2018 14:07:14 +0000 (15:07 +0100)]
unit: log when we cannot add a watch on a specific PID

7 years agonetworkd: initcwn/initwnd use the right parsers
Susant Sahani [Tue, 2 Jan 2018 09:20:15 +0000 (14:50 +0530)]
networkd: initcwn/initwnd use the right parsers

Closes #7765

7 years agohwdb: Add accelerometer orientation entry for Asus TP300LA
Samuel Dionne-Riel [Wed, 27 Dec 2017 20:42:38 +0000 (15:42 -0500)]
hwdb: Add accelerometer orientation entry for Asus TP300LA

7 years agolog: assign the realm to a variable first in log_full_errno_realm()
Lennart Poettering [Thu, 11 Jan 2018 12:15:19 +0000 (13:15 +0100)]
log: assign the realm to a variable first in log_full_errno_realm()

Let's avoid duplicate evaluation (which might have side-effects) and
assign the realm to an internal variable first, as we need it twice.

7 years agolog: rework log_syntax_invalid_utf8() a bit
Lennart Poettering [Thu, 11 Jan 2018 12:13:02 +0000 (13:13 +0100)]
log: rework log_syntax_invalid_utf8() a bit

The macro used utf8.h functions without including that. Let's clean this
up, by moving that code inside of log.c.

Let's also make the call return -EINVAL in all cases. This is in line
with log_oom() which also returns a well-defined error code even though
it doesn#t take one.

7 years agolog: minor modernizations to log_received_signal()
Lennart Poettering [Thu, 11 Jan 2018 12:09:30 +0000 (13:09 +0100)]
log: minor modernizations to log_received_signal()

7 years agoUIDS-GIDS: document early on, that 32bit uids are a linux 2.4 thing
Lennart Poettering [Thu, 11 Jan 2018 12:08:57 +0000 (13:08 +0100)]
UIDS-GIDS: document early on, that 32bit uids are a linux 2.4 thing

7 years agotty-ask-password-agent: add (void) cast to mkdir/mkfifo calls we knowingly ignore
Lennart Poettering [Thu, 11 Jan 2018 12:08:18 +0000 (13:08 +0100)]
tty-ask-password-agent: add (void) cast to mkdir/mkfifo calls we knowingly ignore

7 years agolog: minimize includes in log.h
Lennart Poettering [Wed, 10 Jan 2018 23:39:12 +0000 (00:39 +0100)]
log: minimize includes in log.h

log.h really should only include the bare minimum of other headers, as
it is really pulled into pretty much everything else and already in
itself one of the most basic pieces of code we have.

Let's hence drop inclusion of:

1. sd-id128.h because it's entirely unneeded in current log.h
2. errno.h, dito.
3. sys/signalfd.h which we can replace by a simple struct forward
   declaration
4. process-util.h which was needed for getpid_cached() which we now hide
   in a funciton log_emergency_level() instead, which nicely abstracts
   the details away.
5. sys/socket.h which was needed for struct iovec, but a simple struct
   forward declaration suffices for that too.

Ultimately this actually makes our source tree larger (since users of
the functionality above must now include it themselves, log.h won't do
that for them), but I think it helps to untangle our web of includes a
tiny bit.

(Background: I'd like to isolate the generic bits of src/basic/ enough
so that we can do a git submodule import into casync for it)

7 years agosd-bus: drop bloom stuff, it's not needed anymore since kdbus is gone
Lennart Poettering [Wed, 10 Jan 2018 23:28:49 +0000 (00:28 +0100)]
sd-bus: drop bloom stuff, it's not needed anymore since kdbus is gone

7 years agodbus: propagate errors from bus_init_system() and bus_init_api()
Michal Sekletar [Wed, 10 Jan 2018 16:22:12 +0000 (17:22 +0100)]
dbus: propagate errors from bus_init_system() and bus_init_api()

The aim of this change is to make sure that we properly log about all
D-Bus connection problems. After all, we only ever attempt to get on the
bus if dbus-daemon is around, so any failure in the process should be
treated as an error.

bus_init_system() is only called from bus_init() and in
bus_init() we have a bool flag which governs whether we should attempt
to connect to the system bus or not.
Hence if we are in bus_init_system() then it is clear we got called from
a context where connection to the bus is actually required and therefore
shouldn't be treated as the "best effort" type of operation. Same
applies to bus_init_api().

We make use of those error codes in bus_init() and log high level
message that informs admin about what is going on (and is easy to spot
and makes sense to an end user).

Also "retrying later" bit is actually a lie. We won't retry unless we
are explicitly told to reconnect via SIGUSR1 or re-executed. This is
because bus_init() is always called from the context where dbus-daemon
is already around and hence bus_init() won't be called again from
unit_notify().

Fixes #7782

7 years agobus-socket: slight simplification in bus_get_peercred()
Zbigniew Jędrzejewski-Szmek [Thu, 4 Jan 2018 14:28:57 +0000 (15:28 +0100)]
bus-socket: slight simplification in bus_get_peercred()

7 years agonetdev: use "relaxed" parsing
Zbigniew Jędrzejewski-Szmek [Tue, 9 Jan 2018 13:32:44 +0000 (14:32 +0100)]
netdev: use "relaxed" parsing

We parse each netdev file twice: once to determine the type and match conditions,
and then the second time properly. In bcde742e78ac3b8e8ea348cfb022c820c11800e2
the flags for the first parsing were (inadvertently I assume) were changed to
emit warnings. But this first pass is called with only [Match] and [NetDev] sections,
so we'd get warnings about all other section types. The obvious solution would be
to remove CONFIG_PARSE_WARN again, but I think it's better to keep the warnings
and set CONFIG_PARSE_RELAXED: we do want to get warnings about malformed lines and
such, and _RELAXED is enough to kill warnings about unknown sections.

7 years agoresolved.service: set DefaultDependencies=no
Dimitri John Ledkov [Mon, 11 Dec 2017 18:27:49 +0000 (18:27 +0000)]
resolved.service: set DefaultDependencies=no

On systems that only use resolved for name resolution, there are usecases that
require resolved to be started before sysinit target, such that network name
resolution is available before network-online/sysinit targets. For example,
cloud-init for some datasources hooks into the boot process ahead of sysinit
target and may need network name resolution at that point already.

systemd-resolved already starts pretty early in the process, thus starting it
slightly earlier should not have negative side effects.

However, this depends on resolved ability to connect to system DBus once that
is up.

7 years agoFix Mount Matrix for Chuwi HiBook
Split7fire [Sun, 24 Dec 2017 14:20:07 +0000 (21:20 +0700)]
Fix Mount Matrix for Chuwi HiBook

7 years agohwdb: Add accelerometer orientation entry for Chuwi Hi10 Pro
Samuel Dionne-Riel [Wed, 27 Dec 2017 22:49:14 +0000 (17:49 -0500)]
hwdb: Add accelerometer orientation entry for Chuwi Hi10 Pro

7 years agotest-dnssec: Allow builds without libgcrypt (#7850) (#7850)
Michal Koutný [Thu, 11 Jan 2018 11:28:32 +0000 (12:28 +0100)]
test-dnssec: Allow builds without libgcrypt (#7850) (#7850)

Fixes: #7845

7 years agoIntegration of Travis CI and Coverity Scan Analysis (#7691)
Marek Čermák [Thu, 11 Jan 2018 10:41:35 +0000 (11:41 +0100)]
Integration of Travis CI and Coverity Scan Analysis (#7691)

- Coverity scan analysis tasks run as scheduled cron jobs

- Stage separation for Build, Test and Coverity scan phase
- Travis CI now uses Fedora container to build and run tests

- Containers are accessible from Docker Hub and failed builds
  can be reproduced and examined

- coverity.sh: separate build and upload

7 years agotmpfiles: consider /etc uninitialized also when /etc/machine-id is present but empty...
Franck Bui [Wed, 10 Jan 2018 22:28:44 +0000 (23:28 +0100)]
tmpfiles: consider /etc uninitialized also when /etc/machine-id is present but empty (#7849)

7 years agoMerge pull request #7846 from poettering/nobody-getenv
Zbigniew Jędrzejewski-Szmek [Wed, 10 Jan 2018 19:18:51 +0000 (20:18 +0100)]
Merge pull request #7846 from poettering/nobody-getenv

some assorted fixes and additions, in particular a way to turn off "nobody" synthesizing on a specific system

7 years agosd-netlink: let's make things compile on certain old glibc's and kernel headers again...
Lennart Poettering [Wed, 10 Jan 2018 19:08:18 +0000 (20:08 +0100)]
sd-netlink: let's make things compile on certain old glibc's and kernel headers again (#7848)

Let's include netinet/in.h instead of linux/in6.h, as the former is the
official libc location for these definitions, and the latter is a
linux-specific version that conflicts.

This hopefully makes systemd compile on current Semaphore again.

This takes e410b07d2aa64a653bc0e93b77856af41297b84d into consideration,
but makes us use glibc rather than kernel headers.

While we are at it, let's also sort our #include lines. Since kernel
headers are notoriously crappy we won't strictly order them globally,
but first include non-kernel headers in a sorted way, and then include
kernel headers in a somewhat sorted way (i.e. generic stuff first and
somewhat alphabetical, and specific stuff last)

7 years agoshutdown: make kill timeout configurable (#7835)
Jan Klötzke [Wed, 10 Jan 2018 18:00:20 +0000 (19:00 +0100)]
shutdown: make kill timeout configurable (#7835)

By default systemd-shutdown will wait for 90s after SIGTERM was sent
for all processes to exit. This is way too long and effectively defeats
an emergency watchdog reboot via "reboot-force" actions. Instead now
use DefaultTimeoutStopSec which is configurable.

7 years agoMerge pull request #7843 from hbakken/work/old-kernel-support
Lennart Poettering [Wed, 10 Jan 2018 17:59:14 +0000 (18:59 +0100)]
Merge pull request #7843 from hbakken/work/old-kernel-support

Work/old kernel support

7 years agoutil: minor tweaks to disable_core_dumps()
Lennart Poettering [Wed, 10 Jan 2018 17:37:54 +0000 (18:37 +0100)]
util: minor tweaks to disable_core_dumps()

First, let's rename it to disable_coredumps(), as in the rest of our
codebase we spell it "coredump" rather than "core_dump", so let's stick
to that.

However, also log about failures to turn off core dumpling on LOG_DEBUG,
because debug logging is always a good idea.

7 years agomanager: rework manager_clean_environment()
Lennart Poettering [Wed, 10 Jan 2018 17:28:42 +0000 (18:28 +0100)]
manager: rework manager_clean_environment()

Let's rename it manager_sanitize_environment() which is a more precise
name. Moreover, sort the environment implicitly inside it, as all our
callers do that anyway afterwards and we can save some code this way.

Also, update the list of env vars to drop, i.e. the env vars we manage
ourselves and don't want user code to interfear with. Also sort this
list to make it easier to update later on.

7 years agonss-systemd,user-util: add a way how synthesizing "nobody" can be turned off
Lennart Poettering [Wed, 10 Jan 2018 17:26:03 +0000 (18:26 +0100)]
nss-systemd,user-util: add a way how synthesizing "nobody" can be turned off

This is quite ugly, but provides us with an avenue for moving
distributions to define the "nobody" user properly without breaking legacy
systems that us the name for other stuff.

The idea is basically, that the distribution adopts the new definition
of "nobody" (and thus recompiles systemd with it) and then touches
/etc/systemd/dont-synthesize-nobody on legacy systems to turn off
possibly conflicting synthesizing of the nobody name by systemd.

7 years agotmpfiles: modernize load_unix_sockets() a bit
Lennart Poettering [Wed, 10 Jan 2018 16:28:03 +0000 (17:28 +0100)]
tmpfiles: modernize load_unix_sockets() a bit

Let's log in case of error.

Let's use read_line() instead of a fixed-size buffer

Let's make use of set_free_free()'s return value.

7 years agoutil-lib: save/restore errno in cleanup calls
Lennart Poettering [Wed, 10 Jan 2018 16:21:15 +0000 (17:21 +0100)]
util-lib: save/restore errno in cleanup calls

We should be careful with errno in cleanup functions, and not alter it
under any circumstances. In the safe_close cleanup handlers we are
already safe in that regard, but let's add similar protections on other
cleanup handlers that invoke system calls.

Why bother? Cleanup handlers insert code at function return in
non-obvious ways. Hence, code that sets errno and returns should not be
confused by us overrding the errno from a cleanup handler.

This is a paranoia fix only, I am not aware where this actually mattered
in real-life situations.

7 years agococci: use strempty() at more places
Lennart Poettering [Wed, 10 Jan 2018 16:11:19 +0000 (17:11 +0100)]
cocci: use strempty() at more places

This shortens the code by a few lines.

7 years agobash-completion: timedatectl: suggests hostname and machine name
Yu Watanabe [Wed, 10 Jan 2018 14:03:26 +0000 (23:03 +0900)]
bash-completion: timedatectl: suggests hostname and machine name

7 years agobash-completion: run: add missing options
Yu Watanabe [Wed, 10 Jan 2018 13:55:39 +0000 (22:55 +0900)]
bash-completion: run: add missing options

7 years agoman: run: add missing option
Yu Watanabe [Wed, 10 Jan 2018 13:55:23 +0000 (22:55 +0900)]
man: run: add missing option

7 years agobash-completion: resolve: add missing options
Yu Watanabe [Wed, 10 Jan 2018 13:39:04 +0000 (22:39 +0900)]
bash-completion: resolve: add missing options

7 years agobash-completion: nspawn: add missing options
Yu Watanabe [Wed, 10 Jan 2018 14:20:45 +0000 (23:20 +0900)]
bash-completion: nspawn: add missing options

7 years agoman: nspawn: add missing option
Yu Watanabe [Wed, 10 Jan 2018 14:20:20 +0000 (23:20 +0900)]
man: nspawn: add missing option

7 years agobash-completion: detect-virt: add missing option
Yu Watanabe [Wed, 10 Jan 2018 12:56:07 +0000 (21:56 +0900)]
bash-completion: detect-virt: add missing option

7 years agobash-completion: cgls: suggests units
Yu Watanabe [Wed, 10 Jan 2018 12:47:08 +0000 (21:47 +0900)]
bash-completion: cgls: suggests units

7 years agobash-completion: analyze: add missing options and verbs
Yu Watanabe [Wed, 10 Jan 2018 09:21:35 +0000 (18:21 +0900)]
bash-completion: analyze: add missing options and verbs

7 years agobash-completion: systemctl: add missing options and verbs
Yu Watanabe [Wed, 10 Jan 2018 09:10:05 +0000 (18:10 +0900)]
bash-completion: systemctl: add missing options and verbs

7 years agobash-completion: networkctl: 'list' and 'lldp' can take links
Yu Watanabe [Wed, 10 Jan 2018 08:36:34 +0000 (17:36 +0900)]
bash-completion: networkctl: 'list' and 'lldp' can take links

7 years agobash-completion: machinectl: add missing options and verbs
Yu Watanabe [Wed, 10 Jan 2018 08:31:06 +0000 (17:31 +0900)]
bash-completion: machinectl: add missing options and verbs

7 years agoman: machinectl: fix typo
Yu Watanabe [Wed, 10 Jan 2018 08:30:20 +0000 (17:30 +0900)]
man: machinectl: fix typo

7 years agobash-completion: loginctl: add missing options and verbs
Yu Watanabe [Wed, 10 Jan 2018 08:10:36 +0000 (17:10 +0900)]
bash-completion: loginctl: add missing options and verbs

7 years agobash-completion: localectl: add a missing option and verbs
Yu Watanabe [Wed, 10 Jan 2018 08:02:38 +0000 (17:02 +0900)]
bash-completion: localectl: add a missing option and verbs

7 years agobash-completion: kernel-install: update default path to kernel image
Yu Watanabe [Wed, 10 Jan 2018 07:52:27 +0000 (16:52 +0900)]
bash-completion: kernel-install: update default path to kernel image

7 years agobash-completion: journalctl add missing options
Yu Watanabe [Wed, 10 Jan 2018 07:35:25 +0000 (16:35 +0900)]
bash-completion: journalctl add missing options

Also, this deprecates '--this-boot' option.

7 years agobash-completion: hostnamectl: add a missing option
Yu Watanabe [Wed, 10 Jan 2018 07:01:58 +0000 (16:01 +0900)]
bash-completion: hostnamectl: add a missing option

7 years agobash-completion: coredumpctl: support more options
Yu Watanabe [Wed, 10 Jan 2018 14:15:21 +0000 (23:15 +0900)]
bash-completion: coredumpctl: support more options

7 years agoMerge pull request #7836 from jkloetzke/shutdown-no-coredumps
Lennart Poettering [Wed, 10 Jan 2018 14:15:07 +0000 (15:15 +0100)]
Merge pull request #7836 from jkloetzke/shutdown-no-coredumps

shutdown: prevent core dumps in final shutdown stage

7 years agoMerge pull request #7837 from yuwata/coverity-20170110
Lennart Poettering [Wed, 10 Jan 2018 14:13:07 +0000 (15:13 +0100)]
Merge pull request #7837 from yuwata/coverity-20170110

fix defects reported by Coverity Scan

7 years agobash-completion: busctl: support more options and verbs
Yu Watanabe [Wed, 10 Jan 2018 06:44:13 +0000 (15:44 +0900)]
bash-completion: busctl: support more options and verbs

7 years agobash-completion: bootctl: support more options and verbs
Yu Watanabe [Wed, 10 Jan 2018 06:34:30 +0000 (15:34 +0900)]
bash-completion: bootctl: support more options and verbs

7 years agotimesync: fix typo
Yu Watanabe [Wed, 10 Jan 2018 02:27:15 +0000 (11:27 +0900)]
timesync: fix typo

7 years agoexec-util: cast to void when return value is ignored
Yu Watanabe [Wed, 10 Jan 2018 01:25:32 +0000 (10:25 +0900)]
exec-util: cast to void when return value is ignored

CID 1384262.

7 years agotest: free after use
Yu Watanabe [Wed, 10 Jan 2018 01:24:06 +0000 (10:24 +0900)]
test: free after use

CID 1384238.

7 years agoprocess-util: initialize block_signals
Yu Watanabe [Wed, 10 Jan 2018 01:22:35 +0000 (10:22 +0900)]
process-util: initialize block_signals

CID 1384240.

7 years agosd-radv: avoid redefinition of struct in6_addr
Hans-Christian Noren Egtvedt [Mon, 25 Sep 2017 14:39:32 +0000 (16:39 +0200)]
sd-radv: avoid redefinition of struct in6_addr

Both netinet/icmp6.h and linux/in6.h will define struct in6_addr, and in
user space we want to use the netinet/icmp6.h variant.

Fixes build problem:
In file included from src/libsystemd-network/sd-radv.c:23:0:
/home/hegtvedt/work/os/product/sunrise/root/_build/v2/include/linux/in6.h:30:8:
error: redefinition of 'struct in6_addr'

7 years agomissing: add bpf() define for ARM definition
Hans-Christian Noren Egtvedt [Wed, 11 Oct 2017 08:48:39 +0000 (10:48 +0200)]
missing: add bpf() define for ARM definition

7 years agotimesyncd: avoid signed/unsigned comparison (#7842)
Zbigniew Jędrzejewski-Szmek [Wed, 10 Jan 2018 10:35:00 +0000 (11:35 +0100)]
timesyncd: avoid signed/unsigned comparison (#7842)

be32toh() returns uint32_t, and m->trans_time.tv_nsec is defined as long in struct timespec.
Let's add a cast to avoid the warning.

Fixes #7789.

7 years agomissing: fix bpf() define for Tilera
Hans-Christian Noren Egtvedt [Tue, 17 Oct 2017 07:11:44 +0000 (09:11 +0200)]
missing: fix bpf() define for Tilera

__NR_bpf syscall uses the default generic value for Tilera, e.g. 280.

7 years agoshutdown: prevent core dumps in final shutdown stage
Jan Klötzke [Mon, 23 Oct 2017 06:57:09 +0000 (08:57 +0200)]
shutdown: prevent core dumps in final shutdown stage

If the system is finally shutting down it makes no sense to write core
dumps as the last remaining processes are terminated / killed. This is
especially significant in case of a "force reboot" where all processes
are hit concurrently with a SIGTERM and no orderly shutdown of
processes takes place.

7 years agotree-wide: introduce disable_core_dumps helper and port existing users
Jan Klötzke [Wed, 10 Jan 2018 09:36:14 +0000 (10:36 +0100)]
tree-wide: introduce disable_core_dumps helper and port existing users

Changes the core_pattern to prevent any core dumps by the kernel. Does
nothing if we're in a container environment as this is system wide
setting.

7 years agohwdb: Add workaround for backslash hardware issue in Purism Librem 13 V2 (#7826)
Ewout van Mansom [Tue, 9 Jan 2018 15:42:54 +0000 (15:42 +0000)]
hwdb: Add workaround for backslash hardware issue in Purism Librem 13 V2 (#7826)

7 years agoMerge pull request #7191 from Mic92/systemd
Zbigniew Jędrzejewski-Szmek [Tue, 9 Jan 2018 13:01:05 +0000 (14:01 +0100)]
Merge pull request #7191 from Mic92/systemd

The change in netdev.c done in the merge is necessary to avoid crashing in
cleanup. This is a follow-up for f3c33b234d9f0256805722f02c7b4c4b59fd6de6.

7 years agonetworkd: add support for wireguard interface type
Jörg Thalheim [Mon, 18 Dec 2017 14:20:34 +0000 (15:20 +0100)]
networkd: add support for wireguard interface type

More information may be found at wireguard.com.

7 years agosd-netlink: add generic netlink support
Jörg Thalheim [Mon, 18 Dec 2017 14:17:06 +0000 (15:17 +0100)]
sd-netlink: add generic netlink support

This also adds the ability to incorporate arrays into netlink messages
and to determine when a netlink message is too big, used by some generic
netlink protocols.

7 years agonetworkd: call link_set_routing_policy_rule before setting routes (#7815)
Susant Sahani [Tue, 9 Jan 2018 08:13:06 +0000 (13:43 +0530)]
networkd: call link_set_routing_policy_rule before setting routes (#7815)

commit 7715629 (networkd: Fix race condition in [RoutingPolicyRule] handling (#7615)).
Does not fix race. Still there is a race in case of bride because the
bride goes down and up .

calling route_configure then link_set_routing_policy_rule and the
link_check_ready makes a race between routing_policy_rule_messages and route_messages.
While bride comes up and we call the call again route_configure if finds
it self in the callback function LINK_STATE_CONFIGURED networkd dies.
Let's handle first routing policy rules then route_configure. This fixes
the crash.
Closes #7797

7 years agoMerge pull request #7740 from yuwata/fix-7676
Lennart Poettering [Mon, 8 Jan 2018 14:15:57 +0000 (15:15 +0100)]
Merge pull request #7740 from yuwata/fix-7676

 sd-device: support the case that /sys is a symlink

7 years agohwdb: add touchpad override for Asus F3Sg
Peter Hutterer [Mon, 8 Jan 2018 05:26:21 +0000 (15:26 +1000)]
hwdb: add touchpad override for Asus F3Sg

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

7 years agorules: Mark the kvm device as static_node (for s390x and ppc64) (#7795)
Thomas Huth [Mon, 8 Jan 2018 09:49:15 +0000 (10:49 +0100)]
rules: Mark the kvm device as static_node (for s390x and ppc64) (#7795)

On s390x and ppc64, the permissions of the /dev/kvm device are currently
not right as long as the kvm kernel module has not been loaded yet. The
kernel module is using MODULE_ALIAS("devname:kvm") there, so the module
will be loaded on the first access to /dev/kvm. In that case, udev needs
to apply the permission to the static node already (which was created via
devtmpfs), i.e. we have to specify the option "static_node=kvm" in the
udev rule.

Note that on x86, the kvm kernel modules are loaded early instead (via the
MODULE_DEVICE_TABLE(x86cpu, ...) feature checking), so that the right module
is loaded for the Intel or AMD hypervisor extensions right from the start.
Thus the "static_node=kvm" is not required on x86 - but it also should not
hurt here (and using it here even might be more future proof in case the
module loading is also done delayed there one day), so we just add the new
option to the rule here unconditionally.

7 years agosd-device: support the case that /sys is a symlink
Yu Watanabe [Sun, 7 Jan 2018 16:36:08 +0000 (01:36 +0900)]
sd-device: support the case that /sys is a symlink

When /sys is a symlink to the sysfs mountpoint, e.g. /path/to/sysfs.
Then, device->syspath was set to like /path/to/sysfs/devices/foo/baz.
This converts the path to /sys/devices/foo/baz.

Fixes #7676.

7 years agosd-device: use chase_symlinks()
Yu Watanabe [Sun, 7 Jan 2018 16:35:44 +0000 (01:35 +0900)]
sd-device: use chase_symlinks()

7 years agoMerge pull request #7714 from poettering/sd-bus-watch-connect
Zbigniew Jędrzejewski-Szmek [Fri, 5 Jan 2018 18:46:38 +0000 (19:46 +0100)]
Merge pull request #7714 from poettering/sd-bus-watch-connect

many sd-bus improvements

7 years agocore: Fix edge case when processing /proc/self/mountinfo (#7811)
rkolchmeyer [Fri, 5 Jan 2018 18:28:23 +0000 (10:28 -0800)]
core: Fix edge case when processing /proc/self/mountinfo (#7811)

Currently, if there are two /proc/self/mountinfo entries with the same
mount point path, the mount setup flags computed for the second of
these two entries will overwrite the mount setup flags computed for
the first of these two entries. This is the root cause of issue #7798.
This patch changes mount_setup_existing_unit to prevent the
just_mounted mount setup flag from being overwritten if it is set to
true. This will allow all mount units created from /proc/self/mountinfo
entries to be initialized properly.

Fixes: #7798

7 years agonetworkd: fix memory corruption
Lennart Poettering [Thu, 4 Jan 2018 10:36:58 +0000 (11:36 +0100)]
networkd: fix memory corruption

When loading .netdev files we parse them twice: first we do one parsing
iteration to figure out their "kind", and then we do it again to parse
out the kind's parameters. The first iteration is run with a "short"
NetDev structure, that only covers the generic NetDev properties. Which
should be enough, as we don't parse the per-kind properties. However,
before this patch we'd still try to destruct the per-kind properties
which resulted in memory corruption. With this change we distuingish the
two iterations by the state field, so that the destruction only happens
when the state signals we are running with a full NetDev structure.

Since this is not obvious, let's add a lot of comments.

7 years agologind: fix user_object_find()
Lennart Poettering [Thu, 4 Jan 2018 10:36:35 +0000 (11:36 +0100)]
logind: fix user_object_find()

The logic was completely borked since
e4d2984bf8514ab576a66d5ac1f1cde746bb32a3, correct that.

CID #1384234

7 years agoupdate TODO
Lennart Poettering [Wed, 20 Dec 2017 18:48:23 +0000 (19:48 +0100)]
update TODO

7 years agoman: document all the new APIs we added
Lennart Poettering [Wed, 20 Dec 2017 15:31:58 +0000 (16:31 +0100)]
man: document all the new APIs we added

7 years agomeson: resurrect API documentation target
Lennart Poettering [Wed, 20 Dec 2017 11:51:14 +0000 (12:51 +0100)]
meson: resurrect API documentation target

We had this functionality back in Automake times, let's resurrect it.

7 years agosd-bus: remove 'hint_sync_call' parameter from various function calls
Lennart Poettering [Wed, 20 Dec 2017 18:48:39 +0000 (19:48 +0100)]
sd-bus: remove 'hint_sync_call' parameter from various function calls

This is unused since kdbus is gone, hence remove this too. This permits
us to get rid of sd_bus_send_internal() and just implement sd_bus_send()
directly.