Zbigniew Jędrzejewski-Szmek [Sat, 23 Sep 2017 14:51:41 +0000 (16:51 +0200)]
man: add missing verb in timedatectl(1) (#6896)
As noted by Michael Biebl.
Zbigniew Jędrzejewski-Szmek [Sat, 23 Sep 2017 11:31:02 +0000 (13:31 +0200)]
Merge pull request #6894 from poettering/read-full-file-optimize
fileio: various fixes
Lennart Poettering [Sat, 23 Sep 2017 10:44:49 +0000 (12:44 +0200)]
Merge pull request #6892 from keszybz/enablement-work
Fix various issues with enabled/disabled units
Lennart Poettering [Fri, 22 Sep 2017 19:05:03 +0000 (21:05 +0200)]
fileio: initialize errno to zero before we do fread()
if there was something in the read buffer already errno might not be set
on error, let's detect that case.
Lennart Poettering [Fri, 22 Sep 2017 19:03:33 +0000 (21:03 +0200)]
fileio: try to read one byte too much in read_full_stream()
Let's read one byte more than the file size we read from stat() on the
first fread() invocation. That way, the first read() will already be
short and indicate eof to fread().
This is a minor optimization, and replaces #3908.
Lennart Poettering [Fri, 22 Sep 2017 18:59:39 +0000 (20:59 +0200)]
fileio: move fsync() logic into write_string_stream_ts()
That way, write_string_stream_ts() becomes more powerful, and we can
remove duplicate code from write_string_file_atomic() and
write_string_file_ts().
Lennart Poettering [Fri, 22 Sep 2017 18:55:34 +0000 (20:55 +0200)]
fileio: make write_string_stream() accept flags parameter
Let's make write_string_stream() and write_string_file() more alike, and
pass the same flag set so that we can remove a number of boolean
parameters.
Lennart Poettering [Fri, 22 Sep 2017 18:45:06 +0000 (20:45 +0200)]
fileio: support writing atomic files with timestamp
Let's make sure "ts" is taken into account when writing atomic files,
too.
John Lin [Fri, 22 Sep 2017 17:15:28 +0000 (01:15 +0800)]
man: Requires= needs After= to deactivate "this unit" (#6869)
Fixes: #6856
Lennart Poettering [Fri, 22 Sep 2017 16:47:59 +0000 (18:47 +0200)]
Merge pull request #6879 from marcelhollerbach/testsuite-fix
time-util: testsuite fix
Zbigniew Jędrzejewski-Szmek [Fri, 22 Sep 2017 12:46:09 +0000 (14:46 +0200)]
install: consider globally enabled units as "enabled" for the user
We would not consider symlinks in /etc/systemd/user/*.{wants,requires}/
towards the user unit being "enabled", because the symlinks were not
located in "config" paths. But this is confusing to users, since those units
are clearly enabled and will be started. So let's muddle the definition of
enablement a bit to include the paths only accessible to root when looking for
enabled user units.
Fixes #4432.
Zbigniew Jędrzejewski-Szmek [Thu, 21 Sep 2017 17:03:17 +0000 (19:03 +0200)]
install: consider non-Alias=/non-DefaultInstance= symlinks as "indirect" enablement
I think this matches the spirit of "indirect" well: the unit
*might* be active, even though it is not "installed" in the
sense of symlinks created based on the [Install] section.
The changes to test-install-root touch the same lines as in the previous
commit; the change in each case is from
assert_se(unit_file_get_state(...) >= 0 && state == UNIT_FILE_ENABLED)
to
assert_se(unit_file_get_state(...) >= 0 && state == UNIT_FILE_DISABLED)
to
assert_se(unit_file_get_state(...) >= 0 && state == UNIT_FILE_INDIRECT)
in the last two commits.
Zbigniew Jędrzejewski-Szmek [Thu, 21 Sep 2017 16:53:45 +0000 (18:53 +0200)]
install: only consider names in Alias= as "enabling"
When a unit has a symlink that makes an alias in the filesystem,
but that name is not specified in [Install], it is confusing
is the unit is shown as "enabled". Look only for names specified
in Alias=.
Fixes #6338.
v2:
- Fix indentation.
- Fix checking for normal enablement, when the symlink name is the same as the
unit name. This case wasn't handled properly in v1.
v3:
- Rework the patch to also handle templates properly:
A template templ@.service with DefaultInstance=foo will be considered
enabled only when templ@foo.service symlink is found. Symlinks with
other instance names do not count, which matches the logic for aliases
to normal units. Tests are updated.
Marcel Hollerbach [Wed, 20 Sep 2017 17:26:13 +0000 (19:26 +0200)]
time-util: mktime_or_timegm are changing the struct tm
after that wm_day etc. seems to be changed. Moving the check infront of
the mktime_or_timegm fixes that.
Marcel Hollerbach [Wed, 20 Sep 2017 12:47:49 +0000 (14:47 +0200)]
time-util: correctly handle the timezone when parsing
The timezone was cut off the string once the timezone was not UTC.
If it is not UTC but a other timezone that matches tzname[0] or
tzname[1], then we can leave it to the impl function to parse that
correctly. If not we can just fallback to whatever is the current
timezone is in the given t_timezone.
This should fix the testuite and tests.
Lennart Poettering [Fri, 22 Sep 2017 08:22:24 +0000 (10:22 +0200)]
journald: make maximum size of stream log lines configurable and bump it to 48K (#6838)
This adds a new setting LineMax= to journald.conf, and sets it by
default to 48K. When we convert stream-based stdout/stderr logging into
record-based log entries, read up to the specified amount of bytes
before forcing a line-break.
This also makes three related changes:
- When a NUL byte is read we'll not recognize this as alternative line
break, instead of silently dropping everything after it. (see #4863)
- The reason for a line-break is now encoded in the log record, if it
wasn't a plain newline. Specifically, we distuingish "nul",
"line-max" and "eof", for line breaks due to NUL byte, due to the
maximum line length as configured with LineMax= or due to end of
stream. This data is stored in the new implicit _LINE_BREAK= field.
It's not synthesized for plain \n line breaks.
- A randomized 128bit ID is assigned to each log stream.
With these three changes in place it's (mostly) possible to reconstruct
the original byte streams from log data, as (most) of the context of
the conversion from the byte stream to log records is saved now. (So,
the only bits we still drop are empty lines. Which might be something to
look into in a future change, and which is outside of the scope of this
work)
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=86465
See: #4863
Replaces: #4875
Lennart Poettering [Thu, 21 Sep 2017 19:41:55 +0000 (21:41 +0200)]
Merge pull request #6853 from sourcejedi/GetAll
sd-bus: fix response for GetAll on non-existent objects
Zbigniew Jędrzejewski-Szmek [Thu, 21 Sep 2017 18:54:16 +0000 (20:54 +0200)]
Link to the right glibc commit in comment (#6884)
Reported by Marcos Mello.
Fixes #6882.
Zbigniew Jędrzejewski-Szmek [Thu, 21 Sep 2017 16:36:45 +0000 (18:36 +0200)]
install: move and rename to lowercase two functions
No reason to make them look like macros.
Zbigniew Jędrzejewski-Szmek [Thu, 21 Sep 2017 14:05:52 +0000 (16:05 +0200)]
timedatectl: be more explicit what "ntp synchronized" means
The documentation explained that the message doesn't really mean what it says,
but I think it's better to just make the message more straightforward.
Fixes #6554.
Marcel Hollerbach [Tue, 19 Sep 2017 15:00:56 +0000 (17:00 +0200)]
time-util: fix shadowing of timezone
timezone was shadowing timezone from time.h which leads to a buildbreak
since systemd is built with -Werror
Jan Synacek [Thu, 21 Sep 2017 08:38:52 +0000 (10:38 +0200)]
execute: fix typo in error message (#6881)
Lennart Poettering [Wed, 20 Sep 2017 17:51:44 +0000 (19:51 +0200)]
Merge pull request #6847 from keszybz/disable-enable-generators
Disable and optionally again enable generators in test mode
Zbigniew Jędrzejewski-Szmek [Sat, 16 Sep 2017 09:31:16 +0000 (11:31 +0200)]
path-lookup: fix minor memleak
Introduced in
a1f31f4715.
Zbigniew Jędrzejewski-Szmek [Sat, 16 Sep 2017 09:29:34 +0000 (11:29 +0200)]
analyze-verify: add --generators switch to enable generators again
Zbigniew Jędrzejewski-Szmek [Sat, 16 Sep 2017 09:19:43 +0000 (11:19 +0200)]
Make test_run into a flags field and disable generators again
Now generators are only run in systemd --test mode, where this makes
most sense (how are you going to test what would happen otherwise?).
Fixes #6842.
v2:
- rename test_run to test_run_flags
Susant Sahani [Tue, 19 Sep 2017 14:28:26 +0000 (19:58 +0530)]
networkd: route - support unicast,blackhole,unreachable and prohibited (#6861)
Resolves issues #797 and #967.
Conf
```
[Route]
Type=blackhole
Destination=202.54.1.2
```
ip route
```
blackhole 202.54.1.2 proto static
Michael Biebl [Tue, 19 Sep 2017 12:17:57 +0000 (14:17 +0200)]
tests: change dbus tests to use user bus (#6845)
This makes it possible to run more dbus tests in a build
environment/chroot where no system bus is available.
To run the dbus test one then can use dbus-run-session.
Ivan Kurnosov [Tue, 19 Sep 2017 09:23:34 +0000 (21:23 +1200)]
Added docs for new timezone support added at #6788 (#6865)
Susant Sahani [Tue, 19 Sep 2017 08:49:58 +0000 (14:19 +0530)]
systemd-link: Add support to configure tx-tcp6-segmentation (#6859)
closes #6854
tcp-segmentation-offload: off
tx-tcp-segmentation: off
tx-tcp-ecn-segmentation: off [fixed]
tx-tcp-mangleid-segmentation: off
tx-tcp6-segmentation: off <==========================
Lennart Poettering [Tue, 19 Sep 2017 08:38:40 +0000 (10:38 +0200)]
Merge pull request #6855 from keszybz/more-docs
More docs
Dimitri John Ledkov [Tue, 19 Sep 2017 08:26:17 +0000 (09:26 +0100)]
networkd: change UseMTU default to true. (#6837)
Typically when DHCP server sets MTU it is a lower one. And a lower than usual
MTU is then thus required on said network to have operational networking. This
makes networkd's dhcp client to work in more similar way to other dhcp-clients
(e.g. isc-dhcp). In particular, in a cloud setting, without this default
instances have resulted in timing out talking to cloud metadata source and
failing to provision.
This does not change this default for the Annonymize code path.
Zbigniew Jędrzejewski-Szmek [Tue, 19 Sep 2017 06:04:02 +0000 (08:04 +0200)]
build-sys: bump xslt maxdepth limit (#6863)
With libxslt-1.30, builds were failing on some recursion depth limit
with systemd.index.xml. Bumping the limit fixes the issue.
Ansgar Burchardt [Tue, 19 Sep 2017 04:48:09 +0000 (06:48 +0200)]
typo: chache → cache (#6864)
Alan Jenkins [Mon, 18 Sep 2017 15:43:19 +0000 (16:43 +0100)]
man/systemd.special: correct what slices.target pulls in (#6862)
Patrik Flykt [Mon, 18 Sep 2017 10:09:44 +0000 (13:09 +0300)]
sd-radv: Free DNS domain search list on unref (#6858)
Evgeny Vereshchagin [Sun, 17 Sep 2017 21:07:12 +0000 (00:07 +0300)]
Merge pull request #6851 from keszybz/fix-masking-with-empty-files
Fix masking with empty files
Zbigniew Jędrzejewski-Szmek [Sun, 17 Sep 2017 13:17:50 +0000 (15:17 +0200)]
test-exec-util: add two test cases for scripts masked with empty file
A test for #6831. Fails without the previous commit.
Suggested by Evgeny Vereshchagin.
Zbigniew Jędrzejewski-Szmek [Sun, 17 Sep 2017 13:26:01 +0000 (15:26 +0200)]
conf-files: fix check for masking with empty files
Fixes #6831.
Zbigniew Jędrzejewski-Szmek [Sun, 17 Sep 2017 19:05:20 +0000 (21:05 +0200)]
man: describe user@host:machine syntax
Fixes #6734.
Zbigniew Jędrzejewski-Szmek [Sun, 17 Sep 2017 18:05:57 +0000 (20:05 +0200)]
man: update limits on seat and session identifiers in sd-login(3)
For the session identifier, the code is currently slightly stricter, because it
only uses digits and letters, than the description. This should be OK.
Fixes #6745.
Zbigniew Jędrzejewski-Szmek [Sun, 17 Sep 2017 17:52:15 +0000 (19:52 +0200)]
man: import "Multi-Seat on Linux" into sd-login(3)
The document on the wiki is partially outdated and not very visible. Let's
import the gist of it here. The original text is retained, with only grammar
and stylistic and formatting changes.
Alan Jenkins [Sat, 16 Sep 2017 11:32:59 +0000 (12:32 +0100)]
sd-bus: style nitpick node_vtable_get_userdata()
It's confusing to use a single void* to store data with two different
types, i.e. a userdata value which is safe to pass to ->find(), and a
userdata value which identifies the found object.
Name the latter `found_u`. This naming treats (!c->find) as a degenerate
case. (I.e. at that point, we know the object has already been found :).
Alan Jenkins [Sat, 16 Sep 2017 13:39:22 +0000 (14:39 +0100)]
sd-bus: fix response for GetAll on non-existent objects
Before this commit, if you run `loginctl user-status` from
debug-shell.service (and you have no login sessions for root), you always
see this output:
0
Linger: no
because Properties.GetAll is returning success but without any properties,
when the only find() callback had returned 0 to mean "no object found".
After:
Could not get properties: Unknown object:
'/org/freedesktop/login1/user/self'
BTW I have a fix for more user-friendly messages from logind in this case.
It is pending in my local branch for #6829 "fix `loginctl enable-linger`".
Zbigniew Jędrzejewski-Szmek [Sun, 17 Sep 2017 13:05:35 +0000 (15:05 +0200)]
Merge pull request #6788 from zerkms/TIMER_TIMEZONE
Timezone support for timers
Ivan Kurnosov [Sun, 17 Sep 2017 11:09:38 +0000 (23:09 +1200)]
Fix for dst/non-dst timezones
The problem was with the tm.tm_isdst that is set to the current environment
value: either DST or not. While the current state is not relevant to the state
in the desired date.
Hence — it should be reset so that the mktime_or_timegm could normalise it
later.
Lennart Poettering [Sun, 17 Sep 2017 10:04:21 +0000 (12:04 +0200)]
Merge pull request #6846 from keszybz/fix-udev_event_apply_format
Fix udev_event_apply_format()
Zbigniew Jędrzejewski-Szmek [Sun, 17 Sep 2017 07:50:52 +0000 (09:50 +0200)]
test-date: add more logging on error
Lennart Poettering [Sun, 17 Sep 2017 09:56:24 +0000 (11:56 +0200)]
Merge pull request #6840 from keszybz/more-docs
Some more documentation updates
Zbigniew Jędrzejewski-Szmek [Sun, 17 Sep 2017 07:10:03 +0000 (09:10 +0200)]
Simplify the if cases for timezone checking
Just to reduce the indentation a bit.
Ivan Kurnosov [Wed, 6 Sep 2017 09:56:36 +0000 (21:56 +1200)]
Added timezone to the CalendarSpec, parser/formatter and the timedatectl
Zbigniew Jędrzejewski-Szmek [Sat, 16 Sep 2017 06:45:02 +0000 (08:45 +0200)]
Move one space from dbus-execute.c to execute.c
The number of spaces is conserved ;)
Zbigniew Jędrzejewski-Szmek [Sat, 16 Sep 2017 06:38:28 +0000 (08:38 +0200)]
udev: fix buffer overflow in udev_event_apply_format()
Fixes #6664.
Christian Hesse [Fri, 15 Sep 2017 19:28:24 +0000 (21:28 +0200)]
fix path in btrfs rule (#6844)
Commit
0e8856d2 (assemble multidevice btrfs volumes without external
tools (#6607)) introduced a call to udevadm. That lives in @rootbindir@,
not @rootlibexecdir@. So fix the path.
Zbigniew Jędrzejewski-Szmek [Fri, 15 Sep 2017 19:24:48 +0000 (21:24 +0200)]
Merge pull request #6832 from poettering/keyring-mode
Add KeyringMode unit property to fix cryptsetup key caching
Zbigniew Jędrzejewski-Szmek [Fri, 15 Sep 2017 15:26:35 +0000 (17:26 +0200)]
Merge pull request #6841 from poettering/doc-exit-codes
document exit codes
Zbigniew Jędrzejewski-Szmek [Fri, 15 Sep 2017 12:59:45 +0000 (14:59 +0200)]
man: use "filename" not "file name" by default
We settled on "filename" and "file system", so change a couple of places for
consistency. The exception is when there's an adjective before "file" that
binds more strongly then "name": "password file name", "output file name", etc.
Those cases are left intact.
Russell Stuart [Tue, 12 Sep 2017 23:25:04 +0000 (09:25 +1000)]
man: update udevadm -y/--sysname-match documentation
Fixes #6792.
[zj: reorganize the sentece for grammatical correctness.]
Zbigniew Jędrzejewski-Szmek [Fri, 15 Sep 2017 12:49:44 +0000 (14:49 +0200)]
mailmap: add entry to fix encoding issues
Lennart Poettering [Fri, 15 Sep 2017 12:17:32 +0000 (14:17 +0200)]
man: add a whole section detailing journal stdout/stderr stream logging
Details about EPIPE/SIGPIPE handling, metadata and more.
Fixes: #6620
Lennart Poettering [Thu, 14 Sep 2017 19:23:56 +0000 (21:23 +0200)]
cryptsetup: make sure we invoke the cryptsetup tools with a shared keyring
We want that cryptsetup can cache keys between multiple invocations, and
it does so via the root user's user keyring, hence let's share it among
services.
Replaces: #6286
Lennart Poettering [Thu, 14 Sep 2017 19:19:05 +0000 (21:19 +0200)]
core: add new per-unit setting KeyringMode= for controlling kernel keyring setup
Usually, it's a good thing that we isolate the kernel session keyring
for the various services and disconnect them from the user keyring.
However, in case of the cryptsetup key caching we actually want that
multiple instances of the cryptsetup service can share the keys in the
root user's user keyring, hence we need to be able to disable this logic
for them.
This adds KeyringMode=inherit|private|shared:
inherit: don't do any keyring magic (this is the default in systemd --user)
private: a private keyring as before (default in systemd --system)
shared: the new setting
Lennart Poettering [Fri, 15 Sep 2017 14:48:41 +0000 (16:48 +0200)]
Merge pull request #6830 from keszybz/generator-dirs
Redirect generators to a temporary directory in test mode
Jan Synacek [Thu, 26 Jan 2017 12:45:46 +0000 (13:45 +0100)]
doc: document service exit codes
(Heavily reworked by Lennart while rebasing)
Fixes: #3545
Replaces: #5159
Lennart Poettering [Fri, 15 Sep 2017 14:42:09 +0000 (16:42 +0200)]
execute: improve and augment execution log messages
Let's generate friendly messages for more cases, and make slight
adjustments to the existing messages.
Lennart Poettering [Fri, 15 Sep 2017 14:41:19 +0000 (16:41 +0200)]
exit-status: drop EXIT_MAKE_STARTER
This is unused since kdbus has been removed.
Zbigniew Jędrzejewski-Szmek [Fri, 15 Sep 2017 12:47:57 +0000 (14:47 +0200)]
build-sys: require libmount >= 2.30 (#6795)
Fixes #4871.
The new libmount has two changes relevant for us:
- x-* options are propagated to /run/mount/utab and are visible through
libmount (fixes #4817).
- umount -c now really works (partially solves #6115).
Lennart Poettering [Fri, 15 Sep 2017 11:17:36 +0000 (13:17 +0200)]
Merge pull request #6772 from pfl/dnssl
networkd: DNSSL option for systemd-networkd prefix delegation
Zbigniew Jędrzejewski-Szmek [Fri, 15 Sep 2017 09:47:46 +0000 (11:47 +0200)]
man: update the description of machinectl -M
Fixes #6621.
Also rework the introduction a bit.
Zbigniew Jędrzejewski-Szmek [Fri, 15 Sep 2017 09:23:57 +0000 (11:23 +0200)]
man: explain when networkd removed existing configuration and when not
Fixes #6693.
Patrik Flykt [Thu, 7 Sep 2017 09:24:00 +0000 (12:24 +0300)]
man: Document Domains for Router Advertisement network configuration
Patrik Flykt [Mon, 21 Aug 2017 12:20:56 +0000 (15:20 +0300)]
test-ndisc-ra: Update test to include DNSSL option
Update the test to include the already provided DNSSL option.
Patrik Flykt [Mon, 21 Aug 2017 10:44:25 +0000 (13:44 +0300)]
networkd-radv: Set DNSSL information on Router Advertisement enabling
Patrik Flykt [Mon, 21 Aug 2017 10:41:20 +0000 (13:41 +0300)]
sd-radv: Add Router Advertisement DNS Search List option
Add Router Advertisement DNS Search List option as specified
in RFC 8106. The search list option uses and identical option
header as the RDNSS option and therefore the option header
structure can be reused.
If systemd is compiled with IDNA support, internationalization
of the provided search domain is applied, after which the search
list is written in wire format into the DNSSL option.
Patrik Flykt [Wed, 16 Aug 2017 10:29:51 +0000 (13:29 +0300)]
networkd: Parse DNS search domain information for Router Advertisement
Parse DNS search domains from .network files so that they are included
in Router Advertisement DNSSL options.
DNS search domains are added to the [IPv6PrefixDelegation] section using
the following syntax:
Domains=foo.example.com bar.example.com
If IDNA libraries are enabled in systemd, international domain names
are supported.
Zbigniew Jędrzejewski-Szmek [Fri, 15 Sep 2017 07:33:17 +0000 (09:33 +0200)]
man: delete note about propagating signal termination
That advice is generally apropriate for "user" programs, i.e. programs which
are run interactively and used pipelines and such. But it makes less sense for
daemons to propagate the exit signal. For example, if a process receives a SIGTERM,
it is apropriate for it to exit with 0 code. So let's just delete the whole
paragraph, since this page doesn't seem to be the right place for the longer
discussion which would be required to mention all the caveats and considerations.
Fixes #6415.
Martin Pitt [Fri, 15 Sep 2017 07:21:49 +0000 (09:21 +0200)]
Revert "device : reload when udev generates a "changed" event" (#6836)
This reverts commit
0ffddc6e2c6e19e5dc81812aee9fbe964059f3aa. That
causes a rather severe disruption of D-Bus and other services when e. g.
restarting local-fs.target (as spotted by the "storage" test regression).
Fixes #6834
Lennart Poettering [Fri, 15 Sep 2017 06:26:38 +0000 (08:26 +0200)]
core: make sure that $JOURNAL_STREAM prefers stderr over stdout information (#6824)
If two separate log streams are connected to stdout and stderr, let's
make sure $JOURNAL_STREAM points to the latter, as that's the preferred
log destination, and the environment variable has been created in order
to permit services to automatically upgrade from stderr based logging to
native journal logging.
Also, document this behaviour.
Fixes: #6800
Martin Pitt [Fri, 15 Sep 2017 05:32:50 +0000 (07:32 +0200)]
cryptsetup: fix unused variable (#6833)
When building without veracrypt, gcc warns
../src/cryptsetup/cryptsetup.c:55:13: warning: ‘arg_tcrypt_veracrypt’ defined but not used [-Wunused-variable]
static bool arg_tcrypt_veracrypt = false;
Fix this by conditionalizing the declaration.
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
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.
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"
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()
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
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)
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
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.
Zbigniew Jędrzejewski-Szmek [Thu, 14 Sep 2017 17:26:29 +0000 (19:26 +0200)]
core/manager: when running in test mode, use a temp dir for generated stuff
When running through systemd-analyze verify or with --test, we would
not run generators (environment or unit). But at the end, we would nuke
the generator dirs anyway.
Simplify things by actually running generators of both types, but redirecting
their output to a temporary directory. This has the advantage that we test more
code, and the verification is more complete.
Since now we are not touching the real generator directories, we also don't
delete them, which fixes #5609.
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
Zbigniew Jędrzejewski-Szmek [Thu, 14 Sep 2017 13:44:48 +0000 (15:44 +0200)]
pid1: improve the check guarding unit_file_preset_all()
When running in systemd-analyze verify, first_boot was initialized to -1
and never changed, so we'd try to run unit_file_preset_all(). Change the
check to > 0 which is more correct. Also, add a separate test for !test_run,
since we wouldn't want to run presets even if we were in first boot
(or /etc was empty for whatever other reason).
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
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.
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.
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()
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.
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)
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.
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.
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.
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.