1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 02:21:44 +03:00
Commit Graph

37353 Commits

Author SHA1 Message Date
Yu Watanabe
d7276b61bd missing: move missing entries in keyctl.h to missing_keyctl.h 2018-12-04 07:42:32 +01:00
Yu Watanabe
475c18f06a meson: add missing missing_*.h 2018-12-04 07:34:47 +01:00
William A. Kennington III
3a5d89fa82 analyze: Fix if not HAVE_SECCOMP
The new systemd analyze code dependend on routines provided by
libseccomp even if HAVE_SECCOMP is false. This expands the code disabled
in analyze-security to make sure we don't depend on seccomp.
2018-12-04 13:51:59 +09:00
Yu Watanabe
b1c7e54ad7
Merge pull request #11039 from yuwata/fix-11036
missing: re-add mistakenly dropped entries
2018-12-04 13:48:47 +09:00
Evgeny Vereshchagin
05b36f1f65 travis: install llvm to get llvm-symbolizer
See https://clang.llvm.org/docs/AddressSanitizer.html#symbolizing-the-reports
2018-12-04 04:56:02 +01:00
Yu Watanabe
22b749d6ef missing: rearrange missing_if_link.h to support centos 2018-12-04 02:35:36 +01:00
Yu Watanabe
b6459df80f missing: re-add mistakenly dropped entries
These entries are mistakenly dropped by 9714c020fc.

Fixes #11036.
2018-12-04 01:45:14 +01:00
Evgeny Vereshchagin
b8366c5497 travis: also run the tests built with clang under ASan+UBsan 2018-12-04 01:10:13 +01:00
Zbigniew Jędrzejewski-Szmek
c2f4bcfcc1 shared/generator: reword comment for clarity 2018-12-03 23:55:29 +01:00
Zbigniew Jędrzejewski-Szmek
f0c5cda251 man: add missing descriptions of fstab options to systemd.swap(5) 2018-12-03 23:52:39 +01:00
Zbigniew Jędrzejewski-Szmek
de59724865 man: split the descriptions of Job*TimeoutSec and JobTimeoutAction
Those are really two different things, and it seems more natural to describe them
as separate items.
2018-12-03 23:52:22 +01:00
Lennart Poettering
94a80afed4 format-table: never try to reuse cells that have color/url/uppercase set
The table cell reusing code is supposed to be an internal memory
optimization, and not more. This means behaviour should be the same as
if we wouldn't reuse cells.
2018-12-03 22:42:38 +01:00
Lennart Poettering
9969b54279 tree-wide: specify all table headers in lower-case 2018-12-03 22:42:38 +01:00
Lennart Poettering
359abf6dd0 format-table: add option to uppercase cells on display
This adds a per-cell option for uppercasing displayed strings.
Implicitly turn this on for the header row. The fact that we format the
table header in uppercase is a formatting thing after all, hence should
be applied by the formatter, i.e. the table display code.

Moreover, this provides us with the benefit that we can more nicely
reuse the specified table headers as JSON field names, like we already
do: json field names are usually not uppercase.
2018-12-03 22:42:38 +01:00
Lennart Poettering
ad9d139e02 machinectl: optionally output table in JSON 2018-12-03 22:42:38 +01:00
Lennart Poettering
e3483674ec loginctl: optionally output table in json
This works now:

  $ loginctl list-session --output=json-pretty
2018-12-03 22:42:38 +01:00
Lennart Poettering
31ac235771 format-table: optionally covert/output table to JSON 2018-12-03 22:42:38 +01:00
Lennart Poettering
c93d372d7c format-table: use right field for display
Since .timespan and .timestamp are unionized on top of each other this
doesn't actually matter, but it is still more correct to address it
under it's correct name.
2018-12-03 22:42:38 +01:00
Lennart Poettering
e4cbdffe28 output-mode: add new helper OUTPUT_MODE_IS_JSON()
Just a pretty way to determine whether the selected output mode is a
JSON output mode.
2018-12-03 22:42:38 +01:00
Lennart Poettering
9e964bb8e4 output-mode: add generic helper to pick right JsonFormatFlags for given OutputMode 2018-12-03 22:42:38 +01:00
Lennart Poettering
ab91733c7e json: add new display flag JSON_FORMAT_COLOR_AUTO
Typically we want to enable color when colors_enabled() says so, hence
let's automatize this.
2018-12-03 22:42:38 +01:00
Lennart Poettering
897f099bb0 json: introduce explicit type for json formatting flags 2018-12-03 22:42:38 +01:00
Lennart Poettering
63e688cc3b
Merge pull request #11031 from poettering/gcc-attr-cleanup
various gcc attribute clean-ups
2018-12-03 21:59:00 +01:00
David Malcolm
1e8817b327 analyze: tweak wording of description for ProtectSystem= (#11035) 2018-12-03 21:57:09 +01:00
Susant Sahani
d3aa8b49e5 networkd: bridge add support to configure multicast_to_unicast
closes #10649
2018-12-03 23:49:46 +05:30
Lennart Poettering
a365325e04
Merge pull request #10567 from cdown/disable_controller
cgroup: Add DisableControllers= directive to disable controller in subtree
2018-12-03 18:58:29 +01:00
Lennart Poettering
76b31bbb24
Merge pull request #10920 from yuwata/hashmap-destructor
hashmap: make hashmap_free() call destructors of key or value
2018-12-03 17:59:44 +01:00
Lennart Poettering
a20f73221a
Merge pull request #10976 from yuwata/typesafe-netlink-call
netlink: introduce typesafe netlink functions
2018-12-03 17:55:00 +01:00
Lennart Poettering
0df54921bc tree-wide: use new macro HAS_FEATURE_ADDRESS_SANITIZER everywhere 2018-12-03 17:38:50 +01:00
Lennart Poettering
02e062262f sd-bus: use _variable_no_sanitize_address_ also for BUS_ERROR_MAP_ELF_REGISTER 2018-12-03 17:35:50 +01:00
Lennart Poettering
7fdf40d247 static-destruct: turn on new _variable_no_sanitize_address_ variable for STATIC_DESTRUCTOR_REGISTER 2018-12-03 17:35:50 +01:00
Lennart Poettering
026c2677fc macro: add macro for llvm no_sanitize_address attribute
We want it for global variables, which LLVM supports and GCC currently
does not (GCC does support it for functions, but we care about global
variables here).

Why is this relevant? When asan is used global variables are padded with
hotzones before and after. But we can't have that for the registration
variables we place in special ELF sections: we want them tightly packed
so that we can iterate through them.

Note that for gcc this isn't an issue, as it will pack stuff in
non-standard sections anyway, even if asan is used.
2018-12-03 17:35:50 +01:00
Lennart Poettering
be5f77b26e macro: define HAS_FEATURE_ADDRESS_SANITIZER also on gcc
Let's make differences between compilers more minimal.
2018-12-03 17:35:50 +01:00
Evgeny Vereshchagin
289acab951 util-lib: introduce HAS_FEATURE_ADDRESS_SANITIZER
https://clang.llvm.org/docs/AddressSanitizer.html#conditional-compilation-with-has-feature-address-sanitizer
2018-12-03 17:35:42 +01:00
Lennart Poettering
f36c39aae5 test: add test for static destructor 2018-12-03 17:34:23 +01:00
Chris Down
c72703e26d cgroup: Add DisableControllers= directive to disable controller in subtree
Some controllers (like the CPU controller) have a performance cost that
is non-trivial on certain workloads. While this can be mitigated and
improved to an extent, there will for some controllers always be some
overheads associated with the benefits gained from the controller.
Inside Facebook, the fix applied has been to disable the CPU controller
forcibly with `cgroup_disable=cpu` on the kernel command line.

This presents a problem: to disable or reenable the controller, a reboot
is required, but this is quite cumbersome and slow to do for many
thousands of machines, especially machines where disabling/enabling a
stateful service on a machine is a matter of several minutes.

Currently systemd provides some configuration knobs for these in the
form of `[Default]CPUAccounting`, `[Default]MemoryAccounting`, and the
like. The limitation of these is that Default*Accounting is overrideable
by individual services, of which any one could decide to reenable a
controller within the hierarchy at any point just by using a controller
feature implicitly (eg. `CPUWeight`), even if the use of that CPU
feature could just be opportunistic. Since many services are provided by
the distribution, or by upstream teams at a particular organisation,
it's not a sustainable solution to simply try to find and remove
offending directives from these units.

This commit presents a more direct solution -- a DisableControllers=
directive that forcibly disallows a controller from being enabled within
a subtree.
2018-12-03 15:40:31 +00:00
Chris Down
4f6f62e468 cgroup: Traverse leaves to realised cgroup to release controllers
This adds a depth-first version of unit_realize_cgroup_now which can
only do depth-first disabling of controllers, in preparation for the
DisableController= directive.
2018-12-03 14:37:39 +00:00
Chris Down
a57669d290 cgroup: Rework unit_realize_cgroup_now to explicitly be breadth-first
systemd currently doesn't really expend much effort in disabling
controllers. unit_realize_cgroup_now *may* be able to disable a
controller in the basic case when using cgroup v2, but generally won't
manage as downstream dependents may still use it.

This code doesn't add any logic to fix that, but it starts the process
of moving to have a breadth-first version of unit_realize_cgroup_now for
enabling, and a depth-first version of unit_realize_cgroup_now for
disabling.
2018-12-03 14:37:39 +00:00
Chris Down
0d2d6fbf15 cgroup: Move attribute application into unit_create_cgroup
We always end up doing these together, so just colocate them and require
manager state for unit_create_cgroup.
2018-12-03 14:37:38 +00:00
Lennart Poettering
a898603563 sd-bus,static-destruct: clean up how we do our ELF section magic
This cleans up a bit how we set up things for the ELF section magic:

1. Let's always use our gcc macros, instead of __attribute__ directly

2. Align our structures to sizeof(void*), i.e. the pointer size, rather
   than a fixed 8 or __BIGGEST_ALIGNMENT__. The former is unnecessarily
   high for 32bit systems, the latter too high for 64bit systems. gcc
   seems to use ptr alignment for static variables itself, hence this
   should be good enough for us too. Moreover, the Linux kernel also
   uses pointer alginment for all its ELF section registration magic,
   hence this should be good enough for us too.

3. Let's always prefix the sections we create ourself with SYSTEMD_,
   just to make clear where they come from.

4. Always align the pointer we start from when iterating through these
   lists. This should be unnecessary, but makes things nicely
   systematic, as we'll align all pointers we use to access these
   sections properly.
2018-12-03 13:28:26 +01:00
Lennart Poettering
90b365cee0 json: use new _align_() macro 2018-12-03 13:28:26 +01:00
Lennart Poettering
2ee1c55d6c tree-wide: drop redundant space between __attribute__ and ((
We follow no general rule, but in most cases we do not place a space
outside of macro.h. Hence let's stick to that, and adapt macro.h too,
and follow the rule systematically that there shall not be a space
between __attribute__ and ((...

Yes, this does not matter at all, and is purely OCD cosmetics. But then
again, the uses of __attribute__ are very local only, hence the changes
cleaning this up are small and are unlikely to have to be repeated too
often...
2018-12-03 13:28:26 +01:00
Lennart Poettering
d752090f3e macro: add macros for a couple of more gcc attributes we use 2018-12-03 13:28:26 +01:00
Lennart Poettering
d34dae1817 tree-wide: use gcc attribute macros where appropriate
We have these macros already, hence use them.
2018-12-03 13:28:26 +01:00
Yu Watanabe
7934dede41 network: drop unnecessary buffers 2018-12-03 12:15:26 +01:00
Lennart Poettering
ad2bf5df89
Merge pull request #10992 from yuwata/follow-up-10948
network: make fib rule accept arbitrary ip protocol
2018-12-03 11:09:04 +01:00
Yu Watanabe
9714c020fc missing: split network related entries
Also adds comments which kernel version added the entries.

Closes #10553.
2018-12-03 10:31:05 +01:00
Harald Hoyer
4a3b569445 sd-boot: remove Stall() call (#11029)
This is left-over from debugging.
2018-12-03 10:27:26 +01:00
Susant Sahani
d0e728b6cd test-network: add test for ISATAP 2018-12-03 09:16:06 +05:30
Susant Sahani
918049ad53 networkd: Add support to configure ISATAP tunnel
Let's just reuse the code of sit tunnel to create a ISATAP tunnel.
Matter of turning a flag

Please see https://elixir.bootlin.com/linux/v4.19.6/source/net/ipv6/sit.c#L208
2018-12-03 09:15:24 +05:30