1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-06 08:26:52 +03:00
Commit Graph

36733 Commits

Author SHA1 Message Date
Yu Watanabe
3839535a53 libudev: make util_resolve_subsys_kernel() return negative errno
This also replaces udev_device by sd_device in the function.
2018-11-21 17:31:16 +09:00
Yu Watanabe
c0c591544a udev/scsi_id: fix buffer length 2018-11-21 17:30:49 +09:00
Yu Watanabe
01cbafe184 test: add tests for util_replace_whitespace() 2018-11-21 17:30:49 +09:00
Yu Watanabe
df8ba4fa0e libudev-util: make util_replace_whitespace() not count leading white spaces 2018-11-21 17:30:45 +09:00
Yu Watanabe
646acebd58 libudev-util: make util_replace_*() return size_t 2018-11-21 16:35:20 +09:00
Yu Watanabe
805a7097ee libudev-util: add assertions 2018-11-21 16:32:54 +09:00
Lennart Poettering
e3b8d0637d core: run env generators with non-zero umask
For PID 1 we adjust the umask to 0, but generators should not run that
way, given that they might be implemented as shell scripts and such.
Let's hence explicitly adjust the umask for them.

We already do this for unit generators. Let's do this for env
generators, too.
2018-11-20 23:35:04 +01:00
Evgeny Vereshchagin
f5f9a580dd tests: skip test_exec_ambientcapabilities on Travis CI under ASan
Let's not bother contributors with spurious failures nobody can't
seem to reproduce. There is an issue about that where we're trying
to figure out what's going on: https://github.com/systemd/systemd/issues/10696.
2018-11-20 20:23:19 +01:00
Lennart Poettering
f81f8bac2c
Merge pull request #10853 from poettering/thaw-containers
main: don't freeze PID 1 in containers, exit with non-zero instead
2018-11-20 19:35:30 +01:00
Lennart Poettering
163ef57488
Merge pull request #10858 from poettering/tmpfiles-fixlets
more tmpfiles fixlets
2018-11-20 19:09:37 +01:00
Lennart Poettering
bb25977244 main: don't freeze PID 1 in containers, exit with non-zero instead
After all we have a nice way to propagate total failures, hence let's
use it.
2018-11-20 17:04:07 +01:00
Lennart Poettering
bb85a58208 main: use EXIT_EXCEPTION instead of EXIT_FAILURE at two more exceptional places 2018-11-20 17:04:07 +01:00
Lennart Poettering
f2fb2ec942 nspawn: use EXIT_EXCEPTION where appropriate 2018-11-20 17:04:07 +01:00
Lennart Poettering
3584d3ca4f exit-status: introduce EXIT_EXCEPTION mapping to 255 2018-11-20 17:04:07 +01:00
Lennart Poettering
bd0ce2447d tmpfiles: also order glob child/parent relationships
This is necessary so that "r" can be nested and are always executed in
the same order.

Fixes: #10191
2018-11-20 16:36:29 +01:00
Lennart Poettering
09f467ac24 tmpfiles: fix typo 2018-11-20 16:32:19 +01:00
Lennart Poettering
44ac4f8854 tmpfiles: label phases explicitly 2018-11-20 16:15:09 +01:00
Lennart Poettering
48d9690430 tmpfiles: behind → below in log msgs
As suggested here:

https://github.com/systemd/systemd/pull/10538#pullrequestreview-176710207
2018-11-20 15:56:55 +01:00
Lennart Poettering
fd78fd122a man: minor fixes
As suggested here:

https://github.com/systemd/systemd/pull/10538#pullrequestreview-176710207
2018-11-20 15:56:24 +01:00
Zbigniew Jędrzejewski-Szmek
7fa0269bca
Merge pull request #10850 from poettering/log-setup
reduce some logging boilerplate
2018-11-20 13:36:45 +01:00
Zbigniew Jędrzejewski-Szmek
ad0cdb6b67 veritysetup-generator: treat '-' and '_' as equivalent 2018-11-20 13:19:08 +01:00
Zbigniew Jędrzejewski-Szmek
606b0b64a7
Merge pull request #10538 from poettering/tmpfiles-reorder
tmpfiles: remove children before their parents plus other fixlets
2018-11-20 13:00:28 +01:00
Lennart Poettering
e27686053c
Merge pull request #10831 from keszybz/less-libbasic
Move various files that don't need to be in basic/ to shared/
2018-11-20 12:44:30 +01:00
Lennart Poettering
6bf3c61c57 log: introduce new helper call log_setup_service()
Let's reduce the common boilerplate and have a single setup function
used by all service code to setup logging.
2018-11-20 11:18:22 +01:00
Lennart Poettering
afe44c8ffd generators: introduce a common implementation for the log setup boilerplate 2018-11-20 10:57:50 +01:00
Zbigniew Jędrzejewski-Szmek
4874191d9d
Merge pull request #10787 from yuwata/libudev-cleanups
libudev: drop unused private functions
2018-11-20 10:42:19 +01:00
Zbigniew Jędrzejewski-Szmek
a03d43593c journal: fix sort order of header includes 2018-11-20 07:27:37 +01:00
Zbigniew Jędrzejewski-Szmek
a98dc693e4 CODING_STYLE: fix rules for STRLEN and recommend strjoina more strongly
Again, this mostly matches what is happening in the codebase already.
2018-11-20 07:27:37 +01:00
Zbigniew Jędrzejewski-Szmek
a527f70a41 CODING_STYLE: clarify the rules for the src/basic & src/shared split
The rule is changed from "put in basic unless there's a reason not to" to "put
in shared unless there's a reason not to", to match the change done in previous
commit. This minimizes libbasic. See previous commit for the reasons why this
is useful.

Previously, the guideline was based on whether the files in question use
"publicly exported APIs". This distinction is not particularly relevant. Let's
consider all other programs we compile: most of them use "publicly exported
APIs", usually linking to libsystemd-shared.so for the actual code. But those
programs are not forced to be in src/basic, and the distinction whether they
happen to use 'sd-*.h' or not is of no importance. The same is true for files
in src/shared/. If we didn't have publicly exported shared objects, we'd put
everything in libsystemd-shared.so. So let's only move things out of it that we
need to. Previous guideline was not "wrong", in the sense that it created *a*
split that was functional (no code in src/shared was required in the publicly
exported shared objects), but it put more files in basic/ then necessary.

Not much changes in practice, because (as previous commit shows), moving files
between libbasic.a and libsystemd-shared.so mostly just changes compilation
order.

The list of components which cannot use libsystemd-shared.so is adjusted.
2018-11-20 07:27:37 +01:00
Zbigniew Jędrzejewski-Szmek
4de8d971f0 meson: drop libblkid from libbasic
This doesn't seem to change anything, because libmount links to libblkid anyway.
But we don't need to include this dep directly in libbasic.
2018-11-20 07:27:37 +01:00
Zbigniew Jędrzejewski-Szmek
d284b82b3e Move various files that don't need to be in basic/ to shared/
This doesn't have much effect on the final build, because we link libbasic.a
into libsystemd-shared.so, so in the end, all the object built from basic/
end up in libsystemd-shared. And when the static library is linked into binaries,
any objects that are included in it but are not used are trimmed. Hence, the
size of output artifacts doesn't change:

$ du -sb /var/tmp/inst*
54181861	/var/tmp/inst1    (old)
54207441	/var/tmp/inst1s   (old split-usr)
54182477	/var/tmp/inst2    (new)
54208041	/var/tmp/inst2s   (new split-usr)

(The negligible change in size is because libsystemd-shared.so is bigger
by a few hundred bytes. I guess it's because symbols are named differently
or something like that.)

The effect is on the build process, in particular partial builds. This change
effectively moves the requirements on some build steps toward the leaves of the
dependency tree. Two effects:
- when building items that do not depend on libsystemd-shared, we
  build less stuff for libbasic.a (which wouldn't be used anyway,
  so it's a net win).
- when building items that do depend on libshared, we reduce libbasic.a as a
  synchronization point, possibly allowing better parallelism.

Method:
1. copy list of .h files from src/basic/meson.build to /tmp/basic
2. $ for i in $(grep '.h$' /tmp/basic); do echo $i; git --no-pager grep "include \"$i\"" src/basic/ 'src/lib*' 'src/nss-*' 'src/journal/sd-journal.c' |grep -v "${i%.h}.c";echo ;done | less
2018-11-20 07:27:37 +01:00
Yu Watanabe
f921b457a7 libudev: coding style fixes 2018-11-20 14:38:35 +09:00
Yu Watanabe
5ea78a39e5 libudev-list: move libudev-list related definitions to libudev-list-internal.h
This also rename libudev-private.h to libudev-util.h, and cleanups
several unnecessary headers from udev.h and libudev-util.h
2018-11-20 14:38:35 +09:00
Yu Watanabe
170e4380b6 libudev: drop prototypes for nonexistent functions 2018-11-20 14:38:35 +09:00
Yu Watanabe
c84954e8ed libudev-monitor: drop unused private functions 2018-11-20 14:38:35 +09:00
Yu Watanabe
53369277ec libudev-device: drop unused private functions 2018-11-20 14:38:35 +09:00
Yu Watanabe
02edd80d87 udev: move definition of READ_END and WRITE_END from libudev-private.h to udev.h 2018-11-20 14:38:35 +09:00
Yu Watanabe
278939be7a
Merge pull request #10847 from evverx/journald-stream-fuzzer
tests: add a fuzzer for journald streams
2018-11-20 13:37:27 +09:00
Xuanwo
c4a2deba7e zsh-completion: Add support for set-property (#10322) 2018-11-20 13:17:11 +09:00
Yu Watanabe
27b99f2912
Merge pull request #10801 from ssc-services/zsh-completion_machinectl_clone
zsh-completion: complete available, not running machines for `clone`
2018-11-20 13:13:41 +09:00
Yu Watanabe
f23ff5ba51
Merge pull request #10835 from poettering/transient-env-fix
fix flushing out of transient env vars from PID1's Manager object
2018-11-20 12:53:51 +09:00
Lennart Poettering
cc7a0bfa15 bootspec: introduce SYSTEMD_ESP_PATH for overriding where to look for the ESP (#10834) 2018-11-20 12:37:01 +09:00
David Leeds
53640e6fb9 process-util: check for correct kill return value (#10841)
Code was not doing a wait() after kill() due to checking for a return value > 0, and was leaving zombie processes. This affected things like  sd-bus unixexec connections.
2018-11-20 12:35:36 +09:00
Lennart Poettering
012c2f761b tree-wide: use __ prefixed gcc attributes (#10843)
As suggest here:

https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html#Attribute-Syntax

    "You may optionally specify attribute names with ‘__’ preceding and
    following the name. This allows you to use them in header files without
    being concerned about a possible macro of the same name. For example,
    you may use the attribute name __noreturn__ instead of noreturn. "
2018-11-20 12:34:08 +09:00
Yu Watanabe
52048013b7
Merge pull request #10845 from poettering/static-destruct
RFC: introduce automatic destructors for static variables
2018-11-20 12:31:52 +09:00
Lennart Poettering
bd7989a3d9 tests: always use the right vtable wrapper calls
Prompted by https://github.com/systemd/systemd/pull/10836#discussion_r234598868
2018-11-20 05:34:29 +03:00
Evgeny Vereshchagin
9541f5ff5c tests: add a fuzzer for journald streams 2018-11-20 03:03:32 +01:00
Lennart Poettering
1acacd737b test-execute: fix killing of unit processes
Let's use the correct wrapper for calling unit vtable functions. Let's
make sure we always use the right wrappers, and never bypass them
needlessly.

Moreover use SIGKILL rather than "9" as signal name. Let's not be
needlessly cryptic.

Follow-up for: f7f8e8cbb9
2018-11-19 21:53:23 +01:00
Lennart Poettering
f7f00fb15b doc: document the boot menu entry identifier vocabulary
The existing text already said "See below regarding a recommended
vocabulary for boot loader entry identifiers.", but the section for it
was still missing. Let's fill in the missing bits, and describe basic
suggested rules for the boot menu entry identifier vocabulary, in
particular how to identify Windows and MacOS X installations, and how to
name automatic entries vs. explicitly configured ones.

This basically follows the logic implemented in sd-boot these days.
2018-11-19 21:52:28 +01:00
Lennart Poettering
a64841779a meson: order source files alphabetically 2018-11-19 21:50:54 +01:00