1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-28 03:25:31 +03:00
Commit Graph

30018 Commits

Author SHA1 Message Date
Alan Jenkins
2d4b910383 units: DefaultDependencies already implies conflict with shutdown.target
(and system-update.target does not have DefaultDependencies=no)
2017-09-30 22:02:05 +01:00
Alan Jenkins
0b9ad5bf2e units: add missing Before=shutdown.target for units which it Conflicts
There's a few services missing this ordering.

Also remove a duplicate Conflicts=shutdown.target from
systemd-volatile-root.service.
2017-09-30 22:01:42 +01:00
Alan Jenkins
6f6d1a8a6a units: add missing ordering deps for Conflicts= of emergency.service
1. If we exited emergency mode immediately, we don't want to have an
   irreversible stop job still running for syslog.socket.  I _suspect_ that
   can't happen, but let's not waste effort working out exactly why it's
   impossible and not just very improbable.

2. Similarly, it seems undesirable to have rescue.service and
   emergency.service both running with an open FD of /dev/console, for
   however short a period.
2017-09-29 17:35:44 +01:00
Alan Jenkins
950d8fcdd9 units: express Conflict in syslog.socket instead of emergency.service
Note this commit only changes how the code is expressed; it does not change
the existence of any dependency.

The `Conflicts=` was added in 3136ec90, "Stop syslog.socket when entering
emergency mode".  The discussion in the issue #266 raised concerns that
this might be needed for other units, but failed to point out why
syslog.socket is special.  The reason is that syslog.socket has
DefaultDepedencies=no, so it does not get Requires=sysinit.target like
other socket units do.  But syslog.service does require sysinit.target,
among other things.

We don't have many socket, path, or timer units with
DefaultDependencies=no, and I don't think any of the triggered services
have such additional hard dependencies as syslog.service does.

It is much less confusing if we keep this `Conflicts=` in the same file as
the `DefaultDependencies=no` which made it necessary.
2017-09-29 17:34:55 +01:00
Alan Jenkins
a3b22cc596 units: do not kill rescue shell when machines.target is started
The original aim of this commit is that starting machines.target from the
rescue shell would not kill the rescue shell and lock you out of the
system.

This is similar to commit 6579a622, for the conflict between
sysinit.target and the _emergency_ shell.  That particular commit
introduced an ordering cycle and will need to be reverted and/or
fixed.  This one does not, because it does not need to introduce any new
dependencies.

The reason why this commit is allowable also has it's own merit:

machines.target was not marked as AllowIsolate.  Also, the point of
containers is to not escape them...  I don't think we want to promote
machines.target as a default target or similar; you would generally want
some system service to allow you to shut down the machine, for example.  I
don't see this approach used in CoreOS, nor in Fedora Atomic Host; we are
missing any positive examples of its utility.

Requires=basic.target / After=basic.target can be removed for the same
reason.
2017-09-29 17:32:14 +01:00
Lennart Poettering
ec20fe5ffb 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
2017-09-22 10:22:24 +02:00
Lennart Poettering
d82611c918 Merge pull request #6853 from sourcejedi/GetAll
sd-bus: fix response for GetAll on non-existent objects
2017-09-21 21:41:55 +02:00
Zbigniew Jędrzejewski-Szmek
a4041e4f68 Link to the right glibc commit in comment (#6884)
Reported by Marcos Mello.

Fixes #6882.
2017-09-21 20:54:16 +02:00
Jan Synacek
f679ed6116 execute: fix typo in error message (#6881) 2017-09-21 10:38:52 +02:00
Lennart Poettering
70b089d7dc Merge pull request #6847 from keszybz/disable-enable-generators
Disable and optionally again enable generators in test mode
2017-09-20 19:51:44 +02:00
Zbigniew Jędrzejewski-Szmek
23115a607e path-lookup: fix minor memleak
Introduced in a1f31f4715.
2017-09-19 20:14:22 +02:00
Zbigniew Jędrzejewski-Szmek
641c0fd14e analyze-verify: add --generators switch to enable generators again 2017-09-19 20:14:22 +02:00
Zbigniew Jędrzejewski-Szmek
e0a3da1fd2 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
2017-09-19 20:14:05 +02:00
Susant Sahani
983226f35a 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
2017-09-19 16:28:26 +02:00
Michael Biebl
6349cda20f 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.
2017-09-19 14:17:57 +02:00
Ivan Kurnosov
54d3be9772 Added docs for new timezone support added at #6788 (#6865) 2017-09-19 11:23:34 +02:00
Susant Sahani
ffa69a04be 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 <==========================
2017-09-19 10:49:58 +02:00
Lennart Poettering
c9f7fb0f3c Merge pull request #6855 from keszybz/more-docs
More docs
2017-09-19 10:38:40 +02:00
Dimitri John Ledkov
22043e4317 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.
2017-09-19 10:26:17 +02:00
Zbigniew Jędrzejewski-Szmek
f2adcd22d5 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.
2017-09-19 15:04:02 +09:00
Ansgar Burchardt
e80f1a7928 typo: chache → cache (#6864) 2017-09-19 06:48:09 +02:00
Alan Jenkins
6cc9a5bf42 man/systemd.special: correct what slices.target pulls in (#6862) 2017-09-18 17:43:19 +02:00
Patrik Flykt
f9aa5417d1 sd-radv: Free DNS domain search list on unref (#6858) 2017-09-18 12:09:44 +02:00
Evgeny Vereshchagin
06d92f88d3 Merge pull request #6851 from keszybz/fix-masking-with-empty-files
Fix masking with empty files
2017-09-18 00:07:12 +03:00
Zbigniew Jędrzejewski-Szmek
f66137fb67 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.
2017-09-17 21:22:39 +02:00
Zbigniew Jędrzejewski-Szmek
6a4643517b conf-files: fix check for masking with empty files
Fixes #6831.
2017-09-17 21:22:39 +02:00
Zbigniew Jędrzejewski-Szmek
f8f1e666a6 man: describe user@host:machine syntax
Fixes #6734.
2017-09-17 21:08:56 +02:00
Zbigniew Jędrzejewski-Szmek
9610fb3814 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.
2017-09-17 21:08:56 +02:00
Zbigniew Jędrzejewski-Szmek
0ae42c9b7a 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.
2017-09-17 21:08:56 +02:00
Alan Jenkins
00590f8268 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 :).
2017-09-17 17:55:01 +01:00
Alan Jenkins
733e792bc6 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`".
2017-09-17 17:54:54 +01:00
Zbigniew Jędrzejewski-Szmek
7db3d9fe9b Merge pull request #6788 from zerkms/TIMER_TIMEZONE
Timezone support for timers
2017-09-17 15:05:35 +02:00
Ivan Kurnosov
2e72b79459 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.
2017-09-17 13:49:14 +02:00
Lennart Poettering
88ab4a68cc Merge pull request #6846 from keszybz/fix-udev_event_apply_format
Fix udev_event_apply_format()
2017-09-17 12:04:21 +02:00
Zbigniew Jędrzejewski-Szmek
a3da4a3d0a test-date: add more logging on error 2017-09-17 11:57:00 +02:00
Lennart Poettering
27cb01b0f0 Merge pull request #6840 from keszybz/more-docs
Some more documentation updates
2017-09-17 11:56:24 +02:00
Zbigniew Jędrzejewski-Szmek
a2932a0d1a Simplify the if cases for timezone checking
Just to reduce the indentation a bit.
2017-09-17 09:42:20 +02:00
Ivan Kurnosov
48d26c0164 Added timezone to the CalendarSpec, parser/formatter and the timedatectl 2017-09-17 09:42:20 +02:00
Zbigniew Jędrzejewski-Szmek
61ceaea5c8 Move one space from dbus-execute.c to execute.c
The number of spaces is conserved ;)
2017-09-16 08:45:02 +02:00
Zbigniew Jędrzejewski-Szmek
79a695f24f udev: fix buffer overflow in udev_event_apply_format()
Fixes #6664.
2017-09-16 08:43:26 +02:00
Christian Hesse
d75b31837c 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.
2017-09-15 21:28:24 +02:00
Zbigniew Jędrzejewski-Szmek
3d7d3cbbda Merge pull request #6832 from poettering/keyring-mode
Add KeyringMode unit property to fix cryptsetup key caching
2017-09-15 21:24:48 +02:00
Zbigniew Jędrzejewski-Szmek
a52c016265 Merge pull request #6841 from poettering/doc-exit-codes
document exit codes
2017-09-15 17:26:35 +02:00
Zbigniew Jędrzejewski-Szmek
1245e4132b 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.
2017-09-15 17:18:29 +02:00
Russell Stuart
cd9363b11c man: update udevadm -y/--sysname-match documentation
Fixes #6792.

[zj: reorganize the sentece for grammatical correctness.]
2017-09-15 17:18:29 +02:00
Zbigniew Jędrzejewski-Szmek
8baa95250b mailmap: add entry to fix encoding issues 2017-09-15 17:18:29 +02:00
Lennart Poettering
157148d6d3 man: add a whole section detailing journal stdout/stderr stream logging
Details about EPIPE/SIGPIPE handling, metadata and more.

Fixes: #6620
2017-09-15 17:18:26 +02:00
Lennart Poettering
0b1f68ac87 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
2017-09-15 16:53:35 +02:00
Lennart Poettering
b1edf4456e 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
2017-09-15 16:53:35 +02:00
Lennart Poettering
4e962627bc Merge pull request #6830 from keszybz/generator-dirs
Redirect generators to a temporary directory in test mode
2017-09-15 16:48:41 +02:00