Commit graph

30658 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 35df744355 Add SPDX license headers to python scripts 2017-11-19 19:08:15 +01:00
Zbigniew Jędrzejewski-Szmek d74a9adf93 Add SPDX indentifier to hwdb/parse_hwdb.py 2017-11-19 19:08:15 +01:00
Zbigniew Jędrzejewski-Szmek 572eb058cf Add SPDX license identifiers to man pages 2017-11-19 19:08:15 +01:00
Zbigniew Jędrzejewski-Szmek f0465e73f8 Add SPDX license identifiers to catalog and po files 2017-11-19 19:08:15 +01:00
Zbigniew Jędrzejewski-Szmek e7145211c7 Add SPDX license identifiers to source files under the GPL 2017-11-19 19:08:15 +01:00
Zbigniew Jędrzejewski-Szmek 53e1b68390 Add SPDX license identifiers to source files under the LGPL
This follows what the kernel is doing, c.f.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5fd54ace4721fc5ce2bb5aef6318fcf17f421460.
2017-11-19 19:08:15 +01:00
Lennart Poettering 5c856d1e6c
Merge pull request #7388 from keszybz/doc-tweak
Add link to kernel docs about no_new_privs and drop note about CPU controller
2017-11-19 17:50:35 +01:00
Lennart Poettering d3590acede machined: support "machinectl bind" on non-directories (#7349)
Fixes: #7195
2017-11-19 14:23:29 +01:00
Zbigniew Jędrzejewski-Szmek c12ad58c41 man: remove note about CPU controller being unmerged
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0d5936344f30aba0f6ddb92b030cb6a05168efe6

In principle we shouldn't merge this until after 4.15 is released, but the
chances of a revert upstream are low, and in that unlikely scenario we can just
revert this patch, it's a trivial documentation update after all.
2017-11-19 14:15:42 +01:00
Zbigniew Jędrzejewski-Szmek 34b3f471f8
Merge pull request #7365 from poettering/nspawn-bind-userns
nspawn: document --bind= and --private-users relationship, and make recursive chown()ing safe
2017-11-19 14:01:39 +01:00
Zbigniew Jędrzejewski-Szmek a6fabe384d man: add link to kernel docs about no_new_privs 2017-11-19 11:58:45 +01:00
Lennart Poettering f56e7bfe2b core: be more defensive if we can't determine per-connection socket peer (#7329)
Let's handle gracefully if a client disconnects very early on.

This builds on #4120, but relaxes the condition checks further, since we
getpeername() might already fail during ExecStartPre= and friends.

Fixes: #7172
2017-11-17 15:22:11 +01:00
John Lin c37b4f3f9f man: rescue.target could be seen as single-user.target (#7323) 2017-11-17 15:20:48 +01:00
Lennart Poettering b94f4313e8 man: document that start limiting of GC'ed units doesn't work (#7337)
Fixes: #7139
2017-11-17 15:18:30 +01:00
Zbigniew Jędrzejewski-Szmek a53dbb34ff
Merge pull request #7360 from poettering/preset-fix
Some fixes for preset-all logic at boot, plus main.c reworking
2017-11-17 15:00:22 +01:00
Zbigniew Jędrzejewski-Szmek f04c052025
Merge pull request #7338 from poettering/doc-restart-fix
improve unit restart documentation a bit
2017-11-17 14:51:51 +01:00
Lennart Poettering 2642122898 install: when we encounter a transient/generated unit while presetting all, skip over it silently
Fixes: #7100
2017-11-17 11:28:17 +01:00
Lennart Poettering a68aef7a95 main: uid_to_name() might theoretically fail, handle that 2017-11-17 11:28:17 +01:00
Lennart Poettering 1e41242e11 core: shorten main() a bit, split out coredump initialization
No functional changes.
2017-11-17 11:28:17 +01:00
Lennart Poettering e839bafdf4 main: let's make main() shorter, let's split out clock initialization
no functional changes
2017-11-17 11:28:17 +01:00
Lennart Poettering 4a36297c41 main: let's make main() shorter, let's split out invocation of shutdown binary
No functional changes
2017-11-17 11:28:17 +01:00
Lennart Poettering 6808a0bc80 core: let's shorten main() a bit, let's split out telinit redirection into a separate function 2017-11-17 11:28:17 +01:00
Lennart Poettering 7b46fc6adc main: add set_manager_settings(), similar in style to set_manager_defaults() 2017-11-17 11:28:17 +01:00
Lennart Poettering fd1306121d core: never apply first boot presets in the initrd
Presets are useful to initialize uninitialized /etc, but that doesn't
apply to the initrd.

Also, let's rename etc_empty → first_boot. After all, the variable
doesn't actually reflect whether /etc is really empty, it just reflects
whether /etc/machine-id existed originally or not. Moreover, we later on
directly initialize manager_set_first_boot() from it, hence let's just
name it the same way all through the codepath, to make this all less
confusing.

See: #7100
2017-11-17 11:28:17 +01:00
Lennart Poettering 85cb415124 main: rename manager_set_defaults() → set_manager_defaults()
This function is really not a method of the Manager object (implemented
in manager.c), but just a helper in main.c. Hence let's not confusingly
name it the way methods are called.
2017-11-17 11:28:17 +01:00
Lennart Poettering 3d80d4541b update TODO 2017-11-17 11:25:02 +01:00
Lennart Poettering 8adf53582c man: document that ExecStop= is executed during restarts
Fixes: #7126
2017-11-17 11:25:02 +01:00
Lennart Poettering 78a263f432 man: add missing suffixing "=" for setting name 2017-11-17 11:25:02 +01:00
Lennart Poettering ff946d8243 man: write "stop and start" instead of "restart" when explaining the reload fallback operations
We already made a similar change when talking about the "restart"
command, let's also do this for "systemctl reload" and friends.

Follow-up for: 6539dd7c42

See: #7126
2017-11-17 11:25:02 +01:00
Lennart Poettering c4f2aaa45b man: document the interaction of "systemctl restart" and the FD store
See: #7126
2017-11-17 11:25:02 +01:00
Lennart Poettering 3603efdea5 nspawn: make recursive chown()ing logic safe for being aborted in the middle
We currently use the ownership of the top-level directory as a hint
whether we need to descent into the whole tree to chown() it recursively
or not. This is problematic with the previous chown()ing algorithm, as
when descending into the tree we'd first chown() and then descend
further down, which meant that the top-level directory would be chowned
first, and an aborted recursive chowning would appear on the next
invocation as successful, even though it was not. Let's reshuffle things
a bit, to make the re-chown()ing safe regarding interruptions:

a) We chown() the dir we are looking at last, and descent into all its
   children first. That way we know that if the top-level dir is
   properly owned everything inside of it is properly owned too.

b) Before starting a chown()ing operation, we mark the top-level
   directory as owned by a special "busy" UID range, which we can use to
   recognize whether a tree was fully chowned: if it is marked as busy,
   it's definitely not fully chowned, as the busy ownership will only be
   fixed as final step of the chowning.

Fixes: #6292
2017-11-17 11:12:33 +01:00
Lennart Poettering 14f8ccc755 nspawn: add missing #pragma once to header file 2017-11-17 11:12:33 +01:00
Lennart Poettering 57a4359ee0 fs-util: add access_fd() which is like access() but for fds
Linux doesn't have faccess(), hence let's emulate it. Linux has access()
and faccessat() but neither allows checking the access rights of an fd
passed in directly.
2017-11-17 11:12:33 +01:00
Lennart Poettering 994a6364d2 man: document how nspawn's --bind= and --private-users interact
Fixes: #5900
2017-11-17 11:12:33 +01:00
Zbigniew Jędrzejewski-Szmek 05d69e0294 test-cgroup-util: skip cg hierarchy tests when necessary (#7371) 2017-11-17 11:10:21 +01:00
Lennart Poettering bb84995789 nspawn: correctly document the relationship of --keep-unit and --register=no (#7364)
Fixes: #7228
2017-11-17 10:54:50 +01:00
Yu Watanabe 1bdfc7b951 core/cgroup: assigning empty string to Delegate= resets list of controllers (#7336)
Before this, assigning empty string to Delegate= makes no change to the
controller list. This is inconsistent to the other options that take list
of strings. After this, when empty string is assigned to Delegate=, the
list of controllers is reset. Such behavior is consistent to other options
and useful for drop-in configs.

Closes #7334.
2017-11-17 10:04:25 +01:00
Lennart Poettering cefdf55b58
Merge pull request #7357 from yuwata/7314-mod
mount: add "-G" as shortcut for "--property=CollectMode=inactive-or-failed"
2017-11-17 09:49:07 +01:00
Evgeny Vereshchagin 5535d8f7a9 cgroup: assume the use of v1 when all the preceding checks fail (#7366)
This patch restores the default that was changed in 2977724b09,
making the tools depending on it work again.

Closes: #6477 and https://github.com/lxc/lxc/issues/1669
2017-11-17 09:47:49 +01:00
Yu Watanabe de345d3464 mount: show which argument is invalid 2017-11-17 16:43:38 +09:00
Yu Watanabe dc3364832c mount: add "-G" as shortcut for "--property=CollectMode=inactive-or-failed" 2017-11-17 16:43:33 +09:00
Lennart Poettering 83123ab8fd
Merge pull request #7314 from poettering/gc-mode
add new CollectMode= unit file setting for tweaking the unit garbage collection logic
2017-11-16 16:32:36 +01:00
Lennart Poettering 2368e9748a update TODO 2017-11-16 14:38:36 +01:00
Lennart Poettering fe9d0be90b run: add "-G" as shortcut for "--property=CollectMode=inactive-or-failed"
This option is likely to be very useful for systemd-run invocations,
hence let's add a shortcut for it.

With this new concepts it's now very easy to put together systemd-run
invocations that leave zero artifacts in the system, including when they
fail.
2017-11-16 14:38:36 +01:00
Lennart Poettering 5afe510c89 core: add a new unit file setting CollectMode= for tweaking the GC logic
Right now, the option only takes one of two possible values "inactive"
or "inactive-or-failed", the former being the default, and exposing same
behaviour as the status quo ante. If set to "inactive-or-failed" units
may be collected by the GC logic when in the "failed" state too.

This logic should be a nicer alternative to using the "-" modifier for
ExecStart= and friends, as the exit data is collected and logged about
and only removed when the GC comes along. This should be useful in
particular for per-connection socket-activated services, as well as
"systemd-run" command lines that shall leave no artifacts in the
system.

I was thinking about whether to expose this as a boolean, but opted for
an enum instead, as I have the suspicion other tweaks like this might be
a added later on, in which case we extend this setting instead of having
to add yet another one.

Also, let's add some documentation for the GC logic.
2017-11-16 14:38:36 +01:00
Lennart Poettering 7eb2a8a125 unit: rework a bit how we keep the service fdstore from being destroyed during service restart
When preparing for a restart we quickly go through the DEAD/INACTIVE
service state before entering AUTO_RESTART. When doing this, we need to
make sure we don't destroy the FD store. Previously this was done by
checking the failure state of the unit, and keeping the FD store around
when the unit failed, under the assumption that the restart logic will
then get into action.

This is not entirely correct howver, as there might be failure states
that will no result in restarts.

With this commit we slightly alter the logic: a ref counter for the fd
store is added, that is increased right before we handle the restart
logic, and decreased again right-after.

This should ensure that the fdstore lives exactly as long as it needs.

Follow-up for f0bfbfac43.
2017-11-16 14:37:33 +01:00
Zbigniew Jędrzejewski-Szmek 6af6a50a0b
Merge pull request #7246 from poettering/journal-extra-fields
add new per-unit LogLevelMax= and LogExtraField= setting
2017-11-16 14:24:53 +01:00
Zbigniew Jędrzejewski-Szmek 12c4ee0af3 man: mention how to provision Ubuntu and Tanglu for nspawn (#7359)
Also add urls. Urls are nice.
2017-11-16 13:40:35 +01:00
Zbigniew Jędrzejewski-Szmek 88bff42450 test-unit-file: add test for config_parse_log_extra_fields() 2017-11-16 12:40:17 +01:00
Lennart Poettering 8b8de13d54 man: document LogFieldMax= and LogExtraFields= 2017-11-16 12:40:17 +01:00