]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
6 years agonetworkd: add support to configure IP Rule (#5725)
Susant Sahani [Thu, 14 Sep 2017 19:51:39 +0000 (19:51 +0000)] 
networkd: add support to configure IP Rule (#5725)

Routing Policy rule manipulates rules in the routing policy database control the
route selection algorithm.

This work supports to configure Rule
```
[RoutingPolicyRule]
TypeOfService=0x08
Table=7
From= 192.168.100.18

```

```
ip rule show
0: from all lookup local
0: from 192.168.100.18 tos 0x08 lookup 7
```

V2 changes:

1. Added logic to handle duplicate rules.
2. If rules are changed or deleted and networkd restarted
   then those are deleted when networkd restarts next time

V3:

1. Add parse_fwmark_fwmask

6 years agounits: don't kill the emergency shell when sysinit.target is triggered (#6765)
Alan Jenkins [Thu, 14 Sep 2017 19:43:43 +0000 (20:43 +0100)] 
units: don't kill the emergency shell when sysinit.target is triggered (#6765)

Why
---

The advantage of this is that starting sysinit.target from the emergency
shell will no longer kill the emergency shell and lock you out of the
system.  Our docs already claimed that emergency.target was useful for
"starting individual units in order to continue the boot process in steps".
This resolves #6509 for my purposes.

Remaining limitation
--------------------

Starting getty.target will still kill the shell, and if you don't have a
root password you will then be locked out at that point.  This is relevant
to distributions which patch the sulogin system to permit logins when the
root password is locked.  Both Debian and RedHat used to follow this
behaviour!  Debian have been discussing what they could replace it with at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=806852

So this doesn't quite achieve perfection, but I think it's a worthwhile
change.  It should be easier to understand the logic now it doesn't have
such a big hole in it.  Repairing the sysinit stage of the boot is the main
reason we have emergency.target.  And as discussed in the issue,
sysinit.target gets pulled in implicitly as soon as any DefaultDependencies
service is activated.

How
---

sysinit.target only needs to conflict with emergency.target.  It didn't
need to conflict with emergency.service as well.  In theory the conflicts
are pointless, we could just change the dependency of sysinit.target on
local-fs.target from Wants to Requires.  However, doing so would mean that
when local-fs fails, the screen is flooded with yellow [DEPEND] failures.
That would hinder the poor unfortunate admin, so let's not do that.

There is no additional ordering requirement against emergency.  If the
failure happens, the job for sysinit will be cancelled instantly.  We don't
need to worry about when sysinit.target and its dependents would be
stopped, because sysinit waits for local-fs before it starts.

emergency.target is still necessarily stopped once we reach sysinit
(you can't express a one-way conflict in pure unit directives).
This is largely cosmetic... though perhaps it symbolizes that you're no
longer in Emergency Mode if System Initialization is successful ;-).

As a secondary advantage, the getty's which conflict on rescue.service now
need to conflict on emergency.service as well.  This makes the system more
uniform and simpler to understand.

The only other effect this should have is that
`systemctl start emergency.target` is now practically the same as
`systemctl start rescue.target`.  The only units this command will stop are
the conflicting getty units.  Neither of those commands should ever be
used.  E.g. they will not stop the gdm.service unit on Fedora 26.

6 years agoMerge pull request #6801 from johnlinp/master
Lennart Poettering [Thu, 14 Sep 2017 19:41:13 +0000 (21:41 +0200)] 
Merge pull request #6801 from johnlinp/master

man: explicitly distinguish "implicit dependencies" and "default dependencies"

6 years agoMerge pull request #6826 from poettering/empty-list-conf
Zbigniew Jędrzejewski-Szmek [Thu, 14 Sep 2017 18:14:37 +0000 (20:14 +0200)] 
Merge pull request #6826 from poettering/empty-list-conf

don't unnecessarily create empty but allocated strv in config_parse_strv()

6 years agoshared: end string with % if one was found at the end of a expandible string (#6828)
Felipe Sateler [Thu, 14 Sep 2017 17:51:20 +0000 (14:51 -0300)] 
shared: end string with % if one was found at the end of a expandible string (#6828)

Current behavior is that %X where X is an unidentified specifier, then the result is
the same %X string. This was not the case when the string ended with a stray %, where
the character would have not been output. Lets add that missing character.

Fixes: #6374
6 years agoMerge pull request #6818 from poettering/nspawn-whitelist
Zbigniew Jędrzejewski-Szmek [Thu, 14 Sep 2017 17:47:59 +0000 (19:47 +0200)] 
Merge pull request #6818 from poettering/nspawn-whitelist

convert nspawn syscall blacklist into a whitelist (and related stuff)

6 years agoMerge pull request #6790 from poettering/unit-unsetenv
Zbigniew Jędrzejewski-Szmek [Thu, 14 Sep 2017 17:46:55 +0000 (19:46 +0200)] 
Merge pull request #6790 from poettering/unit-unsetenv

add UnsetEnvironment= unit file setting, in order to fix #6407

6 years agounits: set LockPersonality= for all our long-running services (#6819)
Lennart Poettering [Thu, 14 Sep 2017 17:45:40 +0000 (19:45 +0200)] 
units: set LockPersonality= for all our long-running services (#6819)

Let's lock things down. Also, using it is the only way how to properly
test this to the fullest extent.

6 years agoMerge pull request #6820 from keszybz/sysusers-doc-update
Lennart Poettering [Thu, 14 Sep 2017 17:12:51 +0000 (19:12 +0200)] 
Merge pull request #6820 from keszybz/sysusers-doc-update

Assorted updates to man pages

6 years agotimer: don't use persietent file timestamps from the future (#6823)
Lennart Poettering [Thu, 14 Sep 2017 16:26:10 +0000 (18:26 +0200)] 
timer: don't use persietent file timestamps from the future (#6823)

Also, use the mtime rather than the atime of the timestamp file. While
the atime is not completely wrong, the mtime appears more appropriate
as that's what we actually explicitly change, and is not effected by
mere reading.

Fixes: #6821
6 years agoconf-parser: when the empty string assigned to Personality= reset it 6826/head
Lennart Poettering [Thu, 14 Sep 2017 14:54:32 +0000 (16:54 +0200)] 
conf-parser: when the empty string assigned to Personality= reset it

Let's support assigning the empty string to reset things in one more
place.

6 years agocore: don't synthesize empty list when empty string is read in config_parse_strv()
Lennart Poettering [Thu, 14 Sep 2017 14:53:34 +0000 (16:53 +0200)] 
core: don't synthesize empty list when empty string is read in config_parse_strv()

This was added to make
https://bugs.freedesktop.org/show_bug.cgi?id=62558 work, which has long
been removed, hence let's revert to the original behaviour and fully
flush out the list when an empty string is assigned.

6 years agoMerge pull request #6746 from yuwata/parse-empty-string
Lennart Poettering [Thu, 14 Sep 2017 14:49:09 +0000 (16:49 +0200)] 
Merge pull request #6746 from yuwata/parse-empty-string

allow to input empty string to config_parse_xxx()

6 years agoman: minor correction for systemd-run 6818/head
Lennart Poettering [Thu, 14 Sep 2017 08:23:36 +0000 (10:23 +0200)] 
man: minor correction for systemd-run

The meaning was acidentally inverted in
156d6036be8c4d64747b5919adf372c289d3423a, let's correct this.

6 years agonspawn: replace syscall blacklist by a whitelist
Lennart Poettering [Thu, 14 Sep 2017 08:18:57 +0000 (10:18 +0200)] 
nspawn: replace syscall blacklist by a whitelist

Let's lock things down a bit, and maintain a list of what's permitted
rather than a list of what's prohibited in nspawn (also to make things a
bit more like Docker and friends).

Note that this slightly alters the effect of --system-call-filter=, as
now the negative list now takes precedence over the positive list.
However, given that the option is just a few days old and not included
in any released version it should be fine to change it at this point in
time.

Note that the whitelist is good chunk more restrictive thatn the
previous blacklist. Specifically:

- fanotify is not permitted (given the buffer size issues it's
  problematic in containers)
- nfsservctl is not permitted (NFS server support is not virtualized)
- pkey_xyz stuff is not permitted (really new stuff I don't grok)
- @cpu-emulation is prohibited (untested legacy stuff mostly, and if
  people really want to run dosemu in nspawn, they should use
  --system-call-filter=@cpu-emulation and all should be good)

6 years agoseccomp: improve debug logging
Lennart Poettering [Wed, 13 Sep 2017 17:57:32 +0000 (19:57 +0200)] 
seccomp: improve debug logging

Let's log explicitly at debug level if we encounter a syscall or group
that doesn#t exist at all.

6 years agotests: let's make sure the seccomp filter lists remain properly ordered
Lennart Poettering [Wed, 13 Sep 2017 17:56:35 +0000 (19:56 +0200)] 
tests: let's make sure the seccomp filter lists remain properly ordered

It's too easy to corrupt the order, hence let's check for the right
order automatically as part of testing.

6 years agoseccomp: add four new syscall groups
Lennart Poettering [Wed, 13 Sep 2017 17:55:16 +0000 (19:55 +0200)] 
seccomp: add four new syscall groups

These groups should be useful shortcuts for sets of closely related
syscalls where it usually makes more sense to allow them altogether or
not at all.

6 years agoseccomp: augment the @resources group a bit
Lennart Poettering [Wed, 13 Sep 2017 17:44:11 +0000 (19:44 +0200)] 
seccomp: augment the @resources group a bit

Given that sched_setattr/sched_setparam/sched_setscheduler are already
in the group the closely related nice + ioprio_set should also be
included.

Also, order things alphabetically.

6 years agoseccomp: beef up @process group a bit
Lennart Poettering [Wed, 13 Sep 2017 17:40:23 +0000 (19:40 +0200)] 
seccomp: beef up @process group a bit

Include the waid syscalls. If we permit forking then we should also
permit waiting for a process.

Similar to that: also permit determining the usage counters for
processes.

Include calls to determine process/thread identity. They have little
impact security-wise, but are very likely used when process management
of any form is done.

Also, add rt_sigqueueinfo + rt_tgsigqueueinfo as they are similar to
kill() and friends, but permit passing along a userdata ptr.

6 years agoseccomp: "idle" is another obsolete syscall
Lennart Poettering [Wed, 13 Sep 2017 17:39:54 +0000 (19:39 +0200)] 
seccomp: "idle" is another obsolete syscall

6 years agoseccomp: order the syscalls in more groups alphabetically
Lennart Poettering [Wed, 13 Sep 2017 17:39:02 +0000 (19:39 +0200)] 
seccomp: order the syscalls in more groups alphabetically

No changes besides reordering.

6 years agoseccomp: let's update @file-system a bit
Lennart Poettering [Wed, 13 Sep 2017 17:33:54 +0000 (19:33 +0200)] 
seccomp: let's update @file-system a bit

Let's add fremovexattr which was the only xattr syscall so far missing
from the group, even though lremovexattr and friends where included.

Add inotify_init, which is an older (but still supported) version of
inotify_init1.

Add oldfstat, oldlstat, oldstat which are old versions of the stat
syscalls on some archs.

Add utime, which is an older more limited version of utimes and
utimensat.

Enclose the "statx" entry in some ifdeffery to ensure libseccomp
actually knows the syscall. If libseccomp doesn't know it, then we'd get
EINVAL rather than EDOM (which is what is returned if a syscall is known
but not available on the local system) when resolving the syscall name
and we really don't want that, as we use the EDOM vs. EINVAL check for
determining whether a syscall makes sense at all.

Also, order things alphabetically.

6 years agoseccomp: let's update base-io a bit
Lennart Poettering [Wed, 13 Sep 2017 17:31:43 +0000 (19:31 +0200)] 
seccomp: let's update base-io a bit

Let's add _llseek which is the syscall name on some archs that on others
is simply lseek (due to 64bit vs 32bit off_t confusion). Also, let's
sort things alphabetically.

6 years agoseccomp: update "@default" seccomp group a bit
Lennart Poettering [Wed, 13 Sep 2017 17:27:51 +0000 (19:27 +0200)] 
seccomp: update "@default" seccomp group a bit

Let's add more of the most basic operations to "@default" as absolute
baseline needed by glibc and such to operate. Specifically:

futex, get_robust_list, get_thread_area, membarrier, set_robust_list,
set_thread_area, set_tid_address are all required to properly implement
mutexes and other thread synchronization logic. Given that a ton of
datastructures are protected by mutexes (such as stdio and such), let's
just whitelist this by default, so that things can just work.

restart_syscall is used to implement EAGAIN SA_RESTART stuff in some
archs, and synthesized by the kernel without any explicit user logic,
hence let's make this work out of the box.

6 years agocore: rework how we treat specifiers in Environment= of transient units 6790/head
Lennart Poettering [Tue, 12 Sep 2017 18:07:30 +0000 (20:07 +0200)] 
core: rework how we treat specifiers in Environment= of transient units

Let's validate the data passed in after resolving specifiers, but let's
write out to the unit snippet the list without specifiers applied. This
way the pre-existing comment actually starts matching what is actually
implemented.

6 years agocore: support specifier expansion in PassEnvironment=
Lennart Poettering [Tue, 12 Sep 2017 17:48:29 +0000 (19:48 +0200)] 
core: support specifier expansion in PassEnvironment=

I can't come up with any usecase for this, but let's add this here, to
match what we support for Environment=. It's kind surprising if we
support specifier expansion for some environment related settings, but
not for others.

6 years agocore: print the right string when we fail to replace specifiers in config_parse_environ()
Lennart Poettering [Tue, 12 Sep 2017 17:47:58 +0000 (19:47 +0200)] 
core: print the right string when we fail to replace specifiers in config_parse_environ()

6 years agounits: properly unset the l10n environment variables where we need to
Lennart Poettering [Sun, 10 Sep 2017 10:19:02 +0000 (12:19 +0200)] 
units: properly unset the l10n environment variables where we need to

Now that we have UnsetEnvironment=, let's make proper use of it for
unsetting l10n settings for console gettys.

Fixes: #6407
6 years agotest: add test case for UnsetEnvironment=
Lennart Poettering [Mon, 11 Sep 2017 17:10:06 +0000 (19:10 +0200)] 
test: add test case for UnsetEnvironment=

6 years agocore: add new UnsetEnvironment= setting for unit files
Lennart Poettering [Sun, 10 Sep 2017 10:16:44 +0000 (12:16 +0200)] 
core: add new UnsetEnvironment= setting for unit files

With this setting we can explicitly unset specific variables for
processes of a unit, as last step of assembling the environment block
for them. This is useful to fix #6407.

While we are at it, greatly expand the documentation on how the
environment block for forked off processes is assembled.

6 years agorules: ubi mtd - add link to named partitions (#6750)
Michael Grzeschik [Thu, 14 Sep 2017 12:53:07 +0000 (14:53 +0200)] 
rules: ubi mtd - add link to named partitions (#6750)

[zjs:
- rebase onto recent master
- drop signed-off-by]

6 years agoMerge pull request #6428 from boucman/device_reload
Lennart Poettering [Thu, 14 Sep 2017 10:46:23 +0000 (12:46 +0200)] 
Merge pull request #6428 from boucman/device_reload

device : reload when udev generates a "changed" event

6 years agoman: add a note about Name=eth0 being bad 6820/head
Zbigniew Jędrzejewski-Szmek [Thu, 14 Sep 2017 10:13:31 +0000 (12:13 +0200)] 
man: add a note about Name=eth0 being bad

Fixes #2657.

6 years agoman: reformat table in sysusers.d(5)
Zbigniew Jędrzejewski-Szmek [Thu, 14 Sep 2017 09:55:34 +0000 (11:55 +0200)] 
man: reformat table in sysusers.d(5)

I think it's quite a bit easier to read in this way.

6 years agoman: unify titling, fix description of precedence in sysusers.d(5)
Zbigniew Jędrzejewski-Szmek [Thu, 14 Sep 2017 09:55:00 +0000 (11:55 +0200)] 
man: unify titling, fix description of precedence in sysusers.d(5)

Fixes #6639.

(This behaviour of systemd-sysusers is long established, so it's better
to adjust the documentation rather than change the code. If there are any
situations out there where it matters, users must have adjusted to the
current behaviour.)

6 years agoTODO: Drop even more redundant and implemented items
Lennart Poettering [Thu, 14 Sep 2017 09:21:24 +0000 (11:21 +0200)] 
TODO: Drop even more redundant and implemented items

6 years agoTODO: remove some items that are implemented now or otherwise obsolete
Lennart Poettering [Thu, 14 Sep 2017 09:08:59 +0000 (11:08 +0200)] 
TODO: remove some items that are implemented now or otherwise obsolete

6 years agonss: use secure_getenv for behaviour-modifying booleans (#6817)
Zbigniew Jędrzejewski-Szmek [Thu, 14 Sep 2017 07:20:27 +0000 (09:20 +0200)] 
nss: use secure_getenv for behaviour-modifying booleans (#6817)

Follow up for fe102d6ab15731a199a7ea9f38c4f68d8959f86c.

6 years agonss-systemd,sysusers: make sure sysusers doesn't get confused by nss-systemd (#6812)
Lennart Poettering [Thu, 14 Sep 2017 04:20:39 +0000 (06:20 +0200)] 
nss-systemd,sysusers: make sure sysusers doesn't get confused by nss-systemd (#6812)

In nss-systemd we synthesize user entries for "nobody" and "root", as
fallback if we boot up with an entirely empty /etc. This is supposed to
be a fallback only though, and it's intended that both users exists
regularly in /etc/passwd + /etc/group. Before this patch
systemd-sysusers would never create the entries however as it notices
the synthetic entries. Let's add a way how systemd-sysusers can tell
nss-systemd not to synthesize the entries for itself.

Fixes: #6808
6 years agobasic: ensure O_TMPFILE is always defined (#6816)
Davide Cavalca [Thu, 14 Sep 2017 04:14:29 +0000 (00:14 -0400)] 
basic: ensure O_TMPFILE is always defined (#6816)

6 years agoMerge pull request #6807 from poettering/service-result
Zbigniew Jędrzejewski-Szmek [Wed, 13 Sep 2017 21:17:20 +0000 (23:17 +0200)] 
Merge pull request #6807 from poettering/service-result

man: complete and rework $SERVICE_RESULT documentation

6 years agoMerge pull request #6810 from poettering/test-mode-segfault
Zbigniew Jędrzejewski-Szmek [Wed, 13 Sep 2017 21:13:10 +0000 (23:13 +0200)] 
Merge pull request #6810 from poettering/test-mode-segfault

don't crash in pager code when "systemd --test" is invoked

6 years agoman: rework grammatical form of sentences in a table in systemd.exec(5) 6807/head
Zbigniew Jędrzejewski-Szmek [Wed, 13 Sep 2017 21:02:34 +0000 (23:02 +0200)] 
man: rework grammatical form of sentences in a table in systemd.exec(5)

"Currently, the following values are defined: xxx: in case <condition>" is
awkward because "xxx" is always defined unconditionally. It is _used_ in case
<condition> is true. Correct this and a bunch of other places where the
sentence structure makes it unclear what is the subject of the sentence.

6 years agoMerge pull request #6775 from poettering/run-pipe2
Zbigniew Jędrzejewski-Szmek [Wed, 13 Sep 2017 20:27:04 +0000 (22:27 +0200)] 
Merge pull request #6775 from poettering/run-pipe2

run: add new --pipe option for "systemd-run"

6 years agoMerge pull request #6805 from poettering/exec-dir
Zbigniew Jędrzejewski-Szmek [Wed, 13 Sep 2017 20:26:41 +0000 (22:26 +0200)] 
Merge pull request #6805 from poettering/exec-dir

exec-util,conf-files: skip non-executable files in execute_directories()

6 years agoman: fix repeated use of "use" in a sentence 6775/head
Zbigniew Jędrzejewski-Szmek [Wed, 13 Sep 2017 20:11:03 +0000 (22:11 +0200)] 
man: fix repeated use of "use" in a sentence

6 years agosd-bus: extend D-Bus authentication timeout considerably (#6813)
Lennart Poettering [Wed, 13 Sep 2017 17:08:26 +0000 (19:08 +0200)] 
sd-bus: extend D-Bus authentication timeout considerably (#6813)

As it turns out the authentication phase times out too often than is
good, mostly due to PRNG pools not being populated during boot. Hence,
let's increase the authentication timeout from 25s to 90s, to cover for
that.

(Note that we leave the D-Bus method call timeout at 25s, matching the
reference implementation's value. And if the auth phase managed to
complete then the pools should be populated enough and mehtod calls
shouldn't take needlessly long anymore).

Fixes: #6418
6 years agoMerge pull request #6811 from fbuihuu/dont-detach-root-DM-dev
Lennart Poettering [Wed, 13 Sep 2017 13:09:25 +0000 (15:09 +0200)] 
Merge pull request #6811 from fbuihuu/dont-detach-root-DM-dev

Dont try to detach DM dev hosting "/" even when it uses BTRFS

6 years agoMerge pull request #6798 from poettering/nspawn-seccomp
Lennart Poettering [Wed, 13 Sep 2017 10:57:59 +0000 (12:57 +0200)] 
Merge pull request #6798 from poettering/nspawn-seccomp

nspawn seccomp improvements

6 years agoshutdown: don't be fooled when detaching DM devices with BTRFS 6811/head
Franck Bui [Wed, 13 Sep 2017 09:04:17 +0000 (11:04 +0200)] 
shutdown: don't be fooled when detaching DM devices with BTRFS

Otherwise we would try to detach the DM device hosting the rootfs with BTRFS
which is doomed to fail.

6 years agoutil: make get_block_device() available
Franck Bui [Wed, 13 Sep 2017 09:47:15 +0000 (11:47 +0200)] 
util: make get_block_device() available

6 years agoconf-files: log when we skip a drop-in configuration file 6805/head
Lennart Poettering [Wed, 13 Sep 2017 09:41:41 +0000 (11:41 +0200)] 
conf-files: log when we skip a drop-in configuration file

6 years agoexec-util,conf-files: skip non-executable files in execute_directories()
Lennart Poettering [Tue, 12 Sep 2017 14:57:33 +0000 (16:57 +0200)] 
exec-util,conf-files: skip non-executable files in execute_directories()

Fixes: #6787
6 years agopager: let's create pager fds with O_CLOEXEC first 6810/head
Lennart Poettering [Wed, 13 Sep 2017 08:35:28 +0000 (10:35 +0200)] 
pager: let's create pager fds with O_CLOEXEC first

We make copies (without O_CLOEXEC) of the fds anyway before using them,
hence let's be safe and create them with O_CLOEXEC first, so that we
don't run into issues should pager_open() be called in a threaded
environment where another thread fork()s at the wrong time and ends up
with fds not marked O_CLOEXEC.

6 years agomain: skip many initialization steps when running in --test mode
Lennart Poettering [Wed, 13 Sep 2017 08:31:40 +0000 (10:31 +0200)] 
main: skip many initialization steps when running in --test mode

Most importantly, don't collect open socket activation fds when in
--test mode. This specifically created a problem because we invoke
pager_open() beforehand (which these days makes copies of the original
stdout/stderr in order to be able to restore them when the pager goes
away) and we might mistakenly the fd copies it creates as socket
activation fds.

Fixes: #6383
6 years agoshutdown: fix incorrect fscanf() result check (#6806)
Lennart Poettering [Wed, 13 Sep 2017 08:08:37 +0000 (10:08 +0200)] 
shutdown: fix incorrect fscanf() result check (#6806)

A correction for 090e3c9796ef6468d4f396610804d62f6ffd797f.

Fixes: #6796
6 years agoman: explicitly distinguish "implicit dependencies" and "default dependencies" 6801/head
John Lin [Tue, 12 Sep 2017 04:02:27 +0000 (12:02 +0800)] 
man: explicitly distinguish "implicit dependencies" and "default dependencies"

Fixes: #6793
6 years agohwdb: add Lenovo Yoga 510-14IKB sensor mount quirk (#6799)
jonasBoss [Tue, 12 Sep 2017 16:39:25 +0000 (18:39 +0200)] 
hwdb: add Lenovo Yoga 510-14IKB sensor mount quirk (#6799)

6 years agotmpfiles.d/journal-nocow: fix typo (#6804)
Lukáš Nykrýn [Tue, 12 Sep 2017 16:28:21 +0000 (18:28 +0200)] 
tmpfiles.d/journal-nocow: fix typo (#6804)

6 years agoman: complete and rework $SERVICE_RESULT documentation
Lennart Poettering [Tue, 12 Sep 2017 16:02:18 +0000 (18:02 +0200)] 
man: complete and rework $SERVICE_RESULT documentation

This reworks the paragraph describing $SERVICE_RESULT into a table, and
adds two missing entries: "success" and "start-limit-hit".

These two entries are then also added to the table explaining the
$EXIT_CODE + $EXIT_STATUS variables.

Fixes: #6597
6 years agorun: add new --pipe option for including "systemd-run" commands in shell pipelines
Lennart Poettering [Fri, 8 Sep 2017 13:38:40 +0000 (15:38 +0200)] 
run: add new --pipe option for including "systemd-run" commands in shell pipelines

In this mode, we'll directly connect stdin/stdout/stderr of the invoked
service with whatever systemd-run itself is invoked on. This allows
inclusion of "systemd-run" commands in shell pipelines, as unlike
"--pty" this means EOF of stdin/stdout/stderr are propagated
independently.

If --pty and --pipe are combined systemd-run will automatically pick the
right choice for the context it is invoked in, i.e. --pty when invoked
on a TTY, and --pipe otherwise.

6 years agoMerge pull request #6802 from systemd-mailing-devs/20170911184738.GA11495@dtor-ws
Lennart Poettering [Tue, 12 Sep 2017 14:15:22 +0000 (16:15 +0200)] 
Merge pull request #6802 from systemd-mailing-devs/20170911184738.GA11495@dtor-ws

rules: load drivers only on "add" events

6 years agonspawn: implement configurable syscall whitelisting/blacklisting 6798/head
Lennart Poettering [Mon, 11 Sep 2017 15:45:21 +0000 (17:45 +0200)] 
nspawn: implement configurable syscall whitelisting/blacklisting

Now that we have ported nspawn's seccomp code to the generic code in
seccomp-util, let's extend it to support whitelisting and blacklisting
of specific additional syscalls.

This uses similar syntax as PID1's support for system call filtering,
but in contrast to that always implements a blacklist (and not a
whitelist), as we prepopulate the filter with a blacklist, and the
unit's system call filter logic does not come with anything
prepopulated.

(Later on we might actually want to invert the logic here, and
whitelist rather than blacklist things, but at this point let's not do
that. In case we switch this over later, the syscall add/remove logic of
this commit should be compatible conceptually.)

Fixes: #5163
Replaces: #5944

6 years agoman: move bus-based/socket-based activation out of Automatic Dependencies section
John Lin [Tue, 12 Sep 2017 02:09:45 +0000 (10:09 +0800)] 
man: move bus-based/socket-based activation out of Automatic Dependencies section

Fixes: #6793
6 years agorules: load drivers only on "add" events 6802/head
Dmitry Torokhov [Mon, 11 Sep 2017 18:47:38 +0000 (11:47 -0700)] 
rules: load drivers only on "add" events

Previously we were loading kernel modules on all device events save
for "remove". With the introduction of KOBJ_BIND/KOBJ_UNBIND this causes
issues, as driver modules that have devices bound to their drivers get
immediately reloaded, and it appears to the user that module unloading
does not work.

Let's change the rules to only load modules on "add" events instead.

6 years agonspawn: replace homegrown seccomp filter table largely with references to the existin...
Lennart Poettering [Sun, 10 Sep 2017 17:25:08 +0000 (19:25 +0200)] 
nspawn: replace homegrown seccomp filter table largely with references to the existing syscall groups

Let's shorten the table, now that we are hooked up to the syscall group
system.

6 years agonspawn: part over seccomp code to use seccomp_add_syscall_filter_item()
Lennart Poettering [Sun, 10 Sep 2017 17:16:09 +0000 (19:16 +0200)] 
nspawn: part over seccomp code to use seccomp_add_syscall_filter_item()

Let's unify a bit of the code here.

6 years agoseccomp: split out inner loop code of seccomp_add_syscall_filter_set()
Lennart Poettering [Sun, 10 Sep 2017 17:10:29 +0000 (19:10 +0200)] 
seccomp: split out inner loop code of seccomp_add_syscall_filter_set()

Let's add a new helper function seccomp_add_syscall_filter_item() that
contains the inner loop code of seccomp_add_syscall_filter_set(). This
helper function we can then export and make use of elsewhere.

6 years agoseccomp: drop default_action parameter from seccomp_add_syscall_filter_set()
Lennart Poettering [Sun, 10 Sep 2017 16:52:23 +0000 (18:52 +0200)] 
seccomp: drop default_action parameter from seccomp_add_syscall_filter_set()

The function doesn't actually use the parameter, hence let's drop it.

6 years agounits: remove unnecessary Requires= and After= in system.slice (#6794)
John Lin [Mon, 11 Sep 2017 08:35:51 +0000 (16:35 +0800)] 
units: remove unnecessary Requires= and After= in system.slice (#6794)

6 years agohwdb: Add ACCEL_MOUNT_MATRIX for the Lamina T-1016B.NORD 2-in-1 tablet (#6430)
Marcus Lundblad [Mon, 11 Sep 2017 07:56:57 +0000 (09:56 +0200)] 
hwdb: Add ACCEL_MOUNT_MATRIX for the Lamina T-1016B.NORD 2-in-1 tablet (#6430)

6 years agoaccelerator mount matrix for Asus TP300LD (#6789)
Thomas Sailer [Mon, 11 Sep 2017 06:36:05 +0000 (08:36 +0200)] 
accelerator mount matrix for Asus TP300LD (#6789)

6 years agodevice : reload when udev generates a "changed" event 6428/head
Jérémy Rosen [Sat, 2 Sep 2017 09:23:36 +0000 (11:23 +0200)] 
device : reload when udev generates a "changed" event

6 years agounit : allow any unit which propagates reloads to be reloaded
\83©rÃ\83©my Rosen [Sat, 22 Jul 2017 15:30:57 +0000 (17:30 +0200)] 
unit : allow any unit which propagates reloads to be reloaded

6 years agosystemctl: don't do ANSI underlining on TERM=linux (#6778)
Lennart Poettering [Sat, 9 Sep 2017 20:48:35 +0000 (22:48 +0200)] 
systemctl: don't do ANSI underlining on TERM=linux (#6778)

The linux console apparently can't do underlining, hence let's not do it
on the console.

Also see: #6601

6 years agoMerge pull request #6780 from poettering/agent-message
Zbigniew Jędrzejewski-Szmek [Sat, 9 Sep 2017 20:32:37 +0000 (22:32 +0200)] 
Merge pull request #6780 from poettering/agent-message

Three minor fixes.

6 years agolibudev: add missing errno initialization/error propagation (#6781)
Lennart Poettering [Sat, 9 Sep 2017 20:31:09 +0000 (22:31 +0200)] 
libudev: add missing errno initialization/error propagation (#6781)

In libudev (which es much older code than the rest of systemd), we
propagate errors in functions not returning an int, via (positive) errno
(i.e. libc-style), and as negative Exyz values in those returning an int
(much preferred, i.e. Linux kernel style). Let's fix up a few place,
where this was incorrectly done, or not done at all.

Fixes: #6613
6 years agoman: update reference to definition of StartLimitAction (#6786)
Alan Jenkins [Sat, 9 Sep 2017 12:54:23 +0000 (13:54 +0100)] 
man: update reference to definition of StartLimitAction (#6786)

The values for StartLimitAction are defined in `man systemd.unit`.
Don't send people to `man systemd.service` just to find they need to look
back in `man systemd.unit` again :).

6 years agokmod-setup: define has_virtio_rng() only in a case when HAVE_KMOD is enabled (#6784)
0xAX [Fri, 8 Sep 2017 21:51:04 +0000 (03:51 +0600)] 
kmod-setup: define has_virtio_rng() only in a case when HAVE_KMOD is enabled (#6784)

in other way we will get a warning message:

../src/core/kmod-setup.c:83:13: warning: ‘has_virtio_rng’ defined but
not used [-Wunused-function]

  static bool has_virtio_rng(void) {
             ^~~~~~~~~~~~~~

6 years agosulogin-shell: switch from shell implementation to a C implementation (#6698)
Felipe Sateler [Fri, 8 Sep 2017 16:21:37 +0000 (13:21 -0300)] 
sulogin-shell: switch from shell implementation to a C implementation (#6698)

6 years agoefivars: don't crash when somebody wants to remove an efi variable 6780/head
Lennart Poettering [Fri, 8 Sep 2017 15:34:11 +0000 (17:34 +0200)] 
efivars: don't crash when somebody wants to remove an efi variable

This corrects b3c908b4a230c5cca0dcdd7e94d02ec54a298abf by allowing a
NULL value again for variable deletion.

Fixes: #6753
6 years agoman: only document "systemd-mount --umount", never "--unmount"
Lennart Poettering [Fri, 8 Sep 2017 15:29:55 +0000 (17:29 +0200)] 
man: only document "systemd-mount --umount", never "--unmount"

Internally, we accept either, but let's stick to one of the spellings
for all docs.

Fixes: #6757
6 years agocore: downgrade log message about inability to propagate cgroup release message
Lennart Poettering [Fri, 8 Sep 2017 15:24:57 +0000 (17:24 +0200)] 
core: downgrade log message about inability to propagate cgroup release message

If dbus is already down during shutdown, we can't propagate the cgroup
release message anymore, but that's expected and nothing to warn about.
Hence let's downgrade the message from LOG_WARN to LOG_DEBUG.

Fixes: #6777
6 years agoutil-lib: wrap personality() to fix up broken glibc error handling (#6766)
Lennart Poettering [Fri, 8 Sep 2017 14:16:29 +0000 (16:16 +0200)] 
util-lib: wrap personality() to fix up broken glibc error handling (#6766)

glibc appears to propagate different errors in different ways, let's fix
this up, so that our own code doesn't get confused by this.

See #6752 + #6737 for details.

Fixes: #6755
6 years agomanager: when reexecuting try to connect to bus only when dbus.service is around...
Michal Sekletar [Fri, 8 Sep 2017 13:41:44 +0000 (15:41 +0200)] 
manager: when reexecuting try to connect to bus only when dbus.service is around (#6773)

Trying to connect otherwise is pointless, because if socket isn't around
we won't connect. However, when dbus.socket is present we attempt to
connect. That attempt can't succeed because we are then supposed
to activate dbus.service as a response to connection from
us. This results in deadlock.

Fixes #6303

6 years agojournalctl: honor --quiet when vacuuming (#6771)
Kai-Heng Feng [Fri, 8 Sep 2017 12:25:44 +0000 (20:25 +0800)] 
journalctl: honor --quiet when vacuuming (#6771)

'journalctl --vacuum-*' does not suppress output message with --quiet.

Let journal_directory_vacuum honors --quiet to fix the problem.

BugLink: https://bugs.launchpad.net/bugs/1692188
6 years agoAllow configuration of a bridge netdev's group_fwd_mask. (#6759)
b1tninja [Fri, 8 Sep 2017 10:36:06 +0000 (03:36 -0700)] 
Allow configuration of a bridge netdev's group_fwd_mask. (#6759)

6 years agoMerge pull request #6770 from lucaswerkmeister/analyze-get-log
Lennart Poettering [Fri, 8 Sep 2017 10:08:16 +0000 (12:08 +0200)] 
Merge pull request #6770 from lucaswerkmeister/analyze-get-log

analyze: add get-log-level, get-log-target verbs

6 years agoMerge pull request #6768 from fsateler/umount-message
Djalal Harouni [Fri, 8 Sep 2017 06:38:00 +0000 (08:38 +0200)] 
Merge pull request #6768 from fsateler/umount-message

Some better messages for systemd-mount --umount

6 years agoanalyze: add get-log-level, get-log-target verbs 6770/head
Lucas Werkmeister [Thu, 7 Sep 2017 21:41:20 +0000 (23:41 +0200)] 
analyze: add get-log-level, get-log-target verbs

They’re counterparts to the existing set-log-level and set-log-target
verbs, simply printing the current value to stdout. This makes it
slightly easier to temporarily change the log level and/or target and
then restore the old value(s).

6 years agoshell-completion: add systemd-analyze set-log-target 6769/head
Lucas Werkmeister [Thu, 7 Sep 2017 21:23:33 +0000 (23:23 +0200)] 
shell-completion: add systemd-analyze set-log-target

The `systemd-analyze set-log-target` command was added in v227 (commit
2ca2a91cf1), but was missing from the shell completion specifications.

6 years agomount: always show the user-provided argument when umount can't be done 6768/head
Felipe Sateler [Thu, 7 Sep 2017 19:16:19 +0000 (16:16 -0300)] 
mount: always show the user-provided argument when umount can't be done

Otherwise it can be confusing if the path is not the same

6 years agomount: Add message when the target path does not exist
Felipe Sateler [Thu, 7 Sep 2017 19:12:35 +0000 (16:12 -0300)] 
mount: Add message when the target path does not exist

Fixes: #6760
6 years agoMerge pull request #6616 from pfl/rdnss
Lennart Poettering [Thu, 7 Sep 2017 17:01:57 +0000 (19:01 +0200)] 
Merge pull request #6616 from pfl/rdnss

networkd: RDNSS option for systemd-networkd prefix delegation

6 years agohwdb: Add Cube i7 Stylus sensor rotation matrix (#6722)
dmig [Fri, 1 Sep 2017 08:51:41 +0000 (15:51 +0700)] 
hwdb: Add Cube i7 Stylus sensor rotation matrix (#6722)

6 years agoMerge pull request #6436 from juga0/features/rfc7844
Lennart Poettering [Thu, 7 Sep 2017 08:08:56 +0000 (10:08 +0200)] 
Merge pull request #6436 from juga0/features/rfc7844

Features/rfc7844

6 years agoman: fix systemd-analyze plot commands (#6761)
John Lin [Thu, 7 Sep 2017 07:59:03 +0000 (15:59 +0800)] 
man: fix systemd-analyze plot commands (#6761)

6 years agoassemble multidevice btrfs volumes without external tools (#6607)
g0tar [Thu, 7 Sep 2017 07:58:12 +0000 (09:58 +0200)] 
assemble multidevice btrfs volumes without external tools (#6607)

assemble multidevice btrfs volumes without external tools

This self-contained approach introduce very little overhead, unless
someone has a large number of devices composing many btrfs volumes,
in which case btrfs device scan would be faster. Still, having robust
implementation is a nice to have alternative for btrfs-progs.

6 years agoman: Document prefix delegation in systemd.network 6616/head
Patrik Flykt [Wed, 6 Sep 2017 11:20:08 +0000 (14:20 +0300)] 
man: Document prefix delegation in systemd.network

Add prefix delegation documentation covering IPv6PrefixDelegation=
setting in the Network section as well as all the parameters and
the IPv6PrefixDelegation and IPv6Prefix sections implemented so
far, including DNS= and DNSLifetimeSec= settings.