Commit graph

18090 commits

Author SHA1 Message Date
Harald Hoyer 6c1f72f626 Load virtio_rng early in the game (#6710)
If true randomness is needed before udev is triggered, which would load
virtio_rng, reading /dev/random takes forever and the boot stalls for a
long time.
2017-08-31 15:33:33 +02:00
Lennart Poettering 702b64846e Merge pull request #6704 from andir/fix_vrf_table_identifier
VRF documentation, parameter renames & parsing of RT names
2017-08-31 13:46:25 +02:00
Lennart Poettering d7542c46d6 Merge pull request #6709 from yuwata/imply-requires-mounts
core: StateDirectory= and friends imply RequiresMountsFor=
2017-08-31 13:30:26 +02:00
Lennart Poettering deee5c648f Merge pull request #6707 from yuwata/systemctl-show-caps
systemctl: show capabilities in human readable format
2017-08-31 12:46:03 +02:00
Michal Sekletar 780e2ee187 tmpfiles: with "e" don't attempt to set permissions when file doesn't exist (#6682)
tmpfiles.d option "e" when run through systemd-tmpfiles --create should
apply configured permissions (uid,gid) only to already existing
files. When file doesn't exist we bail out with error. Instead we should
silently ignore non-existing files.

$ useradd test
$ cat /etc/tmpfiles.d/foobar.conf
e /tmp/test - test test 1d
$ ls -l /tmp/test
ls: cannot access '/tmp/test': No such file or directory

Before:
$ systemd-tmpfiles --create /etc/tmpfiles.d/foobar.conf
Adjusting owner and mode for /tmp/test failed: No such file or directory
$ echo $?
1

After:
$ systemd-tmpfiles --create /etc/tmpfiles.d/foobar.conf
$ echo $?
0
2017-08-31 12:45:25 +02:00
Susant Sahani 617da14cfd systemd-link: ethtool add support for more Wake up Lan setting (#6331)
This works supports to configure nicast, multicast, broadcast, arp and SecureOn.
2017-08-31 12:44:43 +02:00
Lennart Poettering ec9d3a7e1d Merge pull request #6666 from sourcejedi/suspend-initiate-failure
logind: add missing resume signal when we fail to initiate sleep (and shutdown)
2017-08-31 12:24:18 +02:00
Andreas Rammhold b13049c765 networkd: Added deprecation warning to VRF.TableId 2017-08-31 12:08:33 +02:00
Yu Watanabe ada5e27657 core: StateDirectory= and friends imply RequiresMountsFor= 2017-08-31 18:19:35 +09:00
Andrew Jeddeloh 0c9b15a38a networkd: dont crash when mtu changes (#6594)
Prevent networkd from crashing when UseMTU is used. Many drivers will
bring the link down and then back up to configure a new MTU. Networkd
will also asynchonously send rtnl messages to configure the link and may
receive responses after the link has gone down and come back up (which
networkd will handle and set the lease and network to NULL.

This changes the behavior to instead return if this is the case instead
of crashing via assert.
2017-08-31 10:58:39 +02:00
Alan Jenkins 081dc63822 systemctl: clarify code - some actions never appear in arg_action (#6638)
ACTION_EMERGENCY and ACTION_DEFAULT would be handled correctly by
start_with_fallback().  However there is no fallback available for
them, and they would never be set in `arg_action` in the first
place.  Remove the unused cases from the switch statement.

@poettering suggested this makes a good place to clarify the point,
explicitly listing all the `arg_action` values which would never be
set.
2017-08-31 10:54:12 +02:00
Evgeny Vereshchagin 58c6e4a2c0 sd-bus: use -- when passing arguments to ssh (#6706)
This prevents `systemctl` from runnning /bin/touch when the following
command is used:
```
systemctl -H '-oProxyCommand=/bin/touch i-shouldnt-be-here' show-environment
```
2017-08-31 10:38:30 +02:00
Topi Miettinen ea89a119cd log: reopen log for failed assertions (#6703)
Reopen log so that failed and aborting assertions can be written to log.

Closes: #6658
2017-08-31 10:37:32 +02:00
Yu Watanabe ae978b9f6c bus-util: remove unnecessary initializations 2017-08-31 17:08:30 +09:00
Yu Watanabe 52610b020c systemctl: show capabilities in human readable format
Follow-up for 21771f338d.
2017-08-31 17:07:28 +09:00
Andreas Rammhold 62b83cf664 networkd: Renamed table_id field to table
Other parts of the code do just use `table` as identifier for the actual
routing table id. This change should make it easier to read through the
code since the meaning or rather the name stays the same.
2017-08-31 01:14:05 +02:00
Andreas Rammhold f98dd1e707 networkd: Add VRF.Table to support parsing of table names
Previously there was only `VRF.TableId` which only supported numeric
identifiers for routing table. With the additiona of
`config_parse_route_table` also names can be used as identifiers.
2017-08-31 01:11:16 +02:00
Ivan Shapovalov e9ea4526a3 cryptsetup-generator: do not bind to the decrypted device unit (#6538)
This breaks things when the decrypted device is not immediately
`SYSTEMD_READY=1` (e. g. when a multi-device btrfs system is placed on
multiple cryptsetup devices).

Fixes #6537.
2017-08-30 18:49:07 +02:00
NeilBrown 9cbc454770 shutdown: don't remount,ro network filesystems. (#6588)
systemd-shutdown is run after the network is stopped,
so remounting a network filesystem read-only can hang.
A simple umount is the most useful thing that can
be done for a network filesystem once the network is down.
2017-08-30 18:48:25 +02:00
Alan Jenkins 3f1a3d4ac5 sulogin-shell: remove ineffective job mode option from systemctl isolate (#6627)
`systemctl default` uses job mode `isolate` (see `action_table`).
The job mode option is ignored.

Note that exiting the emergency shell service by using e.g.
`systemctl isolate multi-user` or `systemctl start multi-user.target`
already kills `emergency.service`.  There's only a potential conflict
between your command and the command in systemd-sulogin-shell if you run
something like `systemctl start --no-block multi-user.target; exit`.
Which is nothing like what we told them to do :).
2017-08-30 18:11:31 +02:00
Franck Bui cc0df6cc35 device: make sure to remove all device units sharing the same sysfs path (#6679)
When a device is unplugged all device units sharing the same sysfs path
pointing to that device are supposed to be removed.

However it didn't work since while iterating the device unit list containing
all the relevant units, each unit was removed during each iteration of
LIST_FOREACH. However LIST_FOREACH doesn't support this use case and
LIST_FOREACH_SAFE must be use instead.
2017-08-30 17:16:16 +02:00
Alan Jenkins c29b65f723 logind: VT_GETSTATE "cannot return state for more than 16 VTs" (#6625)
`vt_is_busy(16)` would always return FALSE.  So we could have started
autovt@16.service even when VT 16 was already being used for something.
2017-08-30 17:06:12 +02:00
Tom Gundersen f29eef2e90 sd-bus: socket - only transmit auxillary FDs once (#6603)
If a message is too large to fit into the output buffer, it will be
transmitted to the kernel in several chunks. However, the FDs must
only ever be transmitted once or they will bereceived by the remote
end repeatedly.

The D-Bus specification disallows several sets of FDs attached to
one message, however, the reference implementation of D-Bus will
not reject such a message, rather it will reassign the duplicate
FDs to subsequent FD-carrying messages.

This attaches the FD array only to the first byte of the message.
2017-08-30 13:09:03 +02:00
Lennart Poettering 701afcbf12 Merge pull request #6659 from yuwata/econnrefused
networkd: do not fail manager_connect_bus() if dbus is not active yet
2017-08-30 12:17:53 +02:00
Jon Ringle e4f05508ad networkd: Honor configured DHCP ClientIdentifier on link_update (#6622)
We have an embedded board with a couple of ethernet ports. From the kernel
log, I can see that the ethernet drivers are obtaining their correct MAC
address, but for some reason, at first systemd-networkd doesn't see the
mac address for the ethernet port at the time that it looks at
dhcp_client_identifier configuration (it has 00:00:00:00:00:00 for mac).

Later on, systemd-networkd gets a link_update() call, and at this time, it
has the correct mac address for the ethernet port. However, in link_update()
the dhcp_client_identifier configuration is not being considered, and a call
to sd_dhcp_client_set_iaid_duid() is being done always
2017-08-30 11:38:00 +02:00
Lennart Poettering 30495cb0a7 Merge pull request #6691 from yuwata/man-journal-remote2
journal-remote: small fixes
2017-08-30 11:31:37 +02:00
Lennart Poettering 6d405b6909 Merge pull request #6672 from yuwata/drop-priv
use !! prefix in networkd and timesyncd
2017-08-30 10:45:24 +02:00
g0tar 73e669e0fd terminal reset should honour default_utf8 kernel setting (#6606)
terminal reset should honour default_utf8 kernel setting
2017-08-30 10:00:44 +02:00
Yu Watanabe cb30d3ba66 journal-remote: show error if SplitMode=host with 'active' source is specified 2017-08-30 16:56:41 +09:00
Yu Watanabe 53d133ea1b timesync: move stamp file to /var/lib/systemd/timesync/clock 2017-08-30 15:59:57 +09:00
Lennart Poettering 40cdf0c962 Merge pull request #6585 from poettering/seccomp-lock-personality
Seccomp lock personality
2017-08-29 18:58:56 +02:00
Lennart Poettering b1a05d7320 Merge pull request #6677 from yuwata/man-journal-remote
journal-remote: improve man page and error message
2017-08-29 18:04:50 +02:00
Topi Miettinen 07ce74074d namespace: avoid assertion failure (#6649)
If the root image is not decrypted, it must not be relinquished.
2017-08-29 17:31:24 +02:00
Lennart Poettering 3167f78a11 core: open up LockPersonality= for transient units
Let's make "systemd-run -p LockPersonality=1 -t /bin/sh" work.
2017-08-29 15:58:13 +02:00
Lennart Poettering 72eafe7159 seccomp: rework seccomp_lock_personality() to apply filter to all archs 2017-08-29 15:58:13 +02:00
Lennart Poettering e8132d63fe seccomp: default to something resembling the current personality when locking it
Let's lock the personality to the currently set one, if nothing is
specifically specified. But do so with a grain of salt, and never
default to any exotic personality here, but only PER_LINUX or
PER_LINUX32.
2017-08-29 15:56:57 +02:00
Topi Miettinen 78e864e5b3 seccomp: LockPersonality boolean (#6193)
Add LockPersonality boolean to allow locking down personality(2)
system call so that the execution domain can't be changed.
This may be useful to improve security because odd emulations
may be poorly tested and source of vulnerabilities, while
system services shouldn't need any weird personalities.
2017-08-29 15:54:50 +02:00
Lennart Poettering 54d564a212 Merge pull request #6636 from sourcejedi/fsync
"Don't fear the fsync()"
2017-08-29 15:19:44 +02:00
Alan Jenkins 265710c205 fileio: rename function parameter to avoid masking global symbol
> glibc exports a function called sync(), we should probably avoid
> overloading that as a variable here locally (gcc even used to warn about
> that, not sure why it doesn't anymore), to avoid confusion around what
> "if (sync)" actually means
2017-08-29 10:56:32 +01:00
Felipe Sateler 4f5993c3f4 shared: Add a linker script so that all functions are tagget @SD_SHARED instead of @Base (#6669)
This helps prevent symbol collisions with other programs and libraries. In particular,
because PAM modules are loaded into the process that is creating the session, and
systemd creates PAM sessions, the potential for collisions is high.

Disambiguate all systemd calls by tagging a 'version' SD_SHARED.

Fixes #6624
2017-08-28 18:49:03 +02:00
vliaskov 6c24adfd46 Revert "mount-setup: mount xenfs filesystem (#6491)" (#6662)
This reverts commit b305bd3aab.
2017-08-28 18:46:01 +02:00
Jason Gunthorpe 5570d7f956 Support 'rdma' as a ListenNetlink= argument (#6626)
NETLINK_RDMA has been in the kernel since v3.0.
2017-08-28 17:22:10 +02:00
Yu Watanabe 6b1b9f75c8 journal-remote: show error message if output file name does not end with .journal
`journalctl -o export | systemd-journal-remote -o /tmp/dir -`
gives the following error messages.
```
Failed to open output journal /tmp/dir: Invalid argument
Failed to get writer for source stdin: Invalid argument
Failed to create source for fd:0 (stdin): Invalid argument
```
And these are hard to understand what is the problem.
This commit makes journal-remote check whether the output file name
ends with .journal suffix or not, and if not, output error message.
2017-08-27 16:34:57 +09:00
Yu Watanabe 87a85e25a2 units: make use of !! ExecStart= prefix in systemd-timesyncd.service
Let's make use of !! to run timesyncd with ambient capabilities on
systems supporting them.
2017-08-27 01:41:12 +09:00
Yu Watanabe c61f302d3c units: make use of !! ExecStart= prefix in systemd-networkd.service
Let's make use of !! to run networkd with ambient capabilities on
systems supporting them.
2017-08-27 01:40:47 +09:00
Evgeny Vereshchagin 0c700d392d build-sys: fix the script used for generating load_fragment_gperf_nulstr (#6646)
This prevents `systemd --dump-configuration-items` from crashing.
Closes #6596.
2017-08-26 23:21:23 +09:00
Lennart Poettering 2e681921c9 logind: make sure we don't process the same method call twice (#6583)
Tiny mistake, big effect.

Fixes: #6375
2017-08-26 22:19:26 +09:00
Yu Watanabe 5ce96b141a Merge pull request #6582 from poettering/logind-tty
various tty path parsing fixes
2017-08-26 22:12:48 +09:00
Lennart Poettering 0f52f8e552 core: disable the effect of Restart= if there's a stop job pending for a service (#6581)
We shouldn't undo the job already enqueued, under any circumstances.

Fixes: #6504
2017-08-26 22:07:23 +09:00
Yu Watanabe 2c5ad0fd6d Merge pull request #6577 from poettering/more-exec-flags
add ! and !! ExecStart= flags to make ambient caps useful
2017-08-26 21:49:05 +09:00