Commit graph

31926 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 4579e8ef31
Merge pull request #7540 from fbuihuu/systemd-delta-tweaks
Systemd delta tweaks
2018-01-16 20:22:25 +11:00
Shawn Landden c46bc7e216 machined: use getent to get default shell for machinectl shell (#7684)
Closes: https://github.com/systemd/systemd/issues/1395
2018-01-16 05:17:51 +11:00
Дамјан Георгиевски 81375b9bf7 bootctl: report StubInfo if present
Current Loader:
      Product: n/a
         Stub: systemd-stub 236
          ESP: /dev/disk/by-partuuid/b0a0807d-0592-40e9-adac-3bb724e9e305
         File: └─/EFI/Secure/secure-boot-4.14.13+.efi
2018-01-15 18:21:14 +01:00
Дамјан Георгиевски 34412f79e6 EFI stub: add StubInfo if non-existant
currently if a stub image is directly booted, bootctl reports:
```
Current Loader:
      Product: n/a
          ESP: /dev/disk/by-partuuid/b0a0807d-0592-40e9-adac-3bb724e9e305
         File: └─/EFI/Secure/secure-boot-4.14.8+.efi
```

Let's add a StubInfo which will be displayed by bootctl too (in a later
patch).
2018-01-15 18:08:11 +01:00
Дамјан Георгиевски 1aa15defbf EFI stub: add LoaderFirmwareInfo, LoaderFirmwareType if non-existant
bootctl previously:
```
System:
     Firmware: n/a (n/a)
```

after:
```
System:
     Firmware: UEFI 2.50 (Lenovo 0.4704)
```
2018-01-15 18:05:39 +01:00
Дамјан Георгиевски 19e0e60a57 EFI stub: add LoaderImageIdentifier if non-existant
when an image with the stub is booted directly from UEFI, bootctl status
shows this:
```
Current Loader:
      Product: n/a
          ESP: /dev/disk/by-partuuid/b0a0807d-0592-40e9-adac-3bb724e9e305
         File: └─n/a
```

After this change, the stub reports the image itself:
```
Current Loader:
      Product: n/a
          ESP: /dev/disk/by-partuuid/b0a0807d-0592-40e9-adac-3bb724e9e305
         File: └─/EFI/Secure/secure-boot-4.14.8+.efi
```
2018-01-15 17:59:33 +01:00
Patrik Flykt ecf07fb748 sd-dhcp6-client: Use offsetof() instead of sizeof()
The slightly modified review comments say that "...in theory
offsetof(DHCP6Option, data) is nicer than sizeof(DHCP6Option)
because the former removes alignment artifacts. In this
specific case there are no alignment whitespaces hence it's
fine, but out of a matter of principle offsetof() is preferred
over sizeof() in cases like this..."
2018-01-15 18:00:33 +02:00
Patrik Flykt 3c03564911 dhcp6: Fix valgrind nitpick about returned test case value
Calling dhcp6_option_parse_address() will always return a value
< 0 on error even though lt_valid remains unset. This is more
than valgrind can safely detect, but let's fix the valgrind
nitpick anyway.

While fixing, use UINT32_MAX instead of ~0 on the same line.
2018-01-15 18:00:33 +02:00
Lennart Poettering 01816fee33
Merge pull request #7884 from yuwata/small-fixes
Small fixes
2018-01-15 16:40:41 +01:00
Дилян Палаузов 5f79d69cba man: fix typo
Closes #7866.
2018-01-16 00:10:12 +09:00
Yu Watanabe 3249bf3125 man: logind: update reference
Fixes #7858.
2018-01-16 00:03:33 +09:00
Yu Watanabe bb6b922f9f journal: coding style fix
This is originally pointed out by @cpsw.
2018-01-15 23:53:10 +09:00
Yu Watanabe 9c3b99feb8 network: fix indentation
Follow-up for 56a23cb40a.
2018-01-15 23:49:55 +09:00
Yu Watanabe 55a7c78b9d networkd: remove unnecessary parentheses
Follow-up for 56a23cb40a.
2018-01-15 23:48:00 +09:00
Yu Watanabe 3e7e587d32 systemctl: comment that the verb 'check' is deprecated 2018-01-15 23:44:31 +09:00
Yu Watanabe 444c1915f9 timesync: use current uid when started as non-root user
Fixes #7883.
2018-01-15 23:40:29 +09:00
Yu Watanabe 5a45fde547 test: free memory
Fixes #7882.
2018-01-15 23:37:02 +09:00
Adam Duskett 08318a2c5a add false option for tests (#7778)
Currently there is no way to prevent tests from building using meson.
This introduces two problems:

1) It adds a extra 381 files to compile.
2) One of these tests explicitly requires libgcrypt to be built even if systemd
   is not using it.
3) It adds C++ to the requirements to build systemd.

When cross-compiling, this is uneccessary.
2018-01-15 15:25:46 +04:00
Lennart Poettering 38edb7674b
Merge pull request #7582 from pfl/dhcp6_prefix_delegation
DHCPv6 prefix delegation
2018-01-15 12:02:37 +01:00
Zbigniew Jędrzejewski-Szmek f94abc667a man: --this-boot is deprecated (#7880)
This removes the last public reference. Follow-up for #7844.
2018-01-15 19:45:40 +09:00
Zbigniew Jędrzejewski-Szmek e0b6d3cabe
Merge pull request #7816 from poettering/chase-pid
Make MAINPID= and PIDFile= handling more restrictive (and other stuff)
2018-01-15 14:14:34 +04:00
Zbigniew Jędrzejewski-Szmek c557fc3e2f
Merge pull request #7844 from yuwata/bash-completion
update bash completions
2018-01-15 13:51:29 +04:00
Zbigniew Jędrzejewski-Szmek 67ddb52432
Merge pull request #7855 from poettering/log-h-includes
log.h #include cleanups
2018-01-15 13:43:09 +04:00
Zbigniew Jędrzejewski-Szmek d04e012ad9
Merge pull request #7871 from sourcejedi/log_mounts
core: fix output (logging) for mount units (#7603)
2018-01-15 13:34:06 +04:00
Zbigniew Jędrzejewski-Szmek e4976acec4
Merge pull request #7872 from mineo/coredumpctl-zsh-completion
Fix the ZSH completion on `coredumpctl gdb <tab>`
2018-01-15 13:28:14 +04:00
Alan Jenkins 3cc9685649 core: prevent spurious retries of umount
Testing the previous commit with `systemctl stop tmp.mount` logged the
reason for failure as expected, but unexpectedly the message was repeated
32 times.

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

Re-tested with and without a preceding `mount --bind /mnt /tmp`,
and using `findmnt` to check the end result.
2018-01-13 17:22:46 +00:00
Wieland Hoffmann a6e4952d56 zsh/coredumpctl: Never sort the completion candidates
That way, they're always sorted by date. I do not know how to make ZSH sort
them by PID through some option, but that doesn't seem very useful in the first
place.
2018-01-13 15:23:28 +01:00
Wieland Hoffmann 83701d75fb zsh/coredumpctl: Fix the completion
An output from coredumpctl list is like

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

  ^1  ^2         ^3       ^4    ^5

, but the previous sub() command turns that into

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

so the whole pipeline generated entries like

$UID:$DESCRIPTION

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

This now generates entries like

$PID:$DESCRIPTION

which make everything work.

Note that with this commmit, the completions will be sorted by PID by
ZSH.
2018-01-13 15:08:36 +01:00
Alan Jenkins 5804e1b6ff core: fix output (logging) for mount units (#7603)
Documentation - systemd.exec - strongly implies mount units get logging.

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

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

Tested before/after using `systemctl stop tmp.mount`.
2018-01-13 13:03:13 +00:00
0xAX aad67b80c5 dbus-execute: define bus_set_transient_errno() only if HAVE_SECCOMP (#7869)
in other way we will get a warning during build:

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

    int bus_set_transient_##function(
2018-01-13 08:48:53 +09:00
Max Harmathy 5bcdbb2249 login: avoid external process call
Use a shell builtin of posix shells insteaf of calling 'which'.
See also http://stackoverflow.com/a/677212
2018-01-12 18:02:57 +01:00
Michal Sekletar 8647283e45 process-util: make our freeze() routine do something useful
When we crash we freeze() our-self (or possibly we reboot the machine if
that is configured). However, calling pause() is very unhelpful thing to
do. We should at least continue to do what init systems being doing
since 70's and that is reaping zombies. Otherwise zombies start to
accumulate on the system which is a very bad thing. As that can prevent
admin from taking manual steps to reboot the machine in somewhat
graceful manner (e.g. manually stopping services, unmounting data
volumes  and calling reboot -f).

Fixes #7783
2018-01-12 17:50:02 +01:00
Lennart Poettering 47e5995a38
Merge pull request #7865 from fbuihuu/restore-termination-of-bus-connection-first
Restore termination of bus connection first
2018-01-12 17:24:56 +01:00
Franck Bui 0a84daa5aa Comment the fact that some tools need to termintate their bus connect first 2018-01-12 16:20:36 +01:00
Franck Bui 3b2f303300 mount: make sure we terminate the bus connection first, and then close the pager
See cf647b69ba commit message for details.
2018-01-12 16:12:14 +01:00
Franck Bui a3c5634573 Revert "tree-wide: use _cleanup_(sd_bus_flush_close_unrefp) at various appropriate places"
This reverts commit 0b3c84eb7d.

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

Fixes: #3543
2018-01-12 16:09:21 +01:00
Matthew Thode 59dda97f7f support LZMA concatenated files
The xz format supports concatenated files, images are sometimes created
and shipped with it to increase compression.

https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1742744 is
the source bug for this issue.
2018-01-11 23:38:04 +01:00
Lennart Poettering d62b3f989a
Merge pull request #7851 from msekletar/dbus-error-logging
dbus: propagate errors from bus_init_system() and bus_init_api()
2018-01-11 23:37:04 +01:00
winnerman-pythian cce5b4f106 bootctl: add newline after printf (#7856)
Upon error condition, a newline is not printed, leading to the shell prompt jamming against this line.
2018-01-11 18:01:57 +01:00
Lennart Poettering 4f41c2ae8b
Merge pull request #7833 from keszybz/netdev-relaxed
Avoid spurious warnings about unknown sections in .netdev files
2018-01-11 17:14:49 +01:00
Lennart Poettering 6b44a121c1 cocci: there's not ENOTSUP, there's only EOPNOTSUPP
On Linux the former is a compat alias to the latter, and that's really
weird, as inside the kernel the two are distinct. Which means we really
should stay away from it.
2018-01-11 15:12:16 +01:00
Lennart Poettering 2b44daaa20 ethtool-util: don't pass fds as pointers if we don't have to
Passing them as pointers is just weird, hence don't do it
2018-01-11 15:12:16 +01:00
Lennart Poettering 20d4e99524 ethtool-util: fix weird whitespace 2018-01-11 15:12:16 +01:00
Lennart Poettering ab1263d774 ethtool-util: order includes properly 2018-01-11 15:12:16 +01:00
Lennart Poettering 89e1ba0ab2 ethtool-util: no need for memcpy() where normal assignment works too 2018-01-11 15:12:16 +01:00
Lennart Poettering db256aab13 core: be stricter when handling PID files and MAINPID sd_notify() messages
Let's be more restrictive when validating PID files and MAINPID=
messages: don't accept PIDs that make no sense, and if the configuration
source is not trusted, don't accept out-of-cgroup PIDs. A configuratin
source is considered trusted when the PID file is owned by root, or the
message was received from root.

This should lock things down a bit, in case service authors write out
PID files from unprivileged code or use NotifyAccess=all with
unprivileged code. Note that doing so was always problematic, just now
it's a bit less problematic.

When we open the PID file we'll now use the CHASE_SAFE chase_symlinks()
logic, to ensure that we won't follow an unpriviled-owned symlink to a
privileged-owned file thinking this was a valid privileged PID file,
even though it really isn't.

Fixes: #6632
2018-01-11 15:12:16 +01:00
Lennart Poettering 65c6b99094 notify: add new --uid= command
The new --uid= switch allows selecting the UID from which the
notificaiton messages shall originate.

This is primarily useful for testing purposes, but might have other
uses.
2018-01-11 15:12:16 +01:00
Lennart Poettering 9e1d021ee3 sd-dameon: also sent ucred when our UID differs from EUID
Let's be explicit, and always send the messages from our UID and never
our EUID. Previously this behaviour was conditionalized only on whether
the PID was specified, which made this non-obvious.
2018-01-11 15:12:16 +01:00
Lennart Poettering 15e23e8cdf manager: make use of pid_is_valid() where appropriate 2018-01-11 15:12:16 +01:00
Lennart Poettering 007e4b5490 manager: make use of NEWLINE macro where appropriate 2018-01-11 15:12:16 +01:00