]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
5 years agoMinor grammar changes
Josh Soref [Fri, 20 Jul 2018 19:40:15 +0000 (15:40 -0400)] 
Minor grammar changes

mostly inserting / removing commas / periods as appropriate.
occasionally fixing duplicated words, proper brand case, and singular/plurals.

5 years agoMerge pull request #9671 from keszybz/tasks-max-doc
Lennart Poettering [Fri, 20 Jul 2018 18:05:45 +0000 (20:05 +0200)] 
Merge pull request #9671 from keszybz/tasks-max-doc

Document user@.service and friends

5 years agoman: add a description of user@.service, user-runtime-dir@.service, user-*.slice 9671/head
Zbigniew Jędrzejewski-Szmek [Fri, 20 Jul 2018 13:49:57 +0000 (15:49 +0200)] 
man: add a description of user@.service, user-runtime-dir@.service, user-*.slice

Fixes #9590.

5 years agoman: split systemd.special(7) into separate system/user sections
Zbigniew Jędrzejewski-Szmek [Thu, 19 Jul 2018 16:45:23 +0000 (18:45 +0200)] 
man: split systemd.special(7) into separate system/user sections

User units were in the middle, which is just confusing. Let's discuss
all system units first, and all user units second.

I'm using "System manager units" and "user manager units" instead of the more
obvious "system units" and "user units", because there are also units like
"user@.service".

5 years agotests: prefer MS_SLAVE over MS_PRIVATE for turning off mount propagation
Lennart Poettering [Fri, 20 Jul 2018 13:33:48 +0000 (15:33 +0200)] 
tests: prefer MS_SLAVE over MS_PRIVATE for turning off mount propagation

When we open our own little namespace for running our tests in, let's
turn off mount propagation only one way, rather than both ways. This is
better as this means we don't pin host mounts unnecessarily long in our
namespace, even though the host already got rid of them. This is because
MS_SLAVE in contrast to MS_PRIVATE allows umount events to propagate
from the host into our environment.

5 years agoVarious accountings are not implied by their controllers
Ryutaroh Matsumoto [Fri, 20 Jul 2018 11:37:54 +0000 (20:37 +0900)] 
Various accountings are not implied by their controllers

The original manpage says "Implies BBBAccounting" many times but actually that accounting is not implied by the respective resource control in v239 with the unified cgroup hierarchy. This commit removes those false explanations.

5 years agoupdate TODO
Lennart Poettering [Fri, 20 Jul 2018 14:38:53 +0000 (16:38 +0200)] 
update TODO

5 years agoMerge pull request #9500 from zsol/append
Lennart Poettering [Fri, 20 Jul 2018 13:45:08 +0000 (15:45 +0200)] 
Merge pull request #9500 from zsol/append

Add support for opening files for appending

5 years agocore: remove support for API bus "started outside our own logic"
Alan Jenkins [Thu, 21 Jun 2018 13:12:30 +0000 (14:12 +0100)] 
core: remove support for API bus "started outside our own logic"

Looking at a recent Bad Day, my log contains over 100 lines of

    systemd[23895]: Failed to connect to API bus: Connection refused

It is due to "systemd --user" retrying to connect to an API bus.[*]  I
would prefer to avoid spamming the logs.  I don't think it is good for us
to retry so much like this.

systemd was mislead by something setting DBUS_SESSION_BUS_ADDRESS.  My best
guess is an unfortunate series of events caused gdm to set this.  gdm has
code to start a session dbus if there is not a bus available already (and
in this case it exports the environment variable).  I believe it does not
normally do this when running under systemd, because "systemd --user" and
hence "dbus.service" would already have been started by pam_systemd.

I see two possibilities

1. Rip out the check for DBUS_SESSION_BUS_ADDRESS entirely.
2. Only check for DBUS_SESSION_BUS_ADDRESS on startup.  Not in the
   "recheck" logic.

The justification for 2), is that the recheck is called from unit_notify(),
this is used to check whether the service just started (or stopped) was
"dbus.service".  This reason for rechecking does not apply if we think
the session bus was started outside our logic.

But I think we can justify 1).  dbus-daemon ships a statically-enabled
/usr/lib/systemd/user/dbus.service, which would conflict with an attempt to
use an external dbus.  Also "systemd --user" is started from user@.service;
if you try to start it manually so that it inherits an environment
variable, it will conflict if user@.service was started by pam_systemd
(or loginctl enable-linger).

5 years agoMerge pull request #9516 from keszybz/module-load-unification
Lennart Poettering [Fri, 20 Jul 2018 11:55:56 +0000 (13:55 +0200)] 
Merge pull request #9516 from keszybz/module-load-unification

Module load unification

5 years agoMerge pull request #9614 from poettering/negative-sec
Lennart Poettering [Fri, 20 Jul 2018 11:22:01 +0000 (13:22 +0200)] 
Merge pull request #9614 from poettering/negative-sec

parse-util: make sure "-0.-0s" is not considered a valid time specifi…

5 years agoAdd support for opening files for appending 9500/head
Zsolt Dollenstein [Tue, 3 Jul 2018 19:22:29 +0000 (12:22 -0700)] 
Add support for opening files for appending

Addresses part of #8983

5 years agoanalyze: fix width calculation in plot command
Yu Watanabe [Fri, 20 Jul 2018 08:21:10 +0000 (17:21 +0900)] 
analyze: fix width calculation in plot command

5 years agoMerge pull request #9659 from yuwata/fix-network-memleak2
Lennart Poettering [Fri, 20 Jul 2018 10:38:49 +0000 (12:38 +0200)] 
Merge pull request #9659 from yuwata/fix-network-memleak2

fix networkd memleak and voidify several function calls

5 years agoMerge pull request #9661 from yuwata/add-sigprocmask-to-short-lived-daemons
Lennart Poettering [Fri, 20 Jul 2018 07:50:28 +0000 (09:50 +0200)] 
Merge pull request #9661 from yuwata/add-sigprocmask-to-short-lived-daemons

Add sigprocmask to short lived daemons

5 years agohostname: set sd_event_add_signal() 9661/head
Yu Watanabe [Fri, 20 Jul 2018 06:00:02 +0000 (15:00 +0900)] 
hostname: set sd_event_add_signal()

5 years agolocale: set sd_event_add_signal()
Yu Watanabe [Fri, 20 Jul 2018 05:59:36 +0000 (14:59 +0900)] 
locale: set sd_event_add_signal()

5 years agotimedate: set sd_event_add_signal()
Yu Watanabe [Fri, 20 Jul 2018 05:59:23 +0000 (14:59 +0900)] 
timedate: set sd_event_add_signal()

5 years agoparse-util: make sure "3.+1s" or "3. 1s" are not considered valid time specification 9614/head
Filipe Brandenburger [Fri, 20 Jul 2018 04:50:35 +0000 (21:50 -0700)] 
parse-util: make sure "3.+1s" or "3. 1s" are not considered valid time specification

Indeed, strtoll() is super-hard to use properly! :-(

Also added more tests for those cases and copied the tests to parse_nsec as well.

5 years agotimesync: voidify sd_event_add_signal() and sd_event_set_watchdog() 9659/head
Yu Watanabe [Fri, 20 Jul 2018 02:30:11 +0000 (11:30 +0900)] 
timesync: voidify sd_event_add_signal() and sd_event_set_watchdog()

5 years agoresolve: voidify sd_event_add_signal() and sd_event_set_watchdog()
Yu Watanabe [Fri, 20 Jul 2018 02:29:59 +0000 (11:29 +0900)] 
resolve: voidify sd_event_add_signal() and sd_event_set_watchdog()

5 years agonetwork: voidify sd_event_add_signal() and sd_event_set_watchdog()
Yu Watanabe [Fri, 20 Jul 2018 02:29:49 +0000 (11:29 +0900)] 
network: voidify sd_event_add_signal() and sd_event_set_watchdog()

5 years agonetwork: add missing sd_netlink_unref()
Yu Watanabe [Fri, 20 Jul 2018 02:23:24 +0000 (11:23 +0900)] 
network: add missing sd_netlink_unref()

5 years agoudev-builtin-kmod: adjust logging 9516/head
Zbigniew Jędrzejewski-Szmek [Fri, 6 Jul 2018 10:47:39 +0000 (12:47 +0200)] 
udev-builtin-kmod: adjust logging

I guess the one about "execute" was from the time when modprobe was called
directly.

5 years agocore: use the generic module_load() function
Zbigniew Jędrzejewski-Szmek [Fri, 6 Jul 2018 10:41:50 +0000 (12:41 +0200)] 
core: use the generic module_load() function

This allows aliases to be used for the basic modules we load from pid1 before
udev is started. In #9501 the kernel renamed autofs4 to autofs, with "autofs4"
as alias, but we wouldn't load the module, because we didn't follow aliases.
The kernel change was reverted, but it's probably better to support aliases.

5 years agoshared/module-util: fix preexisting mixup with errno sign
Zbigniew Jędrzejewski-Szmek [Thu, 19 Jul 2018 16:27:22 +0000 (18:27 +0200)] 
shared/module-util: fix preexisting mixup with errno sign

5 years agoudev-builtin-kmod: use the generic module_load() function
Zbigniew Jędrzejewski-Szmek [Fri, 6 Jul 2018 10:28:09 +0000 (12:28 +0200)] 
udev-builtin-kmod: use the generic module_load() function

There should be no functional change.

5 years agoman: fix list-files example
Zbigniew Jędrzejewski-Szmek [Thu, 19 Jul 2018 08:48:46 +0000 (10:48 +0200)] 
man: fix list-files example

The dot is only shown for failed units.

Alternative for #9644.

5 years agoMicmute Key support of ThinkCentre M820z and M920z (#9619)
Shengyao Xue [Thu, 19 Jul 2018 09:30:03 +0000 (17:30 +0800)] 
Micmute Key support of ThinkCentre M820z and M920z (#9619)

Micmute Key support of ThinkCentre M820z and M920z

There was a ThinkCentre M800z Micmute Key support entry.
But on new models M820z and M920z, the lines must change a bit,
the keyboard:name... must change to evdev:name.
Already tested on the M820z and M920z hardwares.

Per Poettering's comment in https://github.com/systemd/systemd/pull/9619,
We better combine M800z and M820/M920z entries and use the "evdev" prefix.

5 years agoresolve: drop unused slot
Yu Watanabe [Wed, 18 Jul 2018 09:12:50 +0000 (18:12 +0900)] 
resolve: drop unused slot

5 years agocoverity: Add custom assertion macros for Coverity
Filipe Brandenburger [Wed, 18 Jul 2018 02:43:20 +0000 (19:43 -0700)] 
coverity: Add custom assertion macros for Coverity

These custom macros make the expression go through a function, in order
to prevent ASSERT_SIDE_EFFECT false positives on our macros such as
assert_se() and assert_return() that cannot be disabled and will always
evaluate their expressions.

This technique has been described and recommended in:
https://community.synopsys.com/s/question/0D534000046Yuzb/suppressing-assertsideeffect-for-functions-that-allow-for-sideeffects

Tested by doing a local cov-build and uploading the resulting tarball to
scan.coverity.com, confirmed that the ASSERT_SIDE_EFFECT false positives
were gone.

5 years agoAdd HP Chromebook 14 (Falco) HWDB rule to fix scroll stutter (#9646)
Jérémy Nouhaud [Wed, 18 Jul 2018 22:41:56 +0000 (00:41 +0200)] 
Add HP Chromebook 14 (Falco) HWDB rule to fix scroll stutter (#9646)

5 years agoMerge pull request #9600 from keszybz/systemctl-mask-check
Lennart Poettering [Wed, 18 Jul 2018 19:03:02 +0000 (21:03 +0200)] 
Merge pull request #9600 from keszybz/systemctl-mask-check

Systemctl mask check

5 years agoMerge pull request #9346 from keszybz/journald-exact2
Lennart Poettering [Wed, 18 Jul 2018 19:00:43 +0000 (21:00 +0200)] 
Merge pull request #9346 from keszybz/journald-exact2

Store a copy of the input message if any stripping or truncation occurs

5 years agosd-bus: make bus_slot_disconnect() also unref the slot object
Yu Watanabe [Tue, 17 Jul 2018 08:53:22 +0000 (17:53 +0900)] 
sd-bus: make bus_slot_disconnect() also unref the slot object

This makes bus_slot_disconnect() unref the slot object from bus when
`unref == true` and it is floating, as the function removes the
reference from the relevant bus object.

This reverts 20d4ee2cbc21e0c4d2dd6c01d5a18a4cf0d98222, as it
introduces #9604.

Fixes #9604.

5 years agoMerge pull request #9643 from keszybz/two-meson-fixmes
Lennart Poettering [Wed, 18 Jul 2018 18:32:28 +0000 (20:32 +0200)] 
Merge pull request #9643 from keszybz/two-meson-fixmes

Two meson fixmes

5 years agoMerge pull request #9633 from yuwata/network-fix-memleak
Lennart Poettering [Wed, 18 Jul 2018 18:32:03 +0000 (20:32 +0200)] 
Merge pull request #9633 from yuwata/network-fix-memleak

network: fix memleak

5 years agohwdb: Add force-release for Clevo W65_67SZ media keys
Saleem Rashid [Tue, 17 Jul 2018 21:44:59 +0000 (22:44 +0100)] 
hwdb: Add force-release for Clevo W65_67SZ media keys

5 years agoMerge pull request #9640 from keszybz/move-dont-destroy-bus
Lennart Poettering [Wed, 18 Jul 2018 16:40:15 +0000 (18:40 +0200)] 
Merge pull request #9640 from keszybz/move-dont-destroy-bus

Move BUS_DONT_DESTROY

5 years agohwdb: fix trailing whitespace
Lennart Poettering [Wed, 18 Jul 2018 16:37:39 +0000 (18:37 +0200)] 
hwdb: fix trailing whitespace

Correct whitespace mess introduced by
dc6e5724df3d9b2a5863a9aea8fa9413dbfaa23d.

5 years agomeson: remove false check for key_serial_t 9643/head
Zbigniew Jędrzejewski-Szmek [Wed, 18 Jul 2018 15:42:06 +0000 (17:42 +0200)] 
meson: remove false check for key_serial_t

key_serial_t is defined in keyutil.h, which wasn't included in the header list
in the test, so the test always failed. We were always compiling stuff with
!HAVE_KEY_SERIAL_T.

We could try to add keyutil.h to the test, but then we'd have to first check if
it is available, which just doesn't seem worth the trouble.

key_serial_t should always be defined as int32_t. Let's keep the uncoditional
define, since repeated compatible typedefs are not a problem, and it allows us
to compile even if the header file is missing. If there's ever a change in the
definition, we'll have to adjust the code for the different type anyway, and
our compiler will tell us.

5 years agomeson: unify linux/stat.h check with other checks and use _GNU_SOURCE
Zbigniew Jędrzejewski-Szmek [Wed, 18 Jul 2018 15:26:17 +0000 (17:26 +0200)] 
meson: unify linux/stat.h check with other checks and use _GNU_SOURCE

Using _GNU_SOURCE is better because that's how we include the headers in the
actual build, and some headers define different stuff when it is defined.
sys/stat.h for example defines 'struct statx' conditionally.

5 years agobus: add comment to explain assert 9640/head
Zbigniew Jędrzejewski-Szmek [Wed, 18 Jul 2018 10:23:59 +0000 (12:23 +0200)] 
bus: add comment to explain assert

5 years agoAdd accelerometer mount matrix for Linx 12X64
apnix-uk [Tue, 17 Jul 2018 22:00:16 +0000 (23:00 +0100)] 
Add accelerometer mount matrix for Linx 12X64

5 years agoman/systemd.resource-control.xml: point user to correct url
Chen Qi [Wed, 18 Jul 2018 08:33:29 +0000 (16:33 +0800)] 
man/systemd.resource-control.xml: point user to correct url

cpu.cfs_quota_us is actually explained in sched-bwc.txt instead of
sched-design-CFS.txt.

5 years agobus: move BUS_DONT_DESTROY calls after asserts
Zbigniew Jędrzejewski-Szmek [Wed, 18 Jul 2018 10:16:33 +0000 (12:16 +0200)] 
bus: move BUS_DONT_DESTROY calls after asserts

It's not useful to bump the reference count before checking if the object is
NULL. Thanks to d40f5cc498 we can do this ;).

Related to https://bugzilla.redhat.com/show_bug.cgi?id=1576084,
https://bugzilla.redhat.com/show_bug.cgi?id=1575340,
https://bugzilla.redhat.com/show_bug.cgi?id=1575350. I'm not sure why those two
people hit this code path, while most people don't. At least we won't abort.

5 years agonetwork: free routes assigned to link 9633/head
Yu Watanabe [Wed, 18 Jul 2018 04:07:27 +0000 (13:07 +0900)] 
network: free routes assigned to link

5 years agonetwork: simplify link_free()
Yu Watanabe [Wed, 18 Jul 2018 04:06:34 +0000 (13:06 +0900)] 
network: simplify link_free()

5 years agonetwork: move sd_event initialization to manager_new()
Yu Watanabe [Wed, 18 Jul 2018 03:37:50 +0000 (12:37 +0900)] 
network: move sd_event initialization to manager_new()

5 years agotests: allow passing additional arguments to nspawn via NSPAWN_ARGUMENTS
Evgeny Vereshchagin [Thu, 5 Jul 2018 16:30:52 +0000 (16:30 +0000)] 
tests: allow passing additional arguments to nspawn via NSPAWN_ARGUMENTS

5 years agotests: use the asan wrapper to boot a VM/container if systemd is built with ASAN
Evgeny Vereshchagin [Thu, 5 Jul 2018 15:14:07 +0000 (15:14 +0000)] 
tests: use the asan wrapper to boot a VM/container if systemd is built with ASAN

5 years agotests: create the asan wrapper automatically if systemd has been built with ASAN
Evgeny Vereshchagin [Thu, 5 Jul 2018 04:09:30 +0000 (04:09 +0000)] 
tests: create the asan wrapper automatically if systemd has been built with ASAN

5 years agobus-socket: Fix line_begins() to accept word matching full string
Filipe Brandenburger [Tue, 17 Jul 2018 18:32:40 +0000 (11:32 -0700)] 
bus-socket: Fix line_begins() to accept word matching full string

The switch to memory_startswith() changed the logic to only look for a space or
NUL byte after the matched word, but matching the full size should also be
acceptable.

This changed the behavior of parsing of "AUTH\r\n", where m will be set to 4,
since even though the word will match, the check for it being followed by ' '
or NUL will make line_begins() return false.

Tested:

- Using netcat to connect to the private socket directly:
  $ echo -ne '\0AUTH\r\n' | sudo nc -U /run/systemd/private
  REJECTED EXTERNAL ANONYMOUS

- Running the Ignition blackbox test:
  $ sudo sh -c 'PATH=$PWD/bin/amd64:$PATH ./tests.test'
  PASS

Fixes: d27b725abf64a19a6b2f99332b663f17ad046771
5 years agosleep: tiny coding style updates
Lennart Poettering [Mon, 16 Jul 2018 10:33:18 +0000 (12:33 +0200)] 
sleep: tiny coding style updates

No change in behaviour

5 years agoman: elaborate a bit on the effect of PrivateNetwork=
Lennart Poettering [Thu, 12 Jul 2018 19:03:53 +0000 (21:03 +0200)] 
man: elaborate a bit on the effect of PrivateNetwork=

Triggered by this thread:

https://lists.freedesktop.org/archives/systemd-devel/2018-July/040992.html

5 years agoresolvectl: Take empty string argument to clear lists in "dns", "domain" and "nta...
Filipe Brandenburger [Mon, 16 Jul 2018 22:16:37 +0000 (15:16 -0700)] 
resolvectl: Take empty string argument to clear lists in "dns", "domain" and "nta" options

The current CLI does not support a way to clear these lists, since without any
additional arguments, the command will list the current values.

Introduce a new way to clear the lists by passing a single '' argument to these
subcommands.

Update the man page to document this.

Tested:
  $ build/resolvectl domain eth1
  Link 3 (eth1): ~.
  $ build/resolvectl domain eth1 ''
  $ build/resolvectl domain eth1
  Link 3 (eth1):
  $ build/resolvectl domain eth1 '~.' '~example.com'
  $ build/resolvectl domain eth1
  Link 3 (eth1): ~. ~example.com
  $ build/resolvectl domain eth1 ''
  $ build/resolvectl domain eth1
  Link 3 (eth1):
  $ build/resolvectl domain eth1 '~.'
  $ build/resolvectl domain eth1
  Link 3 (eth1): ~.

And similar for "dns" and "nta".

5 years agoman: fix --ignore-inhibitors docs
Lennart Poettering [Tue, 17 Jul 2018 11:05:39 +0000 (13:05 +0200)] 
man: fix --ignore-inhibitors docs

Reported here:

https://lists.freedesktop.org/archives/systemd-devel/2018-June/040939.html

Also see:

https://lists.freedesktop.org/archives/systemd-devel/2018-July/041036.html

5 years agoREADME: clarify that not only systemd should use prefix=/usr, but its deps too
Lennart Poettering [Mon, 16 Jul 2018 10:18:36 +0000 (12:18 +0200)] 
README: clarify that not only systemd should use prefix=/usr, but its deps too

See: #9547

5 years agoman: clarify that prefixing ExecStart= lines with "-" won't cause systemd to not...
Lennart Poettering [Mon, 16 Jul 2018 16:03:33 +0000 (18:03 +0200)] 
man: clarify that prefixing ExecStart= lines with "-" won't cause systemd to not record non-zero exit statuses

See: #9588

5 years agoparse-util: make sure "-0.-0s" is not considered a valid time specification
Lennart Poettering [Tue, 17 Jul 2018 11:01:46 +0000 (13:01 +0200)] 
parse-util: make sure "-0.-0s" is not considered a valid time specification

Did I mention that strtoll() is super-hard to use properly?

5 years agoMerge pull request #9601 from yuwata/small-fixes
Lennart Poettering [Tue, 17 Jul 2018 10:40:52 +0000 (12:40 +0200)] 
Merge pull request #9601 from yuwata/small-fixes

Small fixes

5 years agonetwork: drop unused slots
Yu Watanabe [Tue, 17 Jul 2018 03:36:02 +0000 (12:36 +0900)] 
network: drop unused slots

5 years agoMerge pull request #9597 from mbiebl/tests-initrd
Martin Pitt [Mon, 16 Jul 2018 19:36:36 +0000 (21:36 +0200)] 
Merge pull request #9597 from mbiebl/tests-initrd

Fix initrd for tests

5 years agoman: fix group name for systemd-networkd 9601/head
Yu Watanabe [Mon, 16 Jul 2018 18:12:19 +0000 (03:12 +0900)] 
man: fix group name for systemd-networkd

5 years agologin: fix typo in log message
Yu Watanabe [Mon, 16 Jul 2018 18:10:29 +0000 (03:10 +0900)] 
login: fix typo in log message

Reported in #9590.

5 years agoprocess-util: do not hide global variable
Yu Watanabe [Mon, 16 Jul 2018 18:06:33 +0000 (03:06 +0900)] 
process-util: do not hide global variable

Suggested by LGTM.

5 years agosysusers,tmpfiles: re-create systemd-network, systemd-resolve and systemd-timesync
Yu Watanabe [Sun, 15 Jul 2018 13:31:37 +0000 (22:31 +0900)] 
sysusers,tmpfiles: re-create systemd-network, systemd-resolve and systemd-timesync

This partially reverts d4e9e574ea0b5d23598a317e68399584d229568b,
0187368cadea183e18c6d575a9d6b7f491a402af, and
4240cb02fda90ba11dfc0114201e42691132c6a9.
The services systemd-networkd, systemd-resolved, and systemd-timesyncd
enable DynamicUsers= and have bus interfaces. Unfortunately, these
has many problems now. Let us create the relevant users, at least,
tentatively.

Fixes #9503.

5 years agotmpfiles: set only default acls to folders #9545 (#9599)
remueller [Mon, 16 Jul 2018 14:56:01 +0000 (16:56 +0200)] 
tmpfiles: set only default acls to folders #9545 (#9599)

Check if the fd is a folder before setting default acls

Tested:

Ubuntu 18.04.

test.conf: A+ /tmp/test - - - - u:user2:rw,d:u:user1:rwx

The folder /tmp/test looks like

    /tmp/test/file1
    /tmp/test/folder2

start systemd-tmpfiles manually

Fixes: #9545
5 years agogitignore: add .gdb_history 9600/head
Zbigniew Jędrzejewski-Szmek [Mon, 16 Jul 2018 14:03:47 +0000 (16:03 +0200)] 
gitignore: add .gdb_history

This is the default file gdb will use.

5 years agoMerge pull request #9550 from nosada/fix-9549
Yu Watanabe [Mon, 16 Jul 2018 14:02:32 +0000 (23:02 +0900)] 
Merge pull request #9550 from nosada/fix-9549

format-table: make all widths be set properly

5 years agosystemctl: allow 'edit' to work on templates again
Zbigniew Jędrzejewski-Szmek [Mon, 16 Jul 2018 13:18:21 +0000 (15:18 +0200)] 
systemctl: allow 'edit' to work on templates again

This got broken in 9d9dd746d461e4524fb3644b20b8138448d666f2, because a template
is not a valid unit, so the check for being masked failed. Avoid this by
handling templates specially. Fixes #9554.

Also, this improves 'cat' with masked units:

(before) $ systemctl cat foofoofoo@.service
Failed to derive unit name prefix from unit name: Invalid argument
Failed to derive unit name prefix from unit name: Invalid argument
Failed to derive unit name prefix from unit name: Invalid argument
Failed to derive unit name prefix from unit name: Invalid argument
Failed to derive unit name prefix from unit name: Invalid argument
Failed to derive unit name prefix from unit name: Invalid argument
Failed to derive unit name prefix from unit name: Invalid argument
Failed to derive unit name prefix from unit name: Invalid argument
Failed to derive unit name prefix from unit name: Invalid argument
Failed to derive unit name prefix from unit name: Invalid argument

(after) $ build/systemctl cat foofoofoo@.service

In check_triggering_units(), the call to unit_is_masked() is replaced with an
open-coded check. This is a bit unfortunate, but unit_is_masked() now requires
LookupPaths to be initialized, which we don't have or need in this case, so it
seems easiest to just accept this tiny code duplication.

5 years agosd-bus: make BUS_DEFAULT_TIMEOUT configurable
Yu Watanabe [Fri, 13 Jul 2018 08:38:47 +0000 (17:38 +0900)] 
sd-bus: make BUS_DEFAULT_TIMEOUT configurable

This adds sd_bus_{get,set}_method_call_timeout().
If the timeout is not set or set to 0, then the timeout value is
parsed from $SYSTEMD_BUS_TIMEOUT= environment variable. If the
environment variable is not set, then built-in timeout is used.

5 years agoMerge pull request #9530 from keszybz/sd-bus-doc
Lennart Poettering [Mon, 16 Jul 2018 13:01:12 +0000 (15:01 +0200)] 
Merge pull request #9530 from keszybz/sd-bus-doc

More documentation for sd-bus

5 years agoMove module-util.h to src/shared/ and load_module() to libshared
Zbigniew Jędrzejewski-Szmek [Fri, 6 Jul 2018 09:57:54 +0000 (11:57 +0200)] 
Move module-util.h to src/shared/ and load_module() to libshared

Unfortunately this needs libshared to link to libkmod. Before it was linked
into systemd-udevd, udevadm, and systemd each seperately. On most systems this
doesn't make much difference, because at least systemd would be installed, but
it might not be in small chroots. It is a small library, so I hope this is not
a big issue.

5 years agotree-wide: use "polkit" to refer to PolicyKit/polkit 9530/head
Zbigniew Jędrzejewski-Szmek [Mon, 16 Jul 2018 10:44:24 +0000 (12:44 +0200)] 
tree-wide: use "polkit" to refer to PolicyKit/polkit

Back in 2012 the project was renamed, see the release notes for v 0.105
[https://cgit.freedesktop.org/polkit/tree/NEWS#n754]. Let's update our
documentation and comments to do the same. Referring to PolicyKit is confusing
to users because at the time the polkit api changed too, and we support the new
version. I updated NEWS too, since all the references to PolicyKit there were
added after the rename.

"PolicyKit" is unchanged in various URLs and method call names.

5 years agomeson: allow systemd.directives and .index to be built if -Dman=false
Zbigniew Jędrzejewski-Szmek [Sun, 8 Jul 2018 13:14:46 +0000 (15:14 +0200)] 
meson: allow systemd.directives and .index to be built if -Dman=false

See 559d215b6733bb46533a52080522a7feca183aa8 for justification.

5 years agoman: add sd_bus_set_description(3)
Zbigniew Jędrzejewski-Szmek [Sun, 8 Jul 2018 13:09:23 +0000 (15:09 +0200)] 
man: add sd_bus_set_description(3)

5 years agoman: add sd_bus_reply_method_error(3)
Zbigniew Jędrzejewski-Szmek [Sun, 8 Jul 2018 12:11:13 +0000 (14:11 +0200)] 
man: add sd_bus_reply_method_error(3)

5 years agoman: add sd_bus_message_copy(3)
Zbigniew Jędrzejewski-Szmek [Sun, 8 Jul 2018 11:51:18 +0000 (13:51 +0200)] 
man: add sd_bus_message_copy(3)

5 years agoman: add sd_bus_message_new_error(3)
Zbigniew Jędrzejewski-Szmek [Sun, 8 Jul 2018 10:49:32 +0000 (12:49 +0200)] 
man: add sd_bus_message_new_error(3)

5 years agotest: Drop SKIP_INITRD for QEMU-based tests 9597/head
Michael Biebl [Mon, 16 Jul 2018 09:27:44 +0000 (11:27 +0200)] 
test: Drop SKIP_INITRD for QEMU-based tests

Not all distros support booting without an initrd. E.g. the Debian
kernel builds ext4 as a module and so relies on an initrd to
successfully start the QEMU-based images.

5 years agobuild-sys: Detect whether struct statx is defined in sys/stat.h
Filipe Brandenburger [Mon, 16 Jul 2018 05:43:35 +0000 (22:43 -0700)] 
build-sys: Detect whether struct statx is defined in sys/stat.h

Starting with glibc 2.27.9000-36.fc29, include file sys/stat.h will have a
definition for struct statx, in which case include file linux/stat.h should be
avoided, in order to prevent a duplicate definition.

    In file included from ../src/basic/missing.h:18,
     from ../src/basic/util.h:28,
     from ../src/basic/hashmap.h:10,
     from ../src/shared/bus-util.h:12,
     from ../src/libsystemd/sd-bus/bus-creds.c:11:
    /usr/include/linux/stat.h:99:8: error: redefinition of ‘struct statx’
     struct statx {
    ^~~~~
    In file included from /usr/include/sys/stat.h:446,
     from ../src/basic/util.h:19,
     from ../src/basic/hashmap.h:10,
     from ../src/shared/bus-util.h:12,
     from ../src/libsystemd/sd-bus/bus-creds.c:11:
    /usr/include/bits/statx.h:36:8: note: originally defined here
     struct statx
    ^~~~~

Extend our meson.build to look for struct statx when only sys/stat.h is
included and, in that case, do not include linux/stat.h anymore.

Tested that systemd builds correctly when using a glibc version that includes a
definition for struct statx.

glibc Fedora RPM update:
https://src.fedoraproject.org/rpms/glibc/c/28cb5d31fc1e5887912283c889689c47076278ae

glibc upstream commit:
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=fd70af45528d59a00eb3190ef6706cb299488fcd

5 years agologin: use parse_uid() when unmounting user runtime directory
Yu Watanabe [Mon, 9 Jul 2018 05:05:20 +0000 (14:05 +0900)] 
login: use parse_uid() when unmounting user runtime directory

When unmounting user runtime directory, only UID is necessary,
and the corresponding user may not exist anymore.
This makes first try to parse the input by parse_uid(), and only if it
fails, prase the input by get_user_creds().

Fixes #9541.

5 years agotest: Fix typo in TEST-19-DELEGATE
Michael Biebl [Sun, 15 Jul 2018 19:13:56 +0000 (21:13 +0200)] 
test: Fix typo in TEST-19-DELEGATE

5 years agoformat-table: fix typo in comment 9550/head
Yu Watanabe [Thu, 12 Jul 2018 08:23:07 +0000 (17:23 +0900)] 
format-table: fix typo in comment

5 years agotest: add a reproducer of issue #9549
Yu Watanabe [Thu, 12 Jul 2018 05:20:09 +0000 (14:20 +0900)] 
test: add a reproducer of issue #9549

5 years agoMerge pull request #9462 from yuwata/strv_split
Lennart Poettering [Fri, 13 Jul 2018 18:32:37 +0000 (20:32 +0200)] 
Merge pull request #9462 from yuwata/strv_split

make strv_split() accept empty string and use it in pager_open()

5 years agosd-bus: unref slot->match_callback.install_slot when slot is disconnected
Yu Watanabe [Sun, 8 Jul 2018 14:09:18 +0000 (23:09 +0900)] 
sd-bus: unref slot->match_callback.install_slot when slot is disconnected

When a slot is disconnected, then slot->match_callback.install_slot
is also disconnected. So, bus_slot_disconnect() removes the install_slot
from the list of slots in bus, although it is a floating object.
This makes install_slot unreffed from bus when it is disconnected.

Fixes #9505 and #9510.

5 years agoMerge pull request #9534 from martinpitt/nm-test
Lennart Poettering [Fri, 13 Jul 2018 17:50:14 +0000 (19:50 +0200)] 
Merge pull request #9534 from martinpitt/nm-test

Fix networkd test

5 years agomachinectl: fix verbosity of import-raw or friends
Yu Watanabe [Sun, 8 Jul 2018 16:14:37 +0000 (01:14 +0900)] 
machinectl: fix verbosity of import-raw or friends

This partially reverts 31d99bd172b17179ec24f63fc8ca4d6530dc98ae.

Fixes #9527.

5 years agopull: initialize libgcrypt before calling any functions provided by libgcrypt
Yu Watanabe [Sun, 8 Jul 2018 20:40:01 +0000 (05:40 +0900)] 
pull: initialize libgcrypt before calling any functions provided by libgcrypt

This fixes the following warning:
```
systemd-pull[4065]: Libgcrypt warning: missing initialization - please fix the application
```

5 years agobls: Allow options to be used more than once
Jan Janssen [Tue, 10 Jul 2018 08:44:06 +0000 (10:44 +0200)] 
bls: Allow options to be used more than once

This just documents what we already allow anyways.

5 years agoMerge pull request #9572 from yuwata/fix-9511
Lennart Poettering [Fri, 13 Jul 2018 17:32:09 +0000 (19:32 +0200)] 
Merge pull request #9572 from yuwata/fix-9511

resolve: fix heap-use-after-free and uninitialized memory

5 years agodoc: list PrivateMounts= in TRANSIENT-SETTINGS.md
Yu Watanabe [Thu, 12 Jul 2018 06:40:17 +0000 (15:40 +0900)] 
doc: list PrivateMounts= in TRANSIENT-SETTINGS.md

Follow-up for #9153.

5 years ago[man] minor systemd.target manual update
Michal Soltys [Fri, 13 Jul 2018 12:55:17 +0000 (14:55 +0200)] 
[man] minor systemd.target manual update

Target units gain both Conflicts= and Before= against shutdown.target
(not only Conflicts=).

5 years agohwdb: deprecate the POINTINGSTICK_CONST_ACCEL property
Peter Hutterer [Thu, 12 Jul 2018 22:39:09 +0000 (08:39 +1000)] 
hwdb: deprecate the POINTINGSTICK_CONST_ACCEL property

The only known consumer of this property was libinput but it stopped using
this property since libinput 1.9 (released Oct 2017). This property is
arguably not one that should be in systemd anyway - it's not a
hardware-specific property but rather a factor of the acceleration method
employed by whatever userspace handles the events.

Deprecate it but leave the values in place for backwards compatibility.

5 years agocore: add MemoryMin
Tejun Heo [Sat, 9 Jun 2018 00:33:14 +0000 (17:33 -0700)] 
core: add MemoryMin

The kernel added support for a new cgroup memory controller knob memory.min in
bf8d5d52ffe8 ("memcg: introduce memory.min") which was merged during v4.18
merge window.

Add MemoryMin to support memory.min.

5 years agohwdb: remove stray 'i' in hwdb match string for the HP Spectre (#9571)
Peter Hutterer [Thu, 12 Jul 2018 05:52:18 +0000 (15:52 +1000)] 
hwdb: remove stray 'i' in hwdb match string for the HP Spectre (#9571)

Looks like vim detritus, introduced in f8de7c1875841f277d0b0e46d4a27d4e2b893d1f

5 years agoformat-table: make all widths be set properly
NOGISAKA Sadata [Mon, 9 Jul 2018 14:49:07 +0000 (23:49 +0900)] 
format-table: make all widths be set properly

Fixes #9549.

5 years agoresolve: use structured initializer 9572/head
Yu Watanabe [Thu, 12 Jul 2018 04:37:01 +0000 (13:37 +0900)] 
resolve: use structured initializer

This fixes the following valgrind warning:
```
Syscall param sendmsg(msg.msg_name) points to uninitialised byte(s)
   at 0x6189CC1: sendmsg (in /usr/lib64/libpthread-2.27.so)
   by 0x153082: dns_stream_writev (resolved-dns-stream.c:235)
   by 0x153343: dns_stream_tls_writev (resolved-dns-stream.c:299)
   by 0x5B30343: ??? (in /usr/lib64/libgnutls.so.30.20.2)
   by 0x5B3158F: ??? (in /usr/lib64/libgnutls.so.30.20.2)
   by 0x5B33190: ??? (in /usr/lib64/libgnutls.so.30.20.2)
   by 0x5B36307: ??? (in /usr/lib64/libgnutls.so.30.20.2)
   by 0x5B37D47: gnutls_handshake (in /usr/lib64/libgnutls.so.30.20.2)
   by 0x154591: dns_stream_connect_tls (resolved-dns-stream.c:596)
   by 0x13A889: dns_transaction_emit_tcp (resolved-dns-transaction.c:676)
   by 0x13D901: dns_transaction_go (resolved-dns-transaction.c:1761)
   by 0x1330C8: dns_query_candidate_go (resolved-dns-query.c:156)
 Address 0xa9ac268 is 312 bytes inside a block of size 592 alloc'd
   at 0x4C30B06: calloc (vg_replace_malloc.c:711)
   by 0x1541F8: dns_stream_new (resolved-dns-stream.c:545)
   by 0x13A662: dns_transaction_emit_tcp (resolved-dns-transaction.c:642)
   by 0x13D901: dns_transaction_go (resolved-dns-transaction.c:1761)
   by 0x1330C8: dns_query_candidate_go (resolved-dns-query.c:156)
   by 0x134E16: dns_query_go (resolved-dns-query.c:757)
   by 0x11F3FB: bus_method_resolve_hostname (resolved-bus.c:353)
   by 0x4F947A7: method_callbacks_run (bus-objects.c:402)
   by 0x4F97266: object_find_and_run (bus-objects.c:1260)
   by 0x4F978B1: bus_process_object (bus-objects.c:1376)
   by 0x4FAF82C: process_message (sd-bus.c:2661)
   by 0x4FAFA1B: process_running (sd-bus.c:2703)
```