Commit Graph

30629 Commits

Author SHA1 Message Date
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
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
Lennart Poettering d3070fbdf6 core: implement /run/systemd/units/-based path for passing unit info from PID 1 to journald
And let's make use of it to implement two new unit settings with it:

1. LogLevelMax= is a new per-unit setting that may be used to configure
   log priority filtering: set it to LogLevelMax=notice and only
   messages of level "notice" and lower (i.e. more important) will be
   processed, all others are dropped.

2. LogExtraFields= is a new per-unit setting for configuring per-unit
   journal fields, that are implicitly included in every log record
   generated by the unit's processes. It takes field/value pairs in the
   form of FOO=BAR.

Also, related to this, one exisiting unit setting is ported to this new
facility:

3. The invocation ID is now pulled from /run/systemd/units/ instead of
   cgroupfs xattrs. This substantially relaxes requirements of systemd
   on the kernel version and the privileges it runs with (specifically,
   cgroupfs xattrs are not available in containers, since they are
   stored in kernel memory, and hence are unsafe to permit to lesser
   privileged code).

/run/systemd/units/ is a new directory, which contains a number of files
and symlinks encoding the above information. PID 1 creates and manages
these files, and journald reads them from there.

Note that this is supposed to be a direct path between PID 1 and the
journal only, due to the special runtime environment the journal runs
in. Normally, today we shouldn't introduce new interfaces that (mis-)use
a file system as IPC framework, and instead just an IPC system, but this
is very hard to do between the journal and PID 1, as long as the IPC
system is a subject PID 1 manages, and itself a client to the journal.

This patch cleans up a couple of types used in journal code:
specifically we switch to size_t for a couple of memory-sizing values,
as size_t is the right choice for everything that is memory.

Fixes: #4089
Fixes: #3041
Fixes: #4441
2017-11-16 12:40:17 +01:00
Lennart Poettering 4d14b2bd35 man: update SyslogXYZ= documentation a bit
Let's clarify that these settings only apply to stdout/stderr logging.
Always mention the journal before syslog (as the latter is in most ways
just a legacy alias these days). Always mention the +console cases too.
2017-11-16 12:40:17 +01:00
Lennart Poettering fc5f5706d3 man: rework the discussion of Storage= a bit
Most distributions default to persistent storage these days, hence don't
claim otherwise.
2017-11-16 12:40:17 +01:00
Lennart Poettering 131819424d journald: when logging about dropped messages, include more meta data
When we drop messages of a unit, we log about. Let's add some structured
data to that. Let's include how many messages we dropped, but more
importantly, let's link up the message we generate to the unit we
dropped the messages from by using the "OBJECT" logic, i.e. by
generating OBJECT_SYSTEMD_UNIT= fields and suchlike, that "journalctl
-u" and friends already look for.

Fixes: #6494
2017-11-16 12:40:17 +01:00
Lennart Poettering 500cbc4e9e journal: reindent field mapping tables
Let's fix up whitespace so that the tables look nicely aligned.
2017-11-16 12:40:17 +01:00
Lennart Poettering dde2637476 journal: make use of IOVEC_MAKE() where it makes sense 2017-11-16 12:40:17 +01:00
Lennart Poettering 53978b98f9 journal: move valid_user_field() to journal-util.[ch] and rename it → journal_field_valid()
Being able to validate journal field names is useful outside of the
journal itself.
2017-11-16 12:40:17 +01:00
Lennart Poettering eabd4eb934
Merge pull request #7356 from keszybz/cgroup-and-manager-cleanups
Cgroup and manager cleanups
2017-11-16 11:37:20 +01:00
Yu Watanabe 798499278a man: fix wrong tag (#7358) 2017-11-16 11:35:30 +01:00
Franck Bui 4cef192357 tmpfiles: when /etc is not fully initialized, some specifiers are expected to be unresolvable (#6860)
In chroot environments, /etc might not be fully initialized: /etc/machine-id
can be missing for example. This makes the expansions of affected specifiers
impossible at that time.

These cases should not be considered as errors and such failures shouldn't be
logged at an error level therefore this patch downgrades the level used to
LOG_NOTICE in such cases.

Also this is logged at LOG_NOTICE only the first time and then downgrade to
LOG_DEBUG for the rest. That way, if debugging is enabled we get the full
output, but otherwise we only see only one message.

The expansion of specifiers is now self contained in a dedicated function
instead of being spread all over the place.
2017-11-16 11:27:29 +01:00
Alan Jenkins 28abce5d25 systemctl: other wayland sessions should inhibit shutdown, like x11 sessions do (#7353)
Update systemctl code to match the manpage for sd_session_get_type().

"wayland" sessions should be treated the same as "x11".  "mir" too, fwiw.
2017-11-16 11:02:34 +01:00
Stefan Agner 8006aa32ee sd-dhcp6-client: Implement FQDN Option (#7309)
Implement DHCPv6 option to exchange information about the Fully
Qualified Domain Name (FQDN) according to RFC 4704.

The RFC 4704 describes two models of operations in section 3,
currently only the second model is supported (DHCPv6 server
updates both the AAAA and the PTR RRs).

The existing DHCP Section Options SendHostname and Hostname are
sent as FQDN to the server. According to section 4.2 sending
only parts of its FQDN is allowed.

Fixes #4682.
2017-11-16 10:07:07 +01:00
Stefan Agner 9740eae694 sd-dhcp-client: validate hostnames stricter (#7308)
Technically DNS allows any ASCII character to be used in the
domain name. Also the DHCP specification for the FQDN option
(RFC 4702) does not put restriction on labels.

However, hostnames do have stricter requirements and typically
should only use characters from a-z (case insensitve), 0-9 and
minus.

Currently we require hostname/FQDN to be either a hostname or
a valid DNS name. Since dns_name_is_valid() allows any ASCII
characters this allows to specify hostnames which are typically
not valid.

Check hostname/FQDN more strictly and require them to pass both
tests. Specifically this requires the entire FQDN to be below 63.
2017-11-16 10:05:44 +01:00
Lennart Poettering 0c08bc7f09 man: document that noauto doesn't affect automount units configured through /etc/fstab (#7350)
Fixes: #6937
2017-11-16 12:05:15 +09:00
Lennart Poettering 3e54b900e6 man: document interaction of --root= and the user/group databases (#7344)
Fixes: #7032
2017-11-16 12:00:56 +09:00
Lennart Poettering 2bcbffd6db NEWS: document the systemd-logind IP firewalling incompatibility (#7343)
Fixes: #7074
2017-11-16 11:57:32 +09:00
Lennart Poettering 7655cd3d58 man: document that generators can generate instances+templates and regular unit files (#7342)
This addition is kept brief on purpose, since in order to write a good
generator users don't really need to grok templating/instantiation.

Fixes: #7257
2017-11-16 11:37:25 +09:00
Lennart Poettering d38802e881 man: document explicitly that network-online.target doesn't track connectivity state dynamically (#7345)
Fixes: #5909
2017-11-16 11:26:27 +09:00
Zbigniew Jędrzejewski-Szmek 17f01ace62 core/manager: just return an error if we fail halfway
We would continue, but still return an error at the end. This isn't useful
because we'd still error-out in main().

Also, add a missing error message when we fail to mkdir.
2017-11-15 22:58:24 +01:00
Zbigniew Jędrzejewski-Szmek d4c819ed23 core: fix message about detected memory hierarchy
Just the error check and message were wrong, otherwise the logic was OK.
2017-11-15 22:58:24 +01:00
Zbigniew Jędrzejewski-Szmek 073e8f0956 test-cgroup-util: add basic test for cg_all_unified/cg_hybrid_unified/cg_unified_controller 2017-11-15 22:58:24 +01:00
Zbigniew Jędrzejewski-Szmek 9aa2113365 util-lib: add debug messages when checking cgroup layout
This has become very complex, let's make it a bit easier to diagnose.
2017-11-15 22:58:24 +01:00
Zbigniew Jędrzejewski-Szmek 47a78d4102 Use plural DelegateControllers= consistently 2017-11-15 22:58:24 +01:00
Zbigniew Jędrzejewski-Szmek 5427b6afdb Update TODO 2017-11-15 22:58:24 +01:00
Roland Hieber e5bb1de8dd man/systemd-socket-proxyd: fix unit dependencies in examples (#7340)
This was probably a typo, since depending proxy-to-nginx.service on
itself makes no sense, but depending on the socket does.

Signed-off-by: Roland Hieber <r.hieber@pengutronix.de>
2017-11-15 11:51:56 +01:00
Lennart Poettering 0986658d51
Merge pull request #6866 from sourcejedi/set-linger2
logind: fix `loginctl enable-linger`
2017-11-15 11:15:15 +01:00
Piotr Drąg aed54a2e02 po: specify a glib preset (#7333)
It gives us a list of standard arguments passed to gettext,
see <http://mesonbuild.com/i18n-module.html#i18ngettext>.
2017-11-15 07:45:24 +01:00
Lennart Poettering f6e11b394e core: fix bus property logic for RequiresMountsFor= dependencies (#7332)
We get a pointer to a pointer to a Hashmap, instead of just a pointer to
a Hashmap, let's handle that properly.
2017-11-14 21:50:59 +01:00
Zbigniew Jędrzejewski-Szmek 5aa9556306
Merge pull request #7313 from keszybz/msgformat
i18n: drop intltool use, use meson's merge_file directly
2017-11-14 21:48:42 +01:00