]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
6 years agocore: use config_parse_unit_string_printf() for decoding RebootArgument=
Lennart Poettering [Tue, 21 Nov 2017 18:23:31 +0000 (19:23 +0100)] 
core: use config_parse_unit_string_printf() for decoding RebootArgument=

All other cases where we accept a reboot argument are decoded with
config_parse_unit_string_printf() rather than
config_parse_unit_path_printf(), and that's really the only thing what
makes sense here, hence adjust this here, too.

6 years agoCODING_STYLE: document the order in which unescaping + specifier expansion should...
Lennart Poettering [Tue, 21 Nov 2017 16:58:51 +0000 (17:58 +0100)] 
CODING_STYLE: document the order in which unescaping + specifier expansion should be done

6 years agospecifier: unify specifier implementations for user-related specifiers
Lennart Poettering [Tue, 21 Nov 2017 16:57:56 +0000 (17:57 +0100)] 
specifier: unify specifier implementations for user-related specifiers

The code in install-printf.c and unit-printf.c for these is pretty much
the same and very generic. Let's move this all over to the generic
specifier.c, and share the implementations.

6 years agospecifier: add helper for escaping '%' characters to avoid making them subject for...
Lennart Poettering [Tue, 21 Nov 2017 16:52:31 +0000 (17:52 +0100)] 
specifier: add helper for escaping '%' characters to avoid making them subject for expansion

This is ultimately just a wrapper around strreplace(), but it makes
things a bit more self-descriptive.

6 years agostring-util: update strreplace() a bit, use GREEDY_REALLOC()
Lennart Poettering [Tue, 21 Nov 2017 18:38:49 +0000 (19:38 +0100)] 
string-util: update strreplace() a bit, use GREEDY_REALLOC()

6 years agocore: drop specifier expansion when parsing transient dbus properties
Lennart Poettering [Tue, 21 Nov 2017 16:32:01 +0000 (17:32 +0100)] 
core: drop specifier expansion when parsing transient dbus properties

Specifier expansion (much like C escape handling) should be a helper for
writing unit files, but should be nothing we do on programatic APIs. For
those, the client can do the necessary replacements anyway, and we
really should be careful with doing such string processing of data we
get via lower level programmatic APIs.

We currently do specifier expansion only for the env var transient unit
APIs, no other properties do this. Let's remove it here too, to be fully
systematic.

Yes, in a way this is API breakage, but then again this API isn't
documented yet, and an outlier, hence let's clear this up now, before it
is too late.

6 years agojournald: correct field counts 7500/head
Lennart Poettering [Wed, 29 Nov 2017 10:37:21 +0000 (11:37 +0100)] 
journald: correct field counts

N_IOVEC_OBJECT_FIELDS is bumped 14 → 18 (see dispatch_message_real() and
count!)

N_IOVEC_PAYLOAD_FIELDS is bumped 15 → 16 (see
server_space_usage_message() and count!)

Also, add comments, to make clear what is what.

6 years agojournal: driver messages can now contain object fields, account for that
Lennart Poettering [Wed, 29 Nov 2017 10:36:22 +0000 (11:36 +0100)] 
journal: driver messages can now contain object fields, account for that

In some cases we can now log about processes, hence we must keep room
for that.

6 years agoMerge pull request #7492 from keszybz/coverity-fixes
Yu Watanabe [Wed, 29 Nov 2017 03:50:49 +0000 (12:50 +0900)] 
Merge pull request #7492 from keszybz/coverity-fixes

A few more cleanups based on coverity and valgrind

6 years agoudev/collect: use _cleanup_ in one more place 7492/head
Zbigniew Jędrzejewski-Szmek [Tue, 28 Nov 2017 12:26:15 +0000 (13:26 +0100)] 
udev/collect: use _cleanup_ in one more place

This doesn't make the code pretty, but it at least makes it a tiny bit shorter.

6 years agoudev/collect: remove dead conditional
Zbigniew Jędrzejewski-Szmek [Tue, 28 Nov 2017 12:18:09 +0000 (13:18 +0100)] 
udev/collect: remove dead conditional

Coverity rightly says that 'word' is assigned to 'ptr', and 'word'
was assigned from 'ptr' (yikes) right after a non-null check.

6 years agojournal: avoid undefined behaviour in float division by 0.0
Zbigniew Jędrzejewski-Szmek [Tue, 28 Nov 2017 12:11:35 +0000 (13:11 +0100)] 
journal: avoid undefined behaviour in float division by 0.0

Coverity says that's undefined. I'm pretty sure we always would get a nan, but
let's avoid (formally) undefined behaviour since that can cause compilers to do
strange things.

6 years agonetworkd: fix memleak of Rules
Zbigniew Jędrzejewski-Szmek [Tue, 28 Nov 2017 12:02:33 +0000 (13:02 +0100)] 
networkd: fix memleak of Rules

This was the issue mentioned in 93f9da6e0a.

6 years agojournal: use new helpers with journal_file_close
Zbigniew Jędrzejewski-Szmek [Tue, 28 Nov 2017 11:40:14 +0000 (12:40 +0100)] 
journal: use new helpers with journal_file_close

journal_file_close_set() is not necessary anymore.

6 years agojournal-remote: add helper function and use hashmap_free_with_destructor
Zbigniew Jędrzejewski-Szmek [Tue, 28 Nov 2017 11:38:15 +0000 (12:38 +0100)] 
journal-remote: add helper function and use hashmap_free_with_destructor

6 years agocryptsetup-generator: add helper function and use hashmap_free_with_destructor
Zbigniew Jędrzejewski-Szmek [Tue, 28 Nov 2017 11:37:51 +0000 (12:37 +0100)] 
cryptsetup-generator: add helper function and use hashmap_free_with_destructor

6 years agocoredump: fix typo and use hashmap_free_with_destructor
Zbigniew Jędrzejewski-Szmek [Tue, 28 Nov 2017 11:37:14 +0000 (12:37 +0100)] 
coredump: fix typo and use hashmap_free_with_destructor

6 years agomachine-image: convert image_hashmap_free() to an static inline helper
Zbigniew Jędrzejewski-Szmek [Tue, 28 Nov 2017 11:36:35 +0000 (12:36 +0100)] 
machine-image: convert image_hashmap_free() to an static inline helper

6 years agoAdd set/hashmap helpers for non-trivial freeing and use where straighforward
Zbigniew Jędrzejewski-Szmek [Tue, 28 Nov 2017 11:35:49 +0000 (12:35 +0100)] 
Add set/hashmap helpers for non-trivial freeing and use where straighforward

A macro is needed because otherwise we couldn't ensure type safety.
Some simple tests are included.
No functional change intended.

6 years agoUse hashmap_free_free where appropriate
Zbigniew Jędrzejewski-Szmek [Tue, 28 Nov 2017 11:31:27 +0000 (12:31 +0100)] 
Use hashmap_free_free where appropriate

6 years agoRevert "meson: drop rootprefix option"
Zbigniew Jędrzejewski-Szmek [Tue, 28 Nov 2017 19:00:10 +0000 (20:00 +0100)] 
Revert "meson: drop rootprefix option"

This reverts commit ee4bfa21f62dbf4d8f2be27d3c763c3c16743bfd.

Also add comment so that this doesn't get deleted again by mistake.

Replaces #7461.

6 years agoMerge pull request #7490 from yuwata/test-basic
Zbigniew Jędrzejewski-Szmek [Tue, 28 Nov 2017 17:15:30 +0000 (18:15 +0100)] 
Merge pull request #7490 from yuwata/test-basic

add more tests for basic functions

6 years agonetworkd: Add comment for setting_mtu #7460 (#7489)
Susant Sahani [Tue, 28 Nov 2017 16:24:52 +0000 (21:54 +0530)] 
networkd: Add comment for setting_mtu #7460 (#7489)

Follow up #7460

6 years agoMerge pull request #7486 from keszybz/coverity-fixes
Lennart Poettering [Tue, 28 Nov 2017 14:04:11 +0000 (15:04 +0100)] 
Merge pull request #7486 from keszybz/coverity-fixes

Fixes for issues spotted by coverity (and some cleanups)

6 years agotest-cap-list: add more tests about capability_set_{from,to}_string() 7490/head
Yu Watanabe [Tue, 28 Nov 2017 13:17:00 +0000 (22:17 +0900)] 
test-cap-list: add more tests about capability_set_{from,to}_string()

6 years agotest: move tests about cap_list_cap() from test-cap-list to test-capability
Yu Watanabe [Tue, 28 Nov 2017 13:14:54 +0000 (22:14 +0900)] 
test: move tests about cap_list_cap() from test-cap-list to test-capability

6 years agocap-list: check range of numeric value
Yu Watanabe [Tue, 28 Nov 2017 13:06:34 +0000 (22:06 +0900)] 
cap-list: check range of numeric value

6 years agotest-bitmap: add tests for bitmap_copy()
Yu Watanabe [Tue, 28 Nov 2017 09:19:04 +0000 (18:19 +0900)] 
test-bitmap: add tests for bitmap_copy()

6 years agotest-architecture: add more tests
Yu Watanabe [Tue, 28 Nov 2017 09:14:55 +0000 (18:14 +0900)] 
test-architecture: add more tests

6 years agotest-alloc-util: add tests for memdup_suffix0() and greedy_realloc()
Yu Watanabe [Tue, 28 Nov 2017 11:33:58 +0000 (20:33 +0900)] 
test-alloc-util: add tests for memdup_suffix0() and greedy_realloc()

6 years agotests: add tests for empty string
Yu Watanabe [Tue, 28 Nov 2017 09:13:05 +0000 (18:13 +0900)] 
tests: add tests for empty string

6 years agoalloc-util: coding style fix
Yu Watanabe [Tue, 28 Nov 2017 09:11:58 +0000 (18:11 +0900)] 
alloc-util: coding style fix

6 years agoMerge pull request #7398 from keszybz/udev-list
Lennart Poettering [Tue, 28 Nov 2017 10:35:02 +0000 (11:35 +0100)] 
Merge pull request #7398 from keszybz/udev-list

udev: use list.h instead of udev_list_node

6 years agoMerge pull request #7484 from poettering/sd-resolve-timeout
Lennart Poettering [Tue, 28 Nov 2017 10:33:38 +0000 (11:33 +0100)] 
Merge pull request #7484 from poettering/sd-resolve-timeout

timeout sd-resolve tests

6 years agopid1: improve syntax in error message 7486/head
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 22:05:19 +0000 (22:05 +0000)] 
pid1: improve syntax in error message

6 years agopid1: clarify that min_max is always initialized
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 22:01:48 +0000 (22:01 +0000)] 
pid1: clarify that min_max is always initialized

read_one_line_file() always returns <= 0, so the code was OK, but let's write
the check a bit differently to make it obvious that min_max is always set.

6 years agotest-hostname-util: add assert_se's to make coverity happy
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 21:54:38 +0000 (21:54 +0000)] 
test-hostname-util: add assert_se's to make coverity happy

6 years agotest-process-util: add (void) cast to make coverity happy
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 21:52:32 +0000 (21:52 +0000)] 
test-process-util: add (void) cast to make coverity happy

The intent is for the call to succeed only when privileged, so make
that clear.

6 years agotest-fd-util: add assert_se to make coverity happy
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 21:51:11 +0000 (21:51 +0000)] 
test-fd-util: add assert_se to make coverity happy

6 years agoudevadm-monitor: add some assert_se's to make coverity happy
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 21:48:46 +0000 (21:48 +0000)] 
udevadm-monitor: add some assert_se's to make coverity happy

We do that elsewhere and it's nice to be consistent.

6 years agocore/umount: use _cleanup_ in one more place
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 16:13:04 +0000 (16:13 +0000)] 
core/umount: use _cleanup_ in one more place

6 years agosd-resolve: check that name fits in the specified packet length
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 13:54:55 +0000 (13:54 +0000)] 
sd-resolve: check that name fits in the specified packet length

Coverity complained that we didn't check if the data is long enough.

6 years agoshim: fix logically dead code
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 13:31:46 +0000 (13:31 +0000)] 
shim: fix logically dead code

The alternate verification path could never be taken.

Found by coverity.

6 years agonetworkd: remove dead code
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 13:25:08 +0000 (13:25 +0000)] 
networkd: remove dead code

Found by coverity.

6 years agotest-ndisc-ra: add assert_se() to make coverity happy
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 12:47:52 +0000 (12:47 +0000)] 
test-ndisc-ra: add assert_se() to make coverity happy

6 years agoboot/shim: fix char ** vs char * mismatch
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 12:36:21 +0000 (12:36 +0000)] 
boot/shim: fix char ** vs char * mismatch

This code cannot have ever worked ;(

Found by coverity, obvious when the type is not obfuscated to void*.

6 years agoboot/efi: fix NULL dereference
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 12:22:56 +0000 (12:22 +0000)] 
boot/efi: fix NULL dereference

The comment above makes the intent of the code pretty clear:
"use security2_protocol == NULL as indicator".
So revert the condition in the check and fix the logic in the comment while
at it.

The question is how this could have ever worked: if BS->LocateProtocol
(which is supposedly optional) ever failed, we'd crash here. Strange.

Found by coverity.

6 years agodissect-image: simplify check for passphrase presence
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 12:16:09 +0000 (12:16 +0000)] 
dissect-image: simplify check for passphrase presence

m->encrypted is set when fstype=="crypto_LUKS", but this is not obvious when
reading decrypt_partition(). Just check if passphrase is set before using
it.

6 years agonetworkd: fix reversed arguments
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 12:08:37 +0000 (12:08 +0000)] 
networkd: fix reversed arguments

Found by coverity.

Also drop unused return value while at it.

6 years agonetworkd: plug some memleaks in rule serialization/deserialization
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 12:01:41 +0000 (12:01 +0000)] 
networkd: plug some memleaks in rule serialization/deserialization

This fixes the (mostly theoretical, since we're only parsing data that we write
ourselves) memleak when iif or oif is deserialized multiple times. Unfortunately
it does not fix the memleak when rule is freed, but that'll require a bigger
effort.

6 years agonetworkd: fix serialization of {Incoming,Outgoing}Interface
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 11:51:08 +0000 (11:51 +0000)] 
networkd: fix serialization of {Incoming,Outgoing}Interface

Let's just say that the code wasn't fully functional ;(

Since we only had the parser for serialization, and not the writer, we are
free to change the format. So while at it, let's use shorter names in the
serialization format that match the surrounding style.

6 years agoAdd test-routing-policy-rule
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 11:38:24 +0000 (11:38 +0000)] 
Add test-routing-policy-rule

6 years agotest-network: use automatic cleanup
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 11:23:31 +0000 (11:23 +0000)] 
test-network: use automatic cleanup

6 years agonetworkd: parse the rvalue, not the option name
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 11:21:19 +0000 (11:21 +0000)] 
networkd: parse the rvalue, not the option name

:(

6 years agonetworkd: move rule loading to a separate function
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 10:22:51 +0000 (10:22 +0000)] 
networkd: move rule loading to a separate function

No functional change.

6 years agoMerge pull request #7316 from poettering/fd-store-remove
Zbigniew Jędrzejewski-Szmek [Tue, 28 Nov 2017 08:15:00 +0000 (09:15 +0100)] 
Merge pull request #7316 from poettering/fd-store-remove

add new FDSTOREREMOVE=1 sd_notify() message

6 years agoAdded Logitech MX Master 2s (#7487)
Ari [Tue, 28 Nov 2017 02:30:31 +0000 (21:30 -0500)] 
Added Logitech MX Master 2s (#7487)

6 years agotest-resolve: make sure we don't hang forever 7484/head
Lennart Poettering [Mon, 27 Nov 2017 15:29:41 +0000 (16:29 +0100)] 
test-resolve: make sure we don't hang forever

If test-resolve is running in some CI environment that doesn't have
reliably working DNS, it's a good idea not to hang forever, let's
time-out after 20s

6 years agosd-resolve: propagate timeouts in sd_resolve_wait() the same way as in sd_bus_wait...
Lennart Poettering [Mon, 27 Nov 2017 15:28:53 +0000 (16:28 +0100)] 
sd-resolve: propagate timeouts in sd_resolve_wait() the same way as in sd_bus_wait(): ETIMEDOUT

Thankfully this is an internal API still, so we can mkae changes like
this.

6 years agoservice: shortcut operations if the MAINPID= doesn't actually cause a change 7316/head
Lennart Poettering [Mon, 27 Nov 2017 15:58:46 +0000 (16:58 +0100)] 
service: shortcut operations if the MAINPID= doesn't actually cause a change

6 years agoservice: use parse_errno() for parsing error numbers
Lennart Poettering [Mon, 27 Nov 2017 15:53:03 +0000 (16:53 +0100)] 
service: use parse_errno() for parsing error numbers

Let's always use the same logic when parsing error numbers, i.e. use
parse_errno() here too, to unify some code, and tighten the checks a
bit.

This also allows clients to pass errors as symbolic names. Probably
nothing we want to advertise too eagerly (since new daemons generating
this on old service managers won't understand), but still pretty
useful I think, in particular in scripting languages and such, where the
numeric error numbers might not be readily available.

6 years agoupdate TODO
Lennart Poettering [Mon, 13 Nov 2017 18:16:56 +0000 (19:16 +0100)] 
update TODO

6 years agologind: use the new FDSTOREREMOVE=1 sd_notify() message
Lennart Poettering [Mon, 13 Nov 2017 18:06:11 +0000 (19:06 +0100)] 
logind: use the new FDSTOREREMOVE=1 sd_notify() message

Let's explicitly tell PID 1 that we don't need an fd anymore, instead of
relying exclusively on POLLERR/POLLHUP for it to be removed.

Fixes: #6908
6 years agocore: add a new sd_notify() message for removing fds from the FD store again
Lennart Poettering [Mon, 13 Nov 2017 17:26:04 +0000 (18:26 +0100)] 
core: add a new sd_notify() message for removing fds from the FD store again

Currenly the only way to remove fds from the fdstore is to fully
stop the service, or to somehow trigger POLLERR/POLLHUP on the fd, in
which case systemd will remove the fd automatically.

Let's add another way: a new message that can be sent to remove fds
explicitly, given their name.

6 years agoman: slightly improve the sd_notify() documentation regarding READY=1
Lennart Poettering [Mon, 13 Nov 2017 17:19:53 +0000 (18:19 +0100)] 
man: slightly improve the sd_notify() documentation regarding READY=1

READY=1 may be used to signal when a service finished startup, but also
when it finished reloading. Say so.

6 years agocore: only process one of READY=1, STOPPING=1 or RELOADING=1 in sd_notify() handling
Lennart Poettering [Mon, 13 Nov 2017 17:14:20 +0000 (18:14 +0100)] 
core: only process one of READY=1, STOPPING=1 or RELOADING=1 in sd_notify() handling

Of course, it's not really a valid sd_notify() message if multiple of
these fields are used in one, but let's handle this somewhat gracefully,
by only processing one of them, and ignoring the rest.

6 years agoservice: reorder sd_notify() handling a bit
Lennart Poettering [Mon, 13 Nov 2017 17:06:09 +0000 (18:06 +0100)] 
service: reorder sd_notify() handling a bit

Let's keep handling of WATCHDOG= and WATCHDOG_USEC= together. No
functional changes.

6 years agoservice: split out sd_notify() message authorization code into a function of its own
Lennart Poettering [Mon, 13 Nov 2017 16:48:50 +0000 (17:48 +0100)] 
service: split out sd_notify() message authorization code into a function of its own

Let's shorten service_notify_message() a bit, and do the authentication
outside of the main function body.

No functional changes.

6 years agocore: only log about sd_notify() message contents, when debug logging is on
Lennart Poettering [Mon, 13 Nov 2017 16:44:00 +0000 (17:44 +0100)] 
core: only log about sd_notify() message contents, when debug logging is on

Let's optimize things a bit for the non-debug case. No change in
behaviour.

Main reason to do this is not so much the speed benefit though, but
merely to isolate the code from its surroundings more.

6 years agoCorrected Chuwi HiBook entry (#7483)
Vladislav Vishnyakov [Mon, 27 Nov 2017 15:32:07 +0000 (22:32 +0700)] 
Corrected Chuwi HiBook entry (#7483)

6 years agonetworkd: Free Prefix in case allocation fails (#7480)
Patrik Flykt [Mon, 27 Nov 2017 12:07:22 +0000 (14:07 +0200)] 
networkd: Free Prefix in case allocation fails (#7480)

Set the code to call _cleanup_prefix_free_ in case the next allocation
fails so that Prefix does not leak memory.

Reported by evverx.

6 years agonetworkd: unbork rule serialization
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 10:06:55 +0000 (10:06 +0000)] 
networkd: unbork rule serialization

We'd write something like

RULE=from=250.250.240.0/24 to=(null)/0 tos=0 fwmark=0/0 table=12
RULE=from=250.250.250.0/24 to=(null)/0 tos=0 fwmark=0/0 table=11

6 years agologind: make sure we don't acces m->action_what if it's not initialized (#7475)
Lennart Poettering [Mon, 27 Nov 2017 07:15:07 +0000 (08:15 +0100)] 
logind: make sure we don't acces m->action_what if it's not initialized (#7475)

Fixes: #7466
6 years agoMerge pull request #7472 from keszybz/tests-on-a-slow-disk
Lennart Poettering [Sun, 26 Nov 2017 17:37:00 +0000 (18:37 +0100)] 
Merge pull request #7472 from keszybz/tests-on-a-slow-disk

Tests on a slow disk

6 years agonetworkd: DHCP client do not get into a loop while setting MTU (#7460)
Susant Sahani [Sun, 26 Nov 2017 14:21:45 +0000 (19:51 +0530)] 
networkd: DHCP client do not get into a loop while setting MTU (#7460)

Some devices get reset itself while setting the MTU. we get in to a LOOP .
Once the MTU changed then the DHCP client talking with DHCP server never stops.
networkd gets into a loop and generates endless DHCP requests.

fixes #6593
fixes #7380

6 years agotest: increase the timeout for hwdb-test 7472/head
Zbigniew Jędrzejewski-Szmek [Sun, 26 Nov 2017 12:20:08 +0000 (13:20 +0100)] 
test: increase the timeout for hwdb-test

This test does a lot of mmap/madvise/unmmap, which is slow under address sanitizer.
Just increase the timeout to avoid spurious failure.

6 years agotest: increase timeout for test-journal-enum
Zbigniew Jędrzejewski-Szmek [Sun, 26 Nov 2017 12:18:45 +0000 (13:18 +0100)] 
test: increase timeout for test-journal-enum

This reads the journal from the host system, and in case of a slow
disk, the 30s default can be easily exceeded.

6 years agoexec-util: initialize `new` before using it (#7471)
Evgeny Vereshchagin [Sun, 26 Nov 2017 11:46:56 +0000 (14:46 +0300)] 
exec-util: initialize `new` before using it (#7471)

CID #1383004

6 years agoMerge pull request #7464 from poettering/cgroup-control-fix
Zbigniew Jędrzejewski-Szmek [Sun, 26 Nov 2017 10:34:24 +0000 (11:34 +0100)] 
Merge pull request #7464 from poettering/cgroup-control-fix

various cgroup fixes

6 years agoMerge pull request #7468 from yuwata/fix-7362
Yu Watanabe [Sun, 26 Nov 2017 03:35:07 +0000 (12:35 +0900)] 
Merge pull request #7468 from yuwata/fix-7362

test and meson cleanups

6 years agoMerge pull request #7467 from yuwata/fix-7302
Zbigniew Jędrzejewski-Szmek [Sat, 25 Nov 2017 22:13:12 +0000 (23:13 +0100)] 
Merge pull request #7467 from yuwata/fix-7302

nspawn: adjust path to static resolv.conf to support split usr

6 years agofileio: include sys/mman.h 7468/head
Yu Watanabe [Sat, 25 Nov 2017 17:40:23 +0000 (02:40 +0900)] 
fileio: include sys/mman.h

6 years agomeson: update header file to detect memfd_create()
Yu Watanabe [Sat, 25 Nov 2017 17:17:06 +0000 (02:17 +0900)] 
meson: update header file to detect memfd_create()

6 years agoupdate TODO 7464/head
Lennart Poettering [Fri, 24 Nov 2017 17:29:29 +0000 (18:29 +0100)] 
update TODO

6 years agocore: warn about left-over processes in cgroup on unit start
Lennart Poettering [Fri, 24 Nov 2017 21:02:22 +0000 (22:02 +0100)] 
core: warn about left-over processes in cgroup on unit start

Now that we don't kill control processes anymore, let's at least warn
about any processes left-over in the unit cgroup at the moment of
starting the unit.

6 years agocore: generalize the cgroup empty check on GC
Lennart Poettering [Fri, 24 Nov 2017 19:27:01 +0000 (20:27 +0100)] 
core: generalize the cgroup empty check on GC

Let's move the cgroup empty check for all unit types into the generic
unit_check_gc() call, out of the per-unit-type _check_gc() type. This
not only allows us to share some code, but also hooks up mount and
socket units with this kind of check, for free, as it was missing there
previously.

6 years agocgroup: remove logic for maintaining /control subcgroup for the service unit type
Lennart Poettering [Fri, 24 Nov 2017 19:11:27 +0000 (20:11 +0100)] 
cgroup: remove logic for maintaining /control subcgroup for the service unit type

Previously, in the service unit type we ran all control processes in a
special subcgroup /control of the unit's main cgroup. Remove that, and
run the control program in the main cgroup instead.

The concept conflicts with cgroupv2's logic of "no processes in inner
nodes": if a unit has a main daemon process running in the main cgroup,
and a reload control process would be started in the /control subcgroup,
then this would necessarily fail, as the main daemon process would
become an inner node process that way.

We could in theory continue to support this in cgroupv1, but in the
interest in keeping behaviour similar in both hierarchies, let's drop
this altogether.

Philosophically maybe it wasn't the greatest idea anyway to just go
berserk and SIGKILL all those processes — loud warning logging might
have sufficed, too.

6 years agounit: initialize bpf cgroup realization state properly
Lennart Poettering [Fri, 24 Nov 2017 18:51:36 +0000 (19:51 +0100)] 
unit: initialize bpf cgroup realization state properly

Before this patch, the bpf cgroup realization state was implicitly set
to "NO", meaning that the bpf configuration was realized but was turned
off. That means invalidation requests for the bpf stuff (which we issue
in blanket fashion when doing a daemon reload) would actually later
result in a us re-realizing the unit, under the assumption it was
already realized once, even though in reality it never was realized
before.

This had the effect that after each daemon-reload we'd end up realizing
*all* defined units, even the unloaded ones, populating cgroupfs with
lots of unneeded empty cgroups.

With this fix we properly set the realiazation state to "INVALIDATED",
i.e. indicating the bpf stuff was never set up for the unit, and hence
when we try to invalidate it later we won't do anything.

6 years agocgroup: when dispatching the cgroup realization queue, check again if we shall actual...
Lennart Poettering [Fri, 24 Nov 2017 18:48:38 +0000 (19:48 +0100)] 
cgroup: when dispatching the cgroup realization queue, check again if we shall actually realize

We add units to the cgroup realization queue when propagating realizing
requests to sibling units, and when invalidating cgroup settings because
some cgroup setting changed. In the time between where we add the unit
to the queue until the cgroup is actually dispatched the unit's state
might have changed however, so that the unit doesn't actually need to be
realized anymore, for example because the unit went down. To handle
that, check the unit state again, if realization makes sense.

Redundant realization is usually not a problem, except when the unit is
not actually running, hence check exactly for that.

6 years agocgroup: drop unused parameter from function
Lennart Poettering [Fri, 24 Nov 2017 18:37:01 +0000 (19:37 +0100)] 
cgroup: drop unused parameter from function

6 years agocgroup-util: merge cg_set_tasks_access() and cg-set_group_access() into one
Lennart Poettering [Fri, 24 Nov 2017 17:30:23 +0000 (18:30 +0100)] 
cgroup-util: merge cg_set_tasks_access() and cg-set_group_access() into one

We never use these functions seperately, hence don't bother splitting
them into to.

Also, simplify things a bit, and maintain tables for the attribute files
to chown. Let's also update those tables a bit, and include thenew
"cgroup.threads" file in it, that needs to be delegated too, according
to the documentation.

6 years agomkosi: let's switch to the unified mode for mkosi
Lennart Poettering [Fri, 24 Nov 2017 17:29:35 +0000 (18:29 +0100)] 
mkosi: let's switch to the unified mode for mkosi

This is a toolconfiguration for developers, and hence most likely should
be the first thing to be switched over. Do so.

6 years agotest: set log_level to info in test-hwdb and check-help-*
Yu Watanabe [Sat, 25 Nov 2017 15:01:55 +0000 (00:01 +0900)] 
test: set log_level to info in test-hwdb and check-help-*

These tests check the stderr. So, if the systemd.log_level=debug
is set in the kernel command line, then these tests fail.
This set log_level to info in hwdb-test.sh and meson-check-help.sh,
the kernel command line not to change the output of the target
programs.

Fixes #7362.

6 years agoAdded Chuwi HiBook support (#7465)
Vladislav Vishnyakov [Sat, 25 Nov 2017 14:40:55 +0000 (21:40 +0700)] 
Added Chuwi HiBook support (#7465)

6 years agoMerge pull request #7449 from yuwata/clang-warnings
Zbigniew Jędrzejewski-Szmek [Sat, 25 Nov 2017 14:38:08 +0000 (15:38 +0100)] 
Merge pull request #7449 from yuwata/clang-warnings

Several cleanups

6 years agonspawn: adjust path to static resolv.conf to support split usr 7467/head
Yu Watanabe [Sat, 25 Nov 2017 12:11:04 +0000 (21:11 +0900)] 
nspawn: adjust path to static resolv.conf to support split usr

Fixes #7302.

6 years agomeson: remove abbreviations in status
Yu Watanabe [Sat, 25 Nov 2017 11:35:24 +0000 (20:35 +0900)] 
meson: remove abbreviations in status

6 years agofirstboot: do not write vconsole.conf when arg_keymap is empty 7449/head
Yu Watanabe [Sat, 25 Nov 2017 10:11:57 +0000 (19:11 +0900)] 
firstboot: do not write vconsole.conf when arg_keymap is empty

6 years agomachine: remove unused variables
Yu Watanabe [Fri, 24 Nov 2017 01:48:58 +0000 (10:48 +0900)] 
machine: remove unused variables

6 years agojournald: add _printf_ attribute to server_driver_message()
Yu Watanabe [Fri, 24 Nov 2017 01:48:21 +0000 (10:48 +0900)] 
journald: add _printf_ attribute to server_driver_message()