]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
6 years agonetwork: recreate link if its interface name is changed (#8795)
Yu Watanabe [Thu, 26 Apr 2018 19:05:32 +0000 (04:05 +0900)] 
network: recreate link if its interface name is changed (#8795)

If an interface name is changed, then the link state, especially
managed or not, may need to be updated, as its corresponding
.link or .network files may be different. So, let's once drop
the link and recreate a new link object.

Fixes #8794.

6 years agoMerge pull request #8776 from poettering/mtu-cleanup
Lennart Poettering [Thu, 26 Apr 2018 19:02:55 +0000 (21:02 +0200)] 
Merge pull request #8776 from poettering/mtu-cleanup

networkd/udev: clean up parsing and handling of MTU values

6 years agohwdb: add "special" keys on Dell XPS L702x (#8828)
Zbigniew Jędrzejewski-Szmek [Thu, 26 Apr 2018 18:31:11 +0000 (20:31 +0200)] 
hwdb: add "special" keys on Dell XPS L702x (#8828)

Based on information provided by phenest in
https://github.com/systemd/systemd/issues/5341.

Those keys map to some special functions in windows, so let's map them
to prog1/prog2 so the user map them to something.

Fixes #5341.

6 years agocore: an empty string resets delegate controllers but enables Delegate= (#8826)
Yu Watanabe [Thu, 26 Apr 2018 13:40:45 +0000 (22:40 +0900)] 
core: an empty string resets delegate controllers but enables Delegate= (#8826)

This partially reverts ff1b8455c26b560641d476b426209e297209333a.

6 years agolink: follow our rule of suffix settings with = in log messages 8776/head
Lennart Poettering [Fri, 20 Apr 2018 14:36:56 +0000 (16:36 +0200)] 
link: follow our rule of suffix settings with = in log messages

6 years agonetworkd,udev: clean up MTU handling
Lennart Poettering [Fri, 20 Apr 2018 14:33:00 +0000 (16:33 +0200)] 
networkd,udev: clean up MTU handling

This cleans up handling of MTU values across the codebase. Previously
MTU values where stored sometimes in uint32_t, sometimes in uint16_t,
sometimes unsigned and sometimes in size_t. This now unifies this to
uint32_t across the codebase, as that's what netlink spits out, and what
the majority was already using.

Also, all MTU parameters are now parsed with config_parse_mtu() and
config_parse_ipv6_mtu() is dropped as it is now unneeded.

(Note there is one exception for the MTU typing: in the DCHPv4 code we
continue to process the MTU as uint16_t value, as it is encoded like
that in the protocol, and it's probably better stay close to the
protocol there.)

6 years agoconf-parse: add a generic config_parse_mtu() conf file parser function
Lennart Poettering [Fri, 20 Apr 2018 14:31:17 +0000 (16:31 +0200)] 
conf-parse: add a generic config_parse_mtu() conf file parser function

It's mostly a wrapper around parse_mtu() but with some nicer logging.

The address family is initialized from the "ltype" parameter, so that
configuration file parser tables can be easily declare it.

6 years agoparse-util: add explicit parsers for MTU values
Lennart Poettering [Fri, 20 Apr 2018 14:28:12 +0000 (16:28 +0200)] 
parse-util: add explicit parsers for MTU values

We use MTUs all over the place, let's add a unified, strict parser for
it, that takes MTU ranges into account.

We already have parse_ifindex() close-by, hence this appears to be a
natural addition, in particular as the range checking is not entirely
trivial to do, as it depends on the protocol used.

6 years agomissing: add IPV4_MIN_MTU
Lennart Poettering [Fri, 20 Apr 2018 14:18:09 +0000 (16:18 +0200)] 
missing: add IPV4_MIN_MTU

Similar to IPV6_MIN_MTU, let's add the same for IPv4.

6 years agonetworkd: drop duplicate definition of IPV6_MIN_MTU
Lennart Poettering [Fri, 20 Apr 2018 14:17:45 +0000 (16:17 +0200)] 
networkd: drop duplicate definition of IPV6_MIN_MTU

We already have it in missing.h, and once suffices.

6 years agocgroup-util: fix enabling of controllers (#8816)
Antique [Thu, 26 Apr 2018 10:37:35 +0000 (12:37 +0200)] 
cgroup-util: fix enabling of controllers (#8816)

If enabling controller for some reason fails we need to clear error
for the FILE stream.  Enabling remaining controllers would otherwise
fail because write_string_stream_ts() checks for ferror(f) and returns
-EIO if there is one.

Broken by commit <77fa610b22>.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agomeson: drop 'name' argument in cc.has_argument() (#8823)
Yu Watanabe [Thu, 26 Apr 2018 08:53:10 +0000 (17:53 +0900)] 
meson: drop 'name' argument in cc.has_argument() (#8823)

This fixes the following warning with clang and meson-0.46.0,
```
WARNING: Passed invalid keyword argument "name".
WARNING: This will become a hard error in the future.
WARNING: Passed invalid keyword argument "name".
WARNING: This will become a hard error in the future.
Compiler for C supports arguments -Wno-typedef-redefinition: YES
WARNING: Passed invalid keyword argument "name".
WARNING: This will become a hard error in the future.
WARNING: Passed invalid keyword argument "name".
WARNING: This will become a hard error in the future.
Compiler for C supports arguments -Wno-gnu-variable-sized-type-not-at-end: YES
```

6 years agoman: fix description of --value option for loginctl (#8820)
Yu Watanabe [Thu, 26 Apr 2018 07:51:11 +0000 (16:51 +0900)] 
man: fix description of --value option for loginctl (#8820)

6 years agoMerge pull request #8812 from keszybz/gpt-auto-memleak
Lennart Poettering [Wed, 25 Apr 2018 13:46:57 +0000 (15:46 +0200)] 
Merge pull request #8812 from keszybz/gpt-auto-memleak

gpt-auto-generator: use stack variables and fix minor memleak

6 years agomeson: do not link libsystemd_static into libcore (#8813)
Zbigniew Jędrzejewski-Szmek [Wed, 25 Apr 2018 11:47:18 +0000 (13:47 +0200)] 
meson: do not link libsystemd_static into libcore (#8813)

(or in terms of the names of the actual files on disk, do not link
libsystemd-shared-238.a into libcore.a).

libsystemd_static is linked into libsystemd_shared, which in turn means that
anything that links to libcore and libsystemd_shared will get libsystemd_static
twice:

$ cc -o systemd 'systemd@exe/src_core_main.c.o' -Wl,--no-undefined -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -pie -DVALGRIND -Wl,--start-group src/core/libcore.a src/shared/libsystemd-shared-238.a src/shared/libsystemd-shared-238.so -pthread -lrt -lseccomp -lselinux -lmount -lblkid -Wl,--end-group -lseccomp -lpam -L/lib64 -laudit -lkmod -lmount -lrt -lcap -lacl -lcryptsetup -lgcrypt -lip4tc -lip6tc -lseccomp -lselinux -lidn -llzma -llz4 -lblkid '-Wl,-rpath,$ORIGIN/src/shared' -Wl,-rpath-link,/home/zbyszek/src/systemd/build/src/shared

This propagation of the dependency seems correct (in the sense that meson is
doing the expected thing based on the given configuration). Linking was done
this way in the original meson conversion. I was probably trying to get
everything to compile and link, I'm not sure why this particular choice was
made. In the meantime, meson has gotten better at propagating dependencies, so
it's possible that this had slightly different effect in the original
conversion, but I did not verify this. Either way, I think we should drop this.

With the patch:
$ cc -o systemd 'systemd@exe/src_core_main.c.o' -Wl,--no-undefined -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -pie -DVALGRIND -Wl,--start-group src/core/libcore.a src/shared/libsystemd-shared-238.so -pthread -lrt -lseccomp -lselinux -lmount -Wl,--end-group -lblkid -lrt -lseccomp -lpam -L/lib64 -laudit -lkmod -lselinux -lmount '-Wl,-rpath,$ORIGIN/src/shared' -Wl,-rpath-link,/home/zbyszek/src/systemd/build/src/shared

This is more correct because we're not linking the same code twice.
With the patch, libystemd_static is used in exactly four places:
- src/shared/libsystemd-shared-238.so
- src/udev/libudev.so.1.6.10
- pam_systemd.so
- test-bus-error
(compared to a bunch more executables before, including systemd,
systemd-analyze, test-hostname, test-ns, etc.)

Size savings are also noticable:

$ size /var/tmp/inst?/usr/lib/systemd/libsystemd-shared-238.so
   text    data     bss     dec     hex filename
2397826  578488   15920 2992234  2da86a /var/tmp/inst1/usr/lib/systemd/libsystemd-shared-238.so
2397826  578488   15920 2992234  2da86a /var/tmp/inst2/usr/lib/systemd/libsystemd-shared-238.so

$ size /var/tmp/inst?/usr/lib/systemd/systemd
   text    data     bss     dec     hex filename
1858790  261688    9320 2129798  207f86 /var/tmp/inst1/usr/lib/systemd/systemd
1556358  258704    8072 1823134  1bd19e /var/tmp/inst2/usr/lib/systemd/systemd

$ du -s /var/tmp/inst?
52216 /var/tmp/inst1
50844 /var/tmp/inst2

https://github.com/google/oss-fuzz/issues/1330#issuecomment-384054530 might be related.

6 years agotree-wide: drop redundant _cleanup_ macros (#8810)
Lennart Poettering [Wed, 25 Apr 2018 10:31:45 +0000 (12:31 +0200)] 
tree-wide: drop redundant _cleanup_ macros (#8810)

This drops a good number of type-specific _cleanup_ macros, and patches
all users to just use the generic ones.

In most recent code we abstained from defining type-specific macros, and
this basically removes all those added already, with the exception of
the really low-level ones.

Having explicit macros for this is not too useful, as the expression
without the extra macro is generally just 2ch wider. We should generally
emphesize generic code, unless there are really good reasons for
specific code, hence let's follow this in this case too.

Note that _cleanup_free_ and similar really low-level, libc'ish, Linux
API'ish macros continue to be defined, only the really high-level OO
ones are dropped. From now on this should really be the rule: for really
low-level stuff, such as memory allocation, fd handling and so one, go
ahead and define explicit per-type macros, but for high-level, specific
program code, just use the generic _cleanup_() macro directly, in order
to keep things simple and as readable as possible for the uninitiated.

Note that before this patch some of the APIs (notable libudev ones) were
already used with the high-level macros at some places and with the
generic _cleanup_ macro at others. With this patch we hence unify on the
latter.

6 years agogpt-auto-generator: emit warnings and fail if we fail to query mount points 8812/head
Zbigniew Jędrzejewski-Szmek [Wed, 25 Apr 2018 08:06:23 +0000 (10:06 +0200)] 
gpt-auto-generator: emit warnings and fail if we fail to query mount points

Right now gpt-auto-generator will iterate through all mount entries, and
silently ignore failure to check if the mount point target is empty.
This can hide real errors (in particular from MAC), so instead let's warn
and return failure at the end if this happens. We will still iterate
over other candidates, so there should be no change in behaviour.

Logging is moved into path_is_busy() to avoid the duplication of the same
logging code in the two callers.

6 years agogpt-auto-generator: use stack variables and fix minor memleak
Zbigniew Jędrzejewski-Szmek [Wed, 25 Apr 2018 07:45:28 +0000 (09:45 +0200)] 
gpt-auto-generator: use stack variables and fix minor memleak

6 years agoMerge pull request #8807 from ChrisLesiak/systemd-update-done-mtime-fix
Lennart Poettering [Wed, 25 Apr 2018 00:14:54 +0000 (02:14 +0200)] 
Merge pull request #8807 from ChrisLesiak/systemd-update-done-mtime-fix

fileio.c: fix incorrect mtime

6 years agoMerge pull request #8775 from poettering/strip-cso
Zbigniew Jędrzejewski-Szmek [Tue, 24 Apr 2018 18:57:56 +0000 (20:57 +0200)] 
Merge pull request #8775 from poettering/strip-cso

teach strip_tab_ansi() to strip ANSI CSO sequences

6 years agoMerge pull request #8802 from keszybz/errno-reform
Lennart Poettering [Tue, 24 Apr 2018 18:25:27 +0000 (20:25 +0200)] 
Merge pull request #8802 from keszybz/errno-reform

Errno reform

6 years agofileio.c: fix incorrect mtime 8807/head
Chris Lesiak [Tue, 24 Apr 2018 14:50:42 +0000 (09:50 -0500)] 
fileio.c: fix incorrect mtime

A regression was introduced that caused the mtime of /etc/.updated
and /var/.updated to be the current time when systemd-update-done
ran instead of being copied from /usr.

This was nearly fixed, but due to fflush being called after mtime
was carefully set, it was overwritten with the current time.

Regression introduced in 872c40396384f9fa89b01baf4e739d28ed590299

A fix was just missed in 39c38d773fbe2b4f76ff29ecd3344640efb9a86c

Fixes #8806

6 years agoMerge pull request #8800 from keszybz/trivialities
Lennart Poettering [Tue, 24 Apr 2018 15:30:07 +0000 (17:30 +0200)] 
Merge pull request #8800 from keszybz/trivialities

Trivial cleanups

6 years agoMerge pull request #8801 from fbuihuu/tmpfiles-fixes
Lennart Poettering [Tue, 24 Apr 2018 15:29:10 +0000 (17:29 +0200)] 
Merge pull request #8801 from fbuihuu/tmpfiles-fixes

Tmpfiles fixes

6 years agoupdate TODO 8775/head
Lennart Poettering [Fri, 20 Apr 2018 13:22:02 +0000 (15:22 +0200)] 
update TODO

6 years agostring-util: use fflush_and_check() where appropriate
Lennart Poettering [Fri, 20 Apr 2018 13:22:29 +0000 (15:22 +0200)] 
string-util: use fflush_and_check() where appropriate

6 years agostring-util: teach strip_tab_ansi() to deal with CSO sequences
Lennart Poettering [Fri, 20 Apr 2018 13:16:13 +0000 (15:16 +0200)] 
string-util: teach strip_tab_ansi() to deal with CSO sequences

With the recent terminal_urlify() APIs we'll now sometimes generate
clickable link CSO sequences. Hence we should also be able to remove
them again from strings. This beefs up the logic to do so.

Follow-up for: 23b27b39d2a3a002ad827a2e8a9872a51495d797

6 years agobasic/log: do not use global errno in log_*_errno() 8802/head
Zbigniew Jędrzejewski-Szmek [Tue, 24 Apr 2018 11:57:38 +0000 (13:57 +0200)] 
basic/log: do not use global errno in log_*_errno()

Quoting https://github.com/systemd/systemd/pull/8760#discussion_r183321060:

> When we originally added the errno patching we went for a "best of both
> worlds" approach, i.e. that we override errno if an error is specified, but
> if no error is specified (i.e. 0 is passed as error code) then we use the
> previously set errno, similar in style how plain `printf()` would do it. In
> retrospect I think we almost never purposefully made use of the second,
> i.e. the plain `printf()` logic, but we multiple times ran into this case
> accidentally and introduced a bug. Hence yes, it probably makes sense to
> switch this over, and consistently ignore the `errno` already set and always
> override it with the error passed in. The only problem I see with that is: I
> wonder if there might be a case or two lurking somewhere where we actually
> made use of the "best of both worlds" approach, and if so, if we can detect
> where... (But then again, even if there is, and we fail to find those cases,
> maybe that's not all bad, as it's just a few new bugs against probably fixing
> many more old and future bugs, if you follow what I mean).

I scanned our codebase, and found some bugs in the value passed to log_*_errno,
but no intentional cases of error=0 being passed.

6 years agocore/device: avoid bogus errno use and invert ratelimit_test()
Zbigniew Jędrzejewski-Szmek [Tue, 24 Apr 2018 11:50:46 +0000 (13:50 +0200)] 
core/device: avoid bogus errno use and invert ratelimit_test()

I'm not sure if I understand the original code. AFAICS, errno does not
have to be set at all in this callback.

ratelimit_test() returns positive if we are under limit. The code would only
log if the condition happened very often, which I assume is not inteded, and
this check was supposed to prevent too much logging.

6 years agosd-lldp: eliminate unnecessary variable
Zbigniew Jędrzejewski-Szmek [Tue, 24 Apr 2018 11:47:20 +0000 (13:47 +0200)] 
sd-lldp: eliminate unnecessary variable

6 years agobasic/audit-util: always log the reason when disabling audit logs
Zbigniew Jędrzejewski-Szmek [Tue, 24 Apr 2018 11:46:58 +0000 (13:46 +0200)] 
basic/audit-util: always log the reason when disabling audit logs

This state is cached, and it's seems OK to log at least once.

6 years agoFix three uses of bogus errno value in logs (and returned value in one case)
Zbigniew Jędrzejewski-Szmek [Tue, 24 Apr 2018 11:45:44 +0000 (13:45 +0200)] 
Fix three uses of bogus errno value in logs (and returned value in one case)

6 years agotree-wide: avoid assignment of r just to use in a comparison
Zbigniew Jędrzejewski-Szmek [Tue, 24 Apr 2018 11:44:09 +0000 (13:44 +0200)] 
tree-wide: avoid assignment of r just to use in a comparison

This changes
  r = ...;
  if (r < 0)
to
  if (... < 0)
when r will not be used again.

6 years agoRevert "bus-unit-util: fix bus_wait_for_jobs() debug output (#8760)"
Zbigniew Jędrzejewski-Szmek [Tue, 24 Apr 2018 10:13:46 +0000 (12:13 +0200)] 
Revert "bus-unit-util: fix bus_wait_for_jobs() debug output (#8760)"

This reverts commit d6b87637c52148f5861aca557de2711dcd0c2efd.

Let's try a different approach.

6 years agotmpfiles: 'e' is supposed to accept shell-style globs 8801/head
Franck Bui [Tue, 24 Apr 2018 10:24:38 +0000 (12:24 +0200)] 
tmpfiles: 'e' is supposed to accept shell-style globs

6 years agotmpfiles: 'e' is supposed to operate on directory only
Franck Bui [Tue, 24 Apr 2018 10:23:29 +0000 (12:23 +0200)] 
tmpfiles: 'e' is supposed to operate on directory only

6 years agosystemd-hwdb: reflow help() to avoid a line break 8800/head
Zbigniew Jędrzejewski-Szmek [Tue, 24 Apr 2018 10:11:10 +0000 (12:11 +0200)] 
systemd-hwdb: reflow help() to avoid a line break

6 years agoCGROUP_DELEGATION: typo and grammar fixes
Zbigniew Jędrzejewski-Szmek [Tue, 24 Apr 2018 10:07:34 +0000 (12:07 +0200)] 
CGROUP_DELEGATION: typo and grammar fixes

6 years agofs-util: introduce fchmod_opath()
Franck Bui [Wed, 11 Apr 2018 14:58:49 +0000 (16:58 +0200)] 
fs-util: introduce fchmod_opath()

fchmod(2) still doesn't take file descriptors opened with O_PATH.

6 years agotmpfiles: remove spurious curly braces in create_item()
Franck Bui [Thu, 12 Apr 2018 10:18:19 +0000 (12:18 +0200)] 
tmpfiles: remove spurious curly braces in create_item()

6 years agocore/manager: make manager_enumerate() static
Zbigniew Jędrzejewski-Szmek [Fri, 20 Apr 2018 10:12:11 +0000 (12:12 +0200)] 
core/manager: make manager_enumerate() static

6 years agocore/manager: trivial simplification
Zbigniew Jędrzejewski-Szmek [Fri, 20 Apr 2018 10:10:32 +0000 (12:10 +0200)] 
core/manager: trivial simplification

6 years agonspawn: fix copy/reflink fallback when directory already exists (#8781)
Milan [Tue, 24 Apr 2018 09:38:08 +0000 (11:38 +0200)] 
nspawn: fix copy/reflink fallback when directory already exists (#8781)

6 years agoMerge pull request #8796 from yuwata/remove-unused-variables
Lennart Poettering [Tue, 24 Apr 2018 09:37:44 +0000 (11:37 +0200)] 
Merge pull request #8796 from yuwata/remove-unused-variables

Remove unused variables

6 years agotest: drop unused variables 8796/head
Yu Watanabe [Tue, 24 Apr 2018 06:43:09 +0000 (15:43 +0900)] 
test: drop unused variables

Follow-up for 49eb36596b72e568d4b9b785cd4544e58c89bdee.

6 years agologin: drop an unused variable
Yu Watanabe [Tue, 24 Apr 2018 06:42:00 +0000 (15:42 +0900)] 
login: drop an unused variable

Follow-up for 99f1229d76da4b805f8f6c6e5e4a878d17d42f93.

6 years agoman/os-release: Document that blank lines are permitted (#8777)
Paul Menzel [Mon, 23 Apr 2018 09:03:16 +0000 (11:03 +0200)] 
man/os-release: Document that blank lines are permitted (#8777)

Fixes: https://github.com/systemd/systemd/issues/8773
6 years agohwdb: Add accelerometer orientation quirk for the Linx 1010B tablet (#8784)
Paul Milliken [Mon, 23 Apr 2018 08:49:54 +0000 (09:49 +0100)] 
hwdb: Add accelerometer orientation quirk for the Linx 1010B tablet (#8784)

6 years agohwdb: Use wlan keycode for all Dell systems (#8762)
Kai-Heng Feng [Mon, 23 Apr 2018 08:23:03 +0000 (16:23 +0800)] 
hwdb: Use wlan keycode for all Dell systems (#8762)

Once the seat is acquired, gnome-settings-daemon (GSD) takes full
control of rfkill by sending RFKILL_IOCTL_NOINPUT ioctl to disable
rfkill control in kernel.

Since GSD expects wlan keycode when the hotkey gets pressed, we should
change the "unknown" to "wlan" accordingly.

Tested under both GNOME and KDE.

6 years agodoc: add $SYSTEMD_TIMEDATED_NTP_SERVICES= in ENVIRONMENT.md (#8785)
Yu Watanabe [Mon, 23 Apr 2018 08:14:15 +0000 (17:14 +0900)] 
doc: add $SYSTEMD_TIMEDATED_NTP_SERVICES= in ENVIRONMENT.md (#8785)

6 years agobus-message: use streq_ptr() (#8786)
Yu Watanabe [Mon, 23 Apr 2018 08:13:26 +0000 (17:13 +0900)] 
bus-message: use streq_ptr() (#8786)

6 years agopo: update Turkish translation (#8783)
Muhammet Kara [Mon, 23 Apr 2018 08:12:03 +0000 (11:12 +0300)] 
po: update Turkish translation (#8783)

6 years agoMerge pull request #8520 from drinkcat/upstream-udevadm
Zbigniew Jędrzejewski-Szmek [Mon, 23 Apr 2018 07:37:17 +0000 (09:37 +0200)] 
Merge pull request #8520 from drinkcat/upstream-udevadm

udevadm/hwdb: Return non-zero exit code on error

6 years agohoestnamed: Also parse HOME_URL from /usr/lib/os-release (#8779)
Mario Limonciello [Mon, 23 Apr 2018 07:24:39 +0000 (02:24 -0500)] 
hoestnamed: Also parse HOME_URL from /usr/lib/os-release (#8779)

64928aa54520b8cad3cda14d7aab0f4f59409acf added parsing to
/etc/os-release.

6 years agoMerge pull request #8675 from fbuihuu/make-sure-device-enter-in-plugged-state
Zbigniew Jędrzejewski-Szmek [Mon, 23 Apr 2018 07:14:42 +0000 (09:14 +0200)] 
Merge pull request #8675 from fbuihuu/make-sure-device-enter-in-plugged-state

device: make sure to always retroactively start device dependencies

6 years agoMerge pull request #8769 from keszybz/followups
Yu Watanabe [Mon, 23 Apr 2018 01:24:39 +0000 (10:24 +0900)] 
Merge pull request #8769 from keszybz/followups

Three trivial followups for recent patches

6 years agobus-unit-util: fix bus_wait_for_jobs() debug output (#8760)
Lennart Poettering [Mon, 23 Apr 2018 00:24:43 +0000 (02:24 +0200)] 
bus-unit-util: fix bus_wait_for_jobs() debug output (#8760)

We shouldn't print 'errno' if its not initialized properly.

6 years agosystemd-hwdb update: Return non-zero exit code on error when --strict is used 8520/head
Nicolas Boichat [Tue, 27 Mar 2018 03:24:01 +0000 (11:24 +0800)] 
systemd-hwdb update: Return non-zero exit code on error when --strict is used

 - Add a new flag --strict to tell systemd-hwdb to return a
   non-zero code on error.
 - Make systemd-hwdb update return an error when any parsing
   error occurs (only if strict flag is set).

6 years agoudevadm/hwdb: Return non-zero exit code on error when --strict is used
Nicolas Boichat [Tue, 20 Mar 2018 05:36:58 +0000 (13:36 +0800)] 
udevadm/hwdb: Return non-zero exit code on error when --strict is used

 - Add a new flag --strict to tell udevadm hwdb to return a
   non-zero code on error.
 - Make udevadm hwdb --update return an error when any parsing
   error occurs (only if strict flag is set).

6 years agoMerge pull request #8778 from poettering/cgroup-delegation-doc
Lennart Poettering [Fri, 20 Apr 2018 18:24:10 +0000 (20:24 +0200)] 
Merge pull request #8778 from poettering/cgroup-delegation-doc

some docs regarding cgroup delegation and systemd

6 years agodoc: add a bit more documentation about systemd and cgroups and cgroupsv2 and delegation 8778/head
Lennart Poettering [Fri, 20 Apr 2018 16:10:04 +0000 (18:10 +0200)] 
doc: add a bit more documentation about systemd and cgroups and cgroupsv2 and delegation

Ultimately we should replace the relevant wiki texts with documentation
maintained as part of our project tree. This is a start. It can't
replace the wiki documentation in full yet, but I think it's already
very useful.

6 years agoupdate TODO
Lennart Poettering [Fri, 20 Apr 2018 16:09:53 +0000 (18:09 +0200)] 
update TODO

6 years agodevice: skip deserialization of device units when udevd is not running 8675/head
Franck Bui [Tue, 17 Apr 2018 13:12:06 +0000 (15:12 +0200)] 
device: skip deserialization of device units when udevd is not running

Do not try to party initialize a device during deserialization if it's not
known by udev (anymore) and therefore hasn't been seen during device
enumeration.

The device unit in this case has not been initialized properly and setting it
in the "plugged" state can be confusing.

Actually this happens during every boots when PID switches to the new rootfs:
PID is reexecuted and enumerates devices but since udev is not running, the
list of enumerated devices is empty.

6 years agodevice: make sure to always retroactively start device dependencies
Franck Bui [Fri, 6 Apr 2018 13:02:10 +0000 (15:02 +0200)] 
device: make sure to always retroactively start device dependencies

PID1 updates the state of device units upon 2 different events:

 - when it processes an event sent by udev and in this case the device deps are
   started if the device enters in the "plugged" state.

 - when it enumerates all devices during its startup or when it is asked to
   reload its configuration data but in this case the device deps (if any) are
   not retroactively started.

When udev processes a new "add" kernel event, it first registers the new device
in its databases then sends an event to systemd.

If for any reason, systemd is asked to reload its configuration between the
previous 2 steps, it might see for the first time the new device while scanning
/sys for all devices. Only during a second step, udev will send the event for
the new device.

In this peculiar case the device deps wont be started (even though the device
is first seen by PID1).

Indeed when reloading its configurations, PID1 will put the device unit in the
"plugged" state but without starting the device deps. Thereafter PID1 will get
the event from udev for the new device but the device unit will be in "plugged"
state already therefore it won't see any need to start the device dependencies.

Rather than assuming that during the reloading of systemd manager configuration
all devices listed in udev DBs have been already processed and should be put in
the "plugged" state (done by device_coldplug()), this patch does that only for
devices which have been processed via an udev event (device_dispatch_io())
previously. In this case we set "d->found" to "DEVICE_FOUND_UDEV" and we make
also sure to no more initialize "d->found" while enumerating devices. Instead
this field is now saved/restored while devices are serialized.

6 years agonetworkd: more specific link down while enslaving (#8771)
Tobias Jungel [Fri, 20 Apr 2018 14:30:40 +0000 (16:30 +0200)] 
networkd: more specific link down while enslaving (#8771)

Issue #5853 introduced a link_down for every netdev enslaved. This behaviour is
not required on other slave interfaces.

fixes 14b6bb7

6 years agoman: document the new $SYSTEMD_DEBUGGER variable 8769/head
Zbigniew Jędrzejewski-Szmek [Fri, 20 Apr 2018 09:28:04 +0000 (11:28 +0200)] 
man: document the new $SYSTEMD_DEBUGGER variable

Follow-up for c5896b6a.

6 years agosysusers: use uniform order for variables
Zbigniew Jędrzejewski-Szmek [Fri, 20 Apr 2018 09:14:41 +0000 (11:14 +0200)] 
sysusers: use uniform order for variables

Follow-up for 43e948eea6.

6 years agoremove unused variables (#8768)
Tobias Jungel [Fri, 20 Apr 2018 11:31:17 +0000 (13:31 +0200)] 
remove unused variables (#8768)

clang 5.0 complains with -Wunused-variable

6 years agonetworkd: add support to configure IPv6 MTU (#8664)
Susant Sahani [Fri, 20 Apr 2018 09:38:39 +0000 (15:08 +0530)] 
networkd: add support to configure IPv6 MTU (#8664)

This patch supports to configure IPv6 MTU.

Closes #8632

6 years agonspawn: when running nspawn, set a $PATH including both bin + sbin by default (#8756)
Lennart Poettering [Fri, 20 Apr 2018 09:36:25 +0000 (11:36 +0200)] 
nspawn: when running nspawn, set a $PATH including both bin + sbin by default (#8756)

We don't know what the container payload needs, hence default to a PATH
with both bin and sbin included, as well as / and /usr.

Follow-up for #8324

Fixes: #8698
6 years agoFix typo
Zbigniew Jędrzejewski-Szmek [Fri, 20 Apr 2018 09:09:44 +0000 (11:09 +0200)] 
Fix typo

6 years agoMerge pull request #8754 from poettering/sysusers-fix
Zbigniew Jędrzejewski-Szmek [Thu, 19 Apr 2018 17:39:48 +0000 (19:39 +0200)] 
Merge pull request #8754 from poettering/sysusers-fix

two minor memleak fixes for sysusers, fixing #8718

6 years agoMerge pull request #8767 from poettering/urlify-all-things
Zbigniew Jędrzejewski-Szmek [Thu, 19 Apr 2018 16:56:46 +0000 (18:56 +0200)] 
Merge pull request #8767 from poettering/urlify-all-things

try to generate clickable links in our output if we can

6 years agosystemctl: format unit file and dropin paths as clickable links in status output 8767/head
Lennart Poettering [Thu, 19 Apr 2018 15:54:25 +0000 (17:54 +0200)] 
systemctl: format unit file and dropin paths as clickable links in status output

6 years agosystemctl: format documentation links in status output as clickable links
Lennart Poettering [Thu, 19 Apr 2018 15:53:58 +0000 (17:53 +0200)] 
systemctl: format documentation links in status output as clickable links

6 years agohostnamectl: make the distribution name a pretty clickable link if we can
Lennart Poettering [Thu, 19 Apr 2018 15:52:51 +0000 (17:52 +0200)] 
hostnamectl: make the distribution name a pretty clickable link if we can

6 years agohostnamed: expose HOME_URL os-release field on the bus
Lennart Poettering [Thu, 19 Apr 2018 15:52:22 +0000 (17:52 +0200)] 
hostnamed: expose HOME_URL os-release field on the bus

6 years agoterminal: add internal API to format URLs for display in capable terminals
Lennart Poettering [Thu, 19 Apr 2018 15:48:53 +0000 (17:48 +0200)] 
terminal: add internal API to format URLs for display in capable terminals

Newer terminals (in particular gnome-terminal) understand special escape
sequence for formatting clickable links. Let's support that to make our
tool output more clickable where that's appropriate.

For details see this:

https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda

The one big issue is that 'less' currently doesn't grok this, and
doesn't ignore sequence like regular terminal implementations do if they
don't support it. Hence for now, let's disable URL output if a pager is
used. We should revisit that though as soon as less added support for it
and enough time passed for it to enter various distributions.

6 years agoMerge pull request #8615 from yuwata/fix-1329
Lennart Poettering [Thu, 19 Apr 2018 14:22:50 +0000 (16:22 +0200)] 
Merge pull request #8615 from yuwata/fix-1329

timedated: support multiple NTP services

6 years agoMerge pull request #8765 from poettering/test-fixes
Lennart Poettering [Thu, 19 Apr 2018 14:18:46 +0000 (16:18 +0200)] 
Merge pull request #8765 from poettering/test-fixes

some short fixes for the tests

6 years agoMerge pull request #8623 from yuwata/resolvectl
Zbigniew Jędrzejewski-Szmek [Thu, 19 Apr 2018 10:33:05 +0000 (12:33 +0200)] 
Merge pull request #8623 from yuwata/resolvectl

resolvectl: rename systemd-resolve to resolvectl

6 years agotree-wide: drop spurious newlines (#8764)
Lennart Poettering [Thu, 19 Apr 2018 10:13:23 +0000 (12:13 +0200)] 
tree-wide: drop spurious newlines (#8764)

Double newlines (i.e. one empty lines) are great to structure code. But
let's avoid triple newlines (i.e. two empty lines), quadruple newlines,
quintuple newlines, …, that's just spurious whitespace.

It's an easy way to drop 121 lines of code, and keeps the coding style
of our sources a bit tigther.

6 years agouser-util: trivial coding style fixes 8765/head
Lennart Poettering [Thu, 19 Apr 2018 09:40:48 +0000 (11:40 +0200)] 
user-util: trivial coding style fixes

Use C's downgrade-to-bool feature when comparing pointers against NULL,
as we usually do.

6 years agomkosi: drop dumping all test output to console again
Lennart Poettering [Thu, 19 Apr 2018 09:16:04 +0000 (11:16 +0200)] 
mkosi: drop dumping all test output to console again

As it appears meson's test cases nowadays (?) show useful logs for
failing tests anyway, hence there's no need to show them unconditionally
in full every time anymore. Let's hence simplify and drop this.

6 years agotests: compare with correct shell
Lennart Poettering [Thu, 19 Apr 2018 08:35:36 +0000 (10:35 +0200)] 
tests: compare with correct shell

We synthesize the passwd record for UID 0, hence we need to compare with
our synthesized data and not with the data stored in /etc/passwd

6 years agocore: don't export per-unit metadata files in test mode
Lennart Poettering [Thu, 19 Apr 2018 08:34:58 +0000 (10:34 +0200)] 
core: don't export per-unit metadata files in test mode

We shouldn't clobber the host's /run directories with metadata we export
for our units when we run in test mode.

6 years agomkosi: ensure the 'hostname' tool is available in the build environment
Lennart Poettering [Thu, 19 Apr 2018 08:33:57 +0000 (10:33 +0200)] 
mkosi: ensure the 'hostname' tool is available in the build environment

Our test-execute test uses 'hostname' to validate specifiers, hence it
should be available in our mkosi build too, so that the test can pass.

6 years agoMerge pull request #8758 from keszybz/improved-slice-checks
Lennart Poettering [Thu, 19 Apr 2018 09:28:05 +0000 (11:28 +0200)] 
Merge pull request #8758 from keszybz/improved-slice-checks

Improved slice checks

6 years agocoredumpctl: Add debug as a gdb alias, and add lldb support (closes #8722) (#8744)
Ryan Gonzalez [Wed, 18 Apr 2018 19:32:17 +0000 (14:32 -0500)] 
coredumpctl: Add debug as a gdb alias, and add lldb support (closes #8722) (#8744)

6 years agobash-completion: add completion for resolvectl 8623/head
Yu Watanabe [Wed, 18 Apr 2018 18:26:54 +0000 (03:26 +0900)] 
bash-completion: add completion for resolvectl

6 years agoman: create man page for resolvectl
Yu Watanabe [Wed, 18 Apr 2018 18:25:25 +0000 (03:25 +0900)] 
man: create man page for resolvectl

6 years agoresolvectl: change syntax to use verb_dispatch()
Yu Watanabe [Wed, 11 Apr 2018 01:44:51 +0000 (10:44 +0900)] 
resolvectl: change syntax to use verb_dispatch()

This makes `resolvectl` use the verb style command line, e.g.,
`resolvectl status` or `resolvectl tlsa tcp fedoraproject.org:443`.
For compatibility, if the invocation name is `systemd-resolve`,
then it accepts the old syntax, e.g. `systemd-resolve --status`.

6 years agoresolvectl: rename systemd-resolve to resolvectl
Yu Watanabe [Wed, 18 Apr 2018 18:24:23 +0000 (03:24 +0900)] 
resolvectl: rename systemd-resolve to resolvectl

For the compatibility, `systemd-resolve` will be created as a symbolic
link to `resolvectl`.

6 years agocore: do not allow Delegate= on unsupported unit types 8758/head
Zbigniew Jędrzejewski-Szmek [Wed, 18 Apr 2018 18:06:56 +0000 (20:06 +0200)] 
core: do not allow Delegate= on unsupported unit types

6 years agocore: fix resetting of Delegate= and properly ignore invalid assignment
Zbigniew Jędrzejewski-Szmek [Wed, 18 Apr 2018 17:50:07 +0000 (19:50 +0200)] 
core: fix resetting of Delegate= and properly ignore invalid assignment

The default is false not true. If we say "ignoring" we must return 0.

6 years agoman: don't place nginx socket in /tmp (#8757)
Lennart Poettering [Wed, 18 Apr 2018 16:50:06 +0000 (18:50 +0200)] 
man: don't place nginx socket in /tmp (#8757)

First of all, it's frickin' ugly and wrong, as IPC sockets should be
placed in /run and definitely not under a guessable name under
world-writable /tmp. Secondly, it can't even work as we set
PrivateTmp=yes on the service.

Hence, let's clean up the example, and simply use a socket in /run
instead.

Fixes: #8419
6 years agoMerge pull request #8708 from poettering/namespace-repeat
Lennart Poettering [Wed, 18 Apr 2018 16:46:44 +0000 (18:46 +0200)] 
Merge pull request #8708 from poettering/namespace-repeat

pid1 namespacing fixes

6 years agosysusers: make sure to reset the returned value when EOF is reached in fget*ent_sane...
Franck Bui [Wed, 18 Apr 2018 16:32:21 +0000 (18:32 +0200)] 
sysusers: make sure to reset the returned value when EOF is reached in fget*ent_sane() wrappers (#8737)

To indicate that the there're no more entries, these wrappers return false but
did leave the passed pointed unmodified.

However EOF is not an error and is a very common case so initialize the output
argument to NULL even in this case so callers don't need to do that.

Fixes: #8721
6 years agosysusers: fix minor memory leak 8754/head
Lennart Poettering [Wed, 18 Apr 2018 15:59:35 +0000 (17:59 +0200)] 
sysusers: fix minor memory leak

6 years agosysusers: clarify that we knowingly ignore process_items() return values
Lennart Poettering [Wed, 18 Apr 2018 15:59:22 +0000 (17:59 +0200)] 
sysusers: clarify that we knowingly ignore process_items() return values