1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-28 03:25:31 +03:00
Commit Graph

39634 Commits

Author SHA1 Message Date
Yu Watanabe
54c1a6ab8c core: change type of Service::timeout_abort_set to bool
Follow-up for dc653bf487 (#11211).
2019-04-14 20:13:47 +09:00
Yu Watanabe
d90a044f49
Merge pull request #12288 from yuwata/resolve-bond-rafactoring
resolve,network: tiny cleanups
2019-04-13 22:43:21 +09:00
Franck Bui
63f28cad3e tmpfiles: split tmp.conf out
tmp.conf was dealing with 2 different kind of paths: one dealing with general
temporary paths such as /var/tmp and /tmp and the other one dealing with
temporary directories owned by systemd.

If for example a user wants to adjust the age argument of the general paths
only, he had to overload the whole file which is cumbersome and error prone
since any future changes in tmp.conf shipped by systemd will be lost.

So this patch splits out tmp.conf so the systemd directories are dealt
separately in a dedicated conf file. It's named "systemd-tmp.conf" based on the
naming recommendation made in tmpfiles.d man page.

In practice it shouldn't cause any regression since it's very unlikely that
users override paths owned by systemd.
2019-04-13 12:07:03 +02:00
Dominick Grift
8f1ed04ad6 nspawn: Fix volatile SELinux label
nspawn should associate the specified nspawn container apifs object label instead of the nspawn container process label with the volatile tmpfs
2019-04-13 12:03:02 +02:00
Yu Watanabe
cc83684947
Merge pull request #12296 from poettering/coding-style-sections
split CODING_STYLE document into multiple thematic sections
2019-04-13 18:23:13 +09:00
Yu Watanabe
eeda619a1e
Merge pull request #12290 from poettering/json-foreach-love
some small JSON foreach macro love
2019-04-13 18:19:38 +09:00
Yu Watanabe
c12e138f21
Merge pull request #12293 from poettering/tiny-journal-modernizations
four simple journal modernizations
2019-04-13 18:19:15 +09:00
Yu Watanabe
3e8afae5b5 network: re-indent conf parser and wrap long lines in bond.c 2019-04-13 17:52:00 +09:00
Yu Watanabe
674c96fc44 network: use OrderedSet for bond ARP ip targets 2019-04-13 17:52:00 +09:00
Yu Watanabe
45f735815e ordered-set: add missing ordered_set_size() 2019-04-13 17:52:00 +09:00
Yu Watanabe
1e2a490e91 network: drop allocation for Bond::ad_actor_system 2019-04-13 17:51:59 +09:00
Yu Watanabe
f200093337 network: drop bond_mode_to_kernel() and bond_xmit_hash_policy_to_kernel() 2019-04-13 17:51:59 +09:00
Yu Watanabe
ae695a9eda arp-util: use net/ethernet.h instead of netinet/if_ether.h
The header net/ethernet.h is used at all other places where
'struct ether_addr' is required.
2019-04-13 17:51:59 +09:00
Yu Watanabe
603192b2e8 resolve: use log_link_*() macro 2019-04-13 17:51:59 +09:00
Yu Watanabe
6ff79f7640 resolve: rename Link.name -> Link.ifname
This also changes the type from char[IF_NAMESIZE] to char*.
By changing the type, now resolved-link.h can drop the dependency to
the header net/if.h.
2019-04-13 17:51:59 +09:00
Jan Klötzke
dc653bf487 service: handle abort stops with dedicated timeout
When shooting down a service with SIGABRT the user might want to have a
much longer stop timeout than on regular stops/shutdowns. Especially in
the face of short stop timeouts the time might not be sufficient to
write huge core dumps before the service is killed.

This commit adds a dedicated (Default)TimeoutAbortSec= timer that is
used when stopping a service via SIGABRT. In all other cases the
existing TimeoutStopSec= is used. The timer value is unset by default
to skip the special handling and use TimeoutStopSec= for state
'stop-watchdog' to keep the old behaviour.

If the service is in state 'stop-watchdog' and the service should be
stopped explicitly we still go to 'stop-sigterm' and re-apply the usual
TimeoutStopSec= timeout.
2019-04-12 17:32:52 +02:00
Sebastian Jennen
1ace223ca7 code style format: clang-format applied to src/a*/*
[zj: this is a subset of changes generated by clang-format, just the ones
  I think improve readability or consistency.]

This is a part of https://github.com/systemd/systemd/pull/11811.
2019-04-12 17:26:33 +02:00
Chris Down
c52db42b78 cgroup: Implement default propagation of MemoryLow with DefaultMemoryLow
In cgroup v2 we have protection tunables -- currently MemoryLow and
MemoryMin (there will be more in future for other resources, too). The
design of these protection tunables requires not only intermediate
cgroups to propagate protections, but also the units at the leaf of that
resource's operation to accept it (by setting MemoryLow or MemoryMin).

This makes sense from an low-level API design perspective, but it's a
good idea to also have a higher-level abstraction that can, by default,
propagate these resources to children recursively. In this patch, this
happens by having descendants set memory.low to N if their ancestor has
DefaultMemoryLow=N -- assuming they don't set a separate MemoryLow
value.

Any affected unit can opt out of this propagation by manually setting
`MemoryLow` to some value in its unit configuration. A unit can also
stop further propagation by setting `DefaultMemoryLow=` with no
argument. This removes further propagation in the subtree, but has no
effect on the unit itself (for that, use `MemoryLow=0`).

Our use case in production is simplifying the configuration of machines
which heavily rely on memory protection tunables, but currently require
tweaking a huge number of unit files to make that a reality. This
directive makes that significantly less fragile, and decreases the risk
of misconfiguration.

After this patch is merged, I will implement DefaultMemoryMin= using the
same principles.
2019-04-12 17:23:58 +02:00
Lennart Poettering
b4f12824a0 CODING_STYLE: rename "Others" section to "Code Organization and Semantics"
This is a bit of a grabbag, but it's the best I could come up with
without having lots of single-item sections.
2019-04-12 17:01:05 +02:00
Lennart Poettering
4467d39315 CODING_STYLE: split out section about runtime behaviour 2019-04-12 16:59:48 +02:00
Lennart Poettering
78e5b4d7ee CODING_STYLE: add section about C constructs use 2019-04-12 16:53:27 +02:00
Lennart Poettering
3b75e079a8 CODING_STYLE: split out section about deadlocks 2019-04-12 16:50:24 +02:00
Lennart Poettering
96f6cfbf62 CODING_STYLE: split out section about logging 2019-04-12 16:49:02 +02:00
Lennart Poettering
5638076135 CODING_STYLE: export section about exporting symbols 2019-04-12 16:45:03 +02:00
Lennart Poettering
c159efe341 CODING_STYLE: split out section about destructors 2019-04-12 16:42:44 +02:00
Lennart Poettering
996f119d97 CODING_STYLE: split out section about command line parsing 2019-04-12 16:40:34 +02:00
Lennart Poettering
b065e1f176 CODING_STYLE: Split out section about error handling 2019-04-12 16:38:14 +02:00
Lennart Poettering
831781b9c9 CODING_STYLE: split out section about commiting to git 2019-04-12 16:35:17 +02:00
Lennart Poettering
25553cd9cd CODING_STYLE: split out section about file descriptors 2019-04-12 16:34:01 +02:00
Lennart Poettering
0485824030 CODING_STYLE: split out section about memory allocations 2019-04-12 16:31:58 +02:00
Lennart Poettering
f42c1cd4b5 CODING_STYLE: move out section about Types 2019-04-12 16:28:35 +02:00
Lennart Poettering
971dfffab8 CODING_STYLE: add section about how to reference specific concepts 2019-04-12 16:28:35 +02:00
Lennart Poettering
8c9289e705 CODING_STYLE: split out bits about Formatting into its own section
(And, for now, add a section "Other" to separate the rest of the stuff)
2019-04-12 16:28:35 +02:00
Lennart Poettering
2d0dce2afe CODING_STYLE: add a section about functions not to use
Let's add sections to the document. First off, let's add one about
functions not to use.
2019-04-12 16:28:02 +02:00
Lennart Poettering
e3d36a8da3 journald: modernize config_parse_compress() a bit 2019-04-12 14:23:12 +02:00
Lennart Poettering
337fabf749 journald: rebreak a few comments 2019-04-12 14:23:12 +02:00
Lennart Poettering
e3d78cb160 journald: no need to check ptr for non-NULL before _unref(), as function does that anyway 2019-04-12 14:23:12 +02:00
Lennart Poettering
e4d9c98512 journald: use structure initialization 2019-04-12 14:23:08 +02:00
Lennart Poettering
b51629ad84
Merge pull request #12222 from yuwata/macsec
network: introduce MACsec
2019-04-12 13:59:30 +02:00
Lennart Poettering
3661dc349e
Merge pull request #12217 from keszybz/unlocked-operations
Refactor how we do unlocked file operations
2019-04-12 13:51:53 +02:00
Lennart Poettering
1b266e3c6f json: be more careful when iterating through a JSON object/array
Let's exit the loop early in case the variant is not actually an object
or array. This is safer since otherwise we might end up iterating
through these variants and access fields that aren't of the type we
expect them to be and then bad things happen.

Of course, this doesn't absolve uses of these macros to check the type
of the variant explicitly beforehand, but it makes it less bad if they
forget to do so.
2019-04-12 13:11:11 +02:00
Lennart Poettering
33d60b8d57 json: simplify JSON_VARIANT_OBJECT_FOREACH() macro a bit
There's no point in returning the "key" within each loop iteration as
JsonVariant object. Let's simplify things and return it as string. That
simplifies usage (since the caller doesn't have to convert the object to
the string anymore) and is safe since we already validate that keys are
strings when an object JsonVariant is allocated.
2019-04-12 13:11:11 +02:00
Zbigniew Jędrzejewski-Szmek
15de23a0b2
Merge pull request #12289 from poettering/news-pid-max
NEWS: explain the kernel.pid_max sysctl change
2019-04-12 12:12:18 +02:00
Lennart Poettering
6af9058324 NEWS: document kernel.pid_max change 2019-04-12 12:01:41 +02:00
Lennart Poettering
39e445c95d NEWS: fix typo 2019-04-12 12:01:23 +02:00
Zbigniew Jędrzejewski-Szmek
673a1e6fb9 Add fmemopen_unlocked() and use unlocked ops in fuzzers and some other tests
This might make things marginially faster. I didn't benchmark though.
2019-04-12 11:44:57 +02:00
Zbigniew Jędrzejewski-Szmek
2fe21124a6 Add open_memstream_unlocked() wrapper 2019-04-12 11:44:57 +02:00
Zbigniew Jędrzejewski-Szmek
b636d78aee core/smack-setup: add helper function for openat+fdopen
Unlocked operations are used in all three places. I don't see why just one was
special.

This also improves logging, since we don't just log the final component of the
path, but the full name.
2019-04-12 11:44:57 +02:00
Zbigniew Jędrzejewski-Szmek
02e23d1a1a Add fdopen_unlocked() wrapper 2019-04-12 11:44:57 +02:00
Zbigniew Jędrzejewski-Szmek
41f6e627d7 Make fopen_temporary and fopen_temporary_label unlocked
This is partially a refactoring, but also makes many more places use
unlocked operations implicitly, i.e. all users of fopen_temporary().
AFAICT, the uses are always for short-lived files which are not shared
externally, and are just used within the same context. Locking is not
necessary.
2019-04-12 11:44:56 +02:00