platform/upstream/systemd.git
6 years agomeson: add support for building static libsystemd and libudev
Davide Cavalca [Mon, 9 Apr 2018 09:43:35 +0000 (02:43 -0700)]
meson: add support for building static libsystemd and libudev

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
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
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()
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
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
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
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
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
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
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
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
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
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
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
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
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

6 years agosysusers: fix memory leak when /etc/passwd contains multiple identical lines
Lennart Poettering [Wed, 18 Apr 2018 15:58:53 +0000 (17:58 +0200)]
sysusers: fix memory leak when /etc/passwd contains multiple identical lines

Fixes: #8718

6 years agouid-range: remove spurious newline
Lennart Poettering [Wed, 18 Apr 2018 15:58:15 +0000 (17:58 +0200)]
uid-range: remove spurious newline

6 years agoMerge pull request #8709 from poettering/format-table
Lennart Poettering [Wed, 18 Apr 2018 14:20:13 +0000 (16:20 +0200)]
Merge pull request #8709 from poettering/format-table

generic table formatter

6 years agopath-lookup: properly chase paths when reducing with root dir (#8750)
Lennart Poettering [Wed, 18 Apr 2018 14:19:46 +0000 (16:19 +0200)]
path-lookup: properly chase paths when reducing with root dir (#8750)

Let's make this correct.

6 years agoutil-lib: introduce new empty_or_root() helper (#8746)
Lennart Poettering [Wed, 18 Apr 2018 12:20:49 +0000 (14:20 +0200)]
util-lib: introduce new empty_or_root() helper (#8746)

We check the same condition at various places. Let's add a trivial,
common helper for this, and use it everywhere.

It's not going to make things much faster or much shorter, but I think a
lot more readable

6 years agonamespace: rework how we resolve symlinks in mount points
Lennart Poettering [Wed, 4 Apr 2018 08:14:43 +0000 (10:14 +0200)]
namespace: rework how we resolve symlinks in mount points

Before this patch we'd resolve all symlinks of bind mounts and other
mount points to establish for a service in advance, and only then start
mounting them. This is problematic, if symlink chains jump around
between directories in a namespace tree, so that to resolve a specific
symlink chain we need to establish another mount already. A typical case
where this happens is if /etc/resolv.conf is a symlink to some file in
/run: in that case we'd normally resolve and mount /etc/resolv.conf
early on, but that's broken, as to do this properly we'd need to resolve
/etc/resolv.conf first, then figure out that /run needs to be mounted
before we can proceed, and thus reorder the order in which we apply
mounts dynamically.

With this change, whenever we are about to apply a mount, we'll do a
single step of the symlink normalization process, patch the mount entry
accordingly, and then sort the list of mounts to establish again, taking
the new path into account. This means that we can correctly deal with
the example above: we might start with wanting to mount /etc/resolv.conf
early, but after resolving it to the path in /run/ we'd push it to the
end of the list, ensuring that /run is mounted first.

(Note that this also fixes another bug: we were following symlinks on
the bind mount source relative to the root directory of the service,
rather than of the host. That's wrong though as we explicitly document
tha the source of bind mounts is always on the host.)

6 years agonamespace: improve logging when creating mount source nodes
Lennart Poettering [Wed, 4 Apr 2018 09:12:49 +0000 (11:12 +0200)]
namespace: improve logging when creating mount source nodes

6 years agonamespace: split out calls to normalize mount entry list into new function
Lennart Poettering [Wed, 4 Apr 2018 09:03:21 +0000 (11:03 +0200)]
namespace: split out calls to normalize mount entry list into new function

6 years agonamespace: don't consider raw image read-only if /home in it is writable
Lennart Poettering [Wed, 4 Apr 2018 08:14:25 +0000 (10:14 +0200)]
namespace: don't consider raw image read-only if /home in it is writable

6 years agofs-util: export how many iterations chase_symlinks() executes at max
Lennart Poettering [Wed, 4 Apr 2018 15:06:12 +0000 (17:06 +0200)]
fs-util: export how many iterations chase_symlinks() executes at max

6 years agofs-util: add new CHASE_STEP flag to chase_symlinks()
Lennart Poettering [Wed, 4 Apr 2018 15:03:45 +0000 (17:03 +0200)]
fs-util: add new CHASE_STEP flag to chase_symlinks()

If the flag is set only a single step of the normalization is executed,
and the resulting path is returned.

This allows callers to normalize piecemeal, taking into account every
single intermediary path of the normalization.

6 years agoupdate TODO
Lennart Poettering [Wed, 18 Apr 2018 10:42:22 +0000 (12:42 +0200)]
update TODO

6 years agotest-locale-util: show special glyphs
Zbigniew Jędrzejewski-Szmek [Wed, 18 Apr 2018 08:53:25 +0000 (10:53 +0200)]
test-locale-util: show special glyphs

This is mostly useful as a sanity check.

6 years agotest-utf8: add a smoke test for utf8_console_width()
Zbigniew Jędrzejewski-Szmek [Wed, 18 Apr 2018 08:57:01 +0000 (10:57 +0200)]
test-utf8: add a smoke test for utf8_console_width()

6 years agologinctl: port loginctl to format-table.[ch]
Lennart Poettering [Wed, 11 Apr 2018 19:37:38 +0000 (21:37 +0200)]
loginctl: port loginctl to format-table.[ch]

6 years agomachinectl: port machinectl to format-table.[ch]
Lennart Poettering [Wed, 11 Apr 2018 18:12:52 +0000 (20:12 +0200)]
machinectl: port machinectl to format-table.[ch]

6 years agobasic: add minimalistic table formatter
Lennart Poettering [Wed, 11 Apr 2018 18:03:39 +0000 (20:03 +0200)]
basic: add minimalistic table formatter

We have plenty of code in our codebase that outputs tables to the
console, and all is homegrown and awful. Let's replace it with a generic
implementation that can do automatically what the old implementations
did manually.

Features:

1. Ellipsation (for fields overly long) and alignment (for
   fields overly short)

2. Sorting of rows

3. automatically copies formatting from the same cell in the row above

4. Heavy use of varargs to make putting together tables easy

5. can expand and compress tables, with weights

6. Has a minimal understanding of unicode wide characters in order to
   match unicode strings to character cell terminals.

7. Columns can be reordered and individually turned off.

8. pretty printing for various data types

And more.