]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
5 years agosd-bus: make add match method callback slot "floating" 9132/head
Lennart Poettering [Wed, 30 May 2018 14:35:36 +0000 (16:35 +0200)] 
sd-bus: make add match method callback slot "floating"

When we allocate an asynchronous match object we will allocate an
asynchronous bus call object to install the match server side.
Previously the call slot would be created as regular slot, i.e.
non-floating which meant installing the match even if it was itself
floating would result in a non-floating slot to be created internally,
which ultimately would mean the sd_bus object would be referenced by it,
and thus never be freed.

Let's fix that by making the match method callback floating in any case
as we have no interest in leaving the bus allocated beyond the match
slot.

Fixes: #8551
5 years agobus-slot: for bus slot objects with no explicit description use the match string...
Lennart Poettering [Wed, 30 May 2018 14:34:06 +0000 (16:34 +0200)] 
bus-slot: for bus slot objects with no explicit description use the match string as description

Let's make debugging a but easier with implicit descriptions for some
match objects.

5 years agoman: document the new sd_bus_slot_set_floating() call
Lennart Poettering [Wed, 30 May 2018 14:33:12 +0000 (16:33 +0200)] 
man: document the new sd_bus_slot_set_floating() call

Also extend the memory management description of sd-bus highlighting the
effect of "floating" slot objects a bit.

5 years agosd-bus: add new sd_bus_slot_set_floating() call
Lennart Poettering [Wed, 30 May 2018 14:29:33 +0000 (16:29 +0200)] 
sd-bus: add new sd_bus_slot_set_floating() call

This new call allows explicit control of the "floating" state of a bus
slot object. This is useful for creating a bus slot object first,
retaining a reference to it, using it for making changes to the slot
object (for example, set a description) and then handing it over to
sd-bus for lifecycle management.

It's also useful to fix #8551.

5 years agoman: fix minor typo
Lennart Poettering [Wed, 30 May 2018 14:28:28 +0000 (16:28 +0200)] 
man: fix minor typo

5 years agonetworkd: Add ability to set MULTICAST flag on interface
Susant Sahani [Tue, 29 May 2018 14:58:11 +0000 (20:28 +0530)] 
networkd: Add ability to set MULTICAST flag on interface

Closes #9113

fix ARP toggling flag

5 years agopo: update French translation
Sylvain Plantefève [Tue, 29 May 2018 19:26:39 +0000 (21:26 +0200)] 
po: update French translation

5 years agoMerge pull request #9120 from poettering/timedated-timezone-minifixes
Yu Watanabe [Wed, 30 May 2018 03:56:23 +0000 (12:56 +0900)] 
Merge pull request #9120 from poettering/timedated-timezone-minifixes

Minor improvements to timedated

5 years agotree-wide: fix typo in comments and NEWS
Yu Watanabe [Tue, 29 May 2018 16:07:37 +0000 (01:07 +0900)] 
tree-wide: fix typo in comments and NEWS

5 years agoman: recommend After= with Requisite=
Zbigniew Jędrzejewski-Szmek [Tue, 22 May 2018 10:19:27 +0000 (12:19 +0200)] 
man: recommend After= with Requisite=

Fixes #8309.

5 years agojournal-file: avoid joining offline thread
Vito Caputo [Mon, 28 May 2018 22:09:55 +0000 (15:09 -0700)] 
journal-file: avoid joining offline thread

In journal_file_set_online() the offline thread doesn't need to be
joined if it's been canceled before actually reaching the phase of
writing the offline state.

5 years agotimedated: add some debug logging when a number of kernel calls fail 9120/head
Lennart Poettering [Tue, 29 May 2018 10:39:16 +0000 (12:39 +0200)] 
timedated: add some debug logging when a number of kernel calls fail

5 years agotimedated: show the short timezone name when changing timezones in logs
Lennart Poettering [Tue, 29 May 2018 10:36:40 +0000 (12:36 +0200)] 
timedated: show the short timezone name when changing timezones in logs

5 years agoconf-parser: add a bit more whitespace
Lennart Poettering [Mon, 28 May 2018 19:47:43 +0000 (21:47 +0200)] 
conf-parser: add a bit more whitespace

We usually seperate case statements within a switch from each other by
empty lines. We also often add an empty line after multi-line function
prototypes, let's do so here too

Also, no trailing ; after }...

5 years agocore: drop deprecated (and ignored) configuration items from --dump-configuration...
Lennart Poettering [Mon, 28 May 2018 19:47:12 +0000 (21:47 +0200)] 
core: drop deprecated (and ignored) configuration items from --dump-configuration-items output

5 years agoMerge pull request #9116 from poettering/tmpfiles-tmp-var-tmp
Zbigniew Jędrzejewski-Szmek [Tue, 29 May 2018 13:23:03 +0000 (15:23 +0200)] 
Merge pull request #9116 from poettering/tmpfiles-tmp-var-tmp

add new specifiers %T and %V that expand to /tmp or /var/tmp or $TMP/$TMPDIR/$TEMP

5 years agoMerge pull request #9084 from yuwata/fix-8965
Zbigniew Jędrzejewski-Szmek [Tue, 29 May 2018 13:13:34 +0000 (15:13 +0200)] 
Merge pull request #9084 from yuwata/fix-8965

core: make StateDirectory= or friends works with DynamicUser= and RootDirectory=/RootImage=

5 years agoupdate TODO 9116/head
Lennart Poettering [Tue, 29 May 2018 09:40:49 +0000 (11:40 +0200)] 
update TODO

5 years agoman: don't refer to "service manager" in tmpfiles.d(5)
Lennart Poettering [Tue, 29 May 2018 09:32:27 +0000 (11:32 +0200)] 
man: don't refer to "service manager" in tmpfiles.d(5)

system-tmpfiles is not a "service manager" hence say "command" instead.

5 years agoresolved: reindent specifier table
Lennart Poettering [Tue, 29 May 2018 09:30:10 +0000 (11:30 +0200)] 
resolved: reindent specifier table

5 years agocore: introduce specifiers for /tmp and /var/tmp
Lennart Poettering [Tue, 29 May 2018 09:25:26 +0000 (11:25 +0200)] 
core: introduce specifiers for /tmp and /var/tmp

This corresponds nicely with the specifiers we already pass for
/var/lib, /var/cache, /run and so on.

This is particular useful to update the test-path service files to
operate without guessable files, thus allowing multiple parallel
test-path invocations to pass without issues (the idea is to set $TMPDIR
early on in the test to some private directory, and then only use the
new %T or %V specifier to refer to it).

5 years agoman: sort specifier list in systemd.unit(5) alphabetically
Lennart Poettering [Tue, 29 May 2018 09:13:40 +0000 (11:13 +0200)] 
man: sort specifier list in systemd.unit(5) alphabetically

Usually, we order our settings in our unit files in a logical order,
grouping related settings together, and putting more relevant stuff
first, instead of following a strictly alphabetical order.

For specifiers I think it makes sense to follow an alphabetical order
however, since they literally are just characters, and hence I think the
concept of alphabetical ordering is much more commanding for them. Also,
since specifiers are usually not used in combination, but mostly used
indepdently of each other I think it's not that important to group
similar ones together.

No other changes except the reordering.

5 years agodoc: mention RestrictNamespaces= merges multiple assignment now
Yu Watanabe [Tue, 29 May 2018 06:11:35 +0000 (15:11 +0900)] 
doc: mention RestrictNamespaces= merges multiple assignment now

Follow-up for #8817.

5 years agoMerge pull request #9103 from keszybz/more-tables-tests
Lennart Poettering [Mon, 28 May 2018 12:24:19 +0000 (14:24 +0200)] 
Merge pull request #9103 from keszybz/more-tables-tests

More tables tests

5 years agoMerge pull request #9104 from keszybz/nspawn-umask
Lennart Poettering [Mon, 28 May 2018 12:24:00 +0000 (14:24 +0200)] 
Merge pull request #9104 from keszybz/nspawn-umask

Nspawn umask

5 years agomeson: test out headers with more standard versions
Zbigniew Jędrzejewski-Szmek [Mon, 28 May 2018 07:07:36 +0000 (09:07 +0200)] 
meson: test out headers with more standard versions

They all pass fine, but let's keep testing regularly.

5 years agoMerge pull request #9099 from yuwata/list-dbus-prop
Zbigniew Jędrzejewski-Szmek [Mon, 28 May 2018 09:42:02 +0000 (11:42 +0200)] 
Merge pull request #9099 from yuwata/list-dbus-prop

completion: fixes for `systemctl status --property`

5 years agoman: use IMAGE for portable service image name 9099/head
Yu Watanabe [Mon, 28 May 2018 09:16:32 +0000 (18:16 +0900)] 
man: use IMAGE for portable service image name

5 years agobash-completion: add completion for portablectl
Yu Watanabe [Mon, 28 May 2018 06:38:19 +0000 (15:38 +0900)] 
bash-completion: add completion for portablectl

5 years agobash-completion: also suggest template unit files
Yu Watanabe [Mon, 28 May 2018 05:57:00 +0000 (14:57 +0900)] 
bash-completion: also suggest template unit files

Fixes #9041.

5 years agozsh-completion: suggest bus properties instead of configuration items for 'systemctl -p'
Zbigniew Jędrzejewski-Szmek [Mon, 28 May 2018 06:41:04 +0000 (08:41 +0200)] 
zsh-completion: suggest bus properties instead of configuration items for 'systemctl -p'

5 years agobash-completion: suggest bus properties instead of configuration items for 'systemctl -p'
Yu Watanabe [Mon, 28 May 2018 05:19:16 +0000 (14:19 +0900)] 
bash-completion: suggest bus properties instead of configuration items for 'systemctl -p'

Closes #5137.

5 years agocore: add --dump-bus-properties option to systemd
Yu Watanabe [Mon, 28 May 2018 09:13:19 +0000 (18:13 +0900)] 
core: add --dump-bus-properties option to systemd

If systemd is invoked with this option, this dumps all bus properties.
This may be useful for shell completion for `systemctl --property`.

5 years agonspawn: reset umask early 9104/head
Zbigniew Jędrzejewski-Szmek [Mon, 28 May 2018 09:01:30 +0000 (11:01 +0200)] 
nspawn: reset umask early

Fixes #8911.

5 years agonspawn: remove some vertical whitespace
Zbigniew Jędrzejewski-Szmek [Mon, 28 May 2018 08:53:11 +0000 (10:53 +0200)] 
nspawn: remove some vertical whitespace

Sometimes an empty line is good for readability, but here I think
they all can be removed without any loss.

5 years agotest-nspawn-tables: add another "tables" test 9103/head
Zbigniew Jędrzejewski-Szmek [Mon, 28 May 2018 08:38:03 +0000 (10:38 +0200)] 
test-nspawn-tables: add another "tables" test

5 years agomeson: use a convenience static library for nspawn core
Zbigniew Jędrzejewski-Szmek [Mon, 28 May 2018 08:37:11 +0000 (10:37 +0200)] 
meson: use a convenience static library for nspawn core

This makes it easier to link the nspawn implementation to the tests.
Right now this just means that nspawn-patch-uid.c is not compiled
twice, which is nice, but results in test-patch-uid being slightly bigger,
which is not nice. But in general, we should use convenience libs to
compile everything just once, as far as possible. Otherwise, once we
start compiling a few files here twice, and a few file there thrice, we
soon end up in a state where we are doing hundreds of extra compilations.
So let's do the "right" thing, even if is might not be more efficient.

5 years agotest-tables,test-network-tables: add a few more tests
Zbigniew Jędrzejewski-Szmek [Mon, 28 May 2018 08:33:30 +0000 (10:33 +0200)] 
test-tables,test-network-tables: add a few more tests

5 years agotest-tables*: sort
Zbigniew Jędrzejewski-Szmek [Mon, 28 May 2018 07:38:14 +0000 (09:38 +0200)] 
test-tables*: sort

5 years agopo: update Polish translation
Piotr Drąg [Mon, 28 May 2018 05:24:25 +0000 (07:24 +0200)] 
po: update Polish translation

5 years agopo: update japanese translation
Yu Watanabe [Mon, 28 May 2018 01:36:19 +0000 (10:36 +0900)] 
po: update japanese translation

5 years agocore: include sd-bus-vtable.h in dbus-*.h
Yu Watanabe [Mon, 28 May 2018 04:36:35 +0000 (13:36 +0900)] 
core: include sd-bus-vtable.h in dbus-*.h

5 years agoMerge pull request #9092 from keszybz/sd-bus-cleanup-more
Yu Watanabe [Mon, 28 May 2018 01:38:54 +0000 (10:38 +0900)] 
Merge pull request #9092 from keszybz/sd-bus-cleanup-more

sd-bus: use _cleanup_ more

5 years agoUpdate POTFILES.in
Piotr Drąg [Sun, 27 May 2018 08:33:59 +0000 (10:33 +0200)] 
Update POTFILES.in

5 years agodoc: fix quoting 9092/head
Zbigniew Jędrzejewski-Szmek [Sat, 26 May 2018 15:02:53 +0000 (17:02 +0200)] 
doc: fix quoting

Noticed by Craig Barnes.

5 years agoportablectl: fix memleaks
Yu Watanabe [Sat, 26 May 2018 11:56:44 +0000 (20:56 +0900)] 
portablectl: fix memleaks

Fixes #9089.

5 years agoportable: fix memleak
Yu Watanabe [Sat, 26 May 2018 11:49:43 +0000 (20:49 +0900)] 
portable: fix memleak

Closes #9086.

5 years agosd-bus: use _cleanup_ more
Zbigniew Jędrzejewski-Szmek [Sat, 26 May 2018 14:56:01 +0000 (16:56 +0200)] 
sd-bus: use _cleanup_ more

5 years agojournalctl: add with-unit mode 8245/head
Luca Boccassi [Tue, 22 May 2018 11:22:00 +0000 (12:22 +0100)] 
journalctl: add with-unit mode

When dealing with a large number of template instances, for example
when launching daemons per VRF, it is hard for operators to correlate
log lines to arguments.
Add a new with-unit mode which, if available, prefixes unit and user
unit names when displaying its log messages instead of the syslog
identifier. It will also use the full timestamp with timezones, like
the short-full mode.

5 years agotree-wide: drop unused variables
Yu Watanabe [Fri, 25 May 2018 09:09:01 +0000 (18:09 +0900)] 
tree-wide: drop unused variables

Follow-ups for #8620.

5 years agoMerge pull request #8620 from poettering/portablectl
Zbigniew Jędrzejewski-Szmek [Fri, 25 May 2018 08:48:12 +0000 (10:48 +0200)] 
Merge pull request #8620 from poettering/portablectl

an implementation of the "portable services" concept

5 years agocore: setup mount namespace when RootDirectory= and RuntimeDirectory= or friends... 9084/head
Yu Watanabe [Fri, 25 May 2018 08:32:55 +0000 (17:32 +0900)] 
core: setup mount namespace when RootDirectory= and RuntimeDirectory= or friends are set

The directories specified by RuntimeDirectory= or friends are created
on host. So, it is necessary to bind-mount them on root directory.

5 years agocore: make StateDirectory= or friends works with DynamicUser= and RootDirectory=...
Yu Watanabe [Fri, 25 May 2018 08:25:17 +0000 (17:25 +0900)] 
core: make StateDirectory= or friends works with DynamicUser= and RootDirectory=/RootImage=

The symbolic links to private directories specified by StateDirectory=
or its friends are created on the host. So, when DynamicUser= and
RootDirectory=/RootImage= are set, then the executed process cannot
access private directory.
This makes the private directories are mounted on the non-private place
when both DynamicUser= and RootDirectory=/RootImage= are set.

Fixes #8965.

5 years agobasic: fix raw_clone() on 32-bit sparc
Mike Gilbert [Thu, 24 May 2018 14:48:55 +0000 (10:48 -0400)] 
basic: fix raw_clone() on 32-bit sparc

The clone syscall uses the same semantics as on 64-bit. The trap number
for syscall entry is different.

Bug: https://bugs.gentoo.org/656368

5 years agoupdate TODO 8620/head
Lennart Poettering [Mon, 16 Apr 2018 10:37:25 +0000 (12:37 +0200)] 
update TODO

5 years agodoc: add introductory docs for portable services
Lennart Poettering [Tue, 17 Apr 2018 16:43:42 +0000 (18:43 +0200)] 
doc: add introductory docs for portable services

5 years agoman: add man pages for the portable service stuff
Lennart Poettering [Tue, 17 Apr 2018 15:40:34 +0000 (17:40 +0200)] 
man: add man pages for the portable service stuff

5 years agoadd new portable service framework
Lennart Poettering [Mon, 16 Apr 2018 19:41:40 +0000 (21:41 +0200)] 
add new portable service framework

This adds a small service "systemd-portabled" and a matching client
"portablectl", which implement the "portable service" concept.

The daemon implements the actual operations, is PolicyKit-enabled and is
activated on demand with exit-on-idle.

Both the daemon and the client are an optional build artifact, enabled
by default rhough.

5 years agomachined: move bus_reply_pair_array() into generic utilities
Lennart Poettering [Mon, 9 Apr 2018 17:44:21 +0000 (19:44 +0200)] 
machined: move bus_reply_pair_array() into generic utilities

This way, we can reuse it in portabled.

5 years agomachined: unify how we forward image method calls from manager to image object
Lennart Poettering [Fri, 6 Apr 2018 17:18:47 +0000 (19:18 +0200)] 
machined: unify how we forward image method calls from manager to image object

Much like the previous commit, but for Image objects rather than Machine
objects.

5 years agomachined: introduce a common function for redirecting machine method calls from manag...
Lennart Poettering [Fri, 6 Apr 2018 17:09:53 +0000 (19:09 +0200)] 
machined: introduce a common function for redirecting machine method calls from manager to machine object

Let's shorten the code a bit, and unify how we forward executoin from
the machine functions that take a machine name as first argument to the
matching functions on the machine object.

5 years agomachine-image: extend search path
Lennart Poettering [Tue, 17 Apr 2018 09:08:54 +0000 (11:08 +0200)] 
machine-image: extend search path

This adds directories in /etc and /run to the search paths for OS
images. While it doesn't make much sense to actually place huge disk
images there, it's good enough for symlinks to those.

The main reason for supporting this is that this allows us to neatly
symlink portable image files located outside of the search path into the
search path when attaching them, so that attaching them also means they
are discoverable properly for all commands.

5 years agomachine-image: add 'discoverable' flag for images
Lennart Poettering [Tue, 17 Apr 2018 09:14:57 +0000 (11:14 +0200)] 
machine-image: add 'discoverable' flag for images

This new flag indicates whether the image object was found in the search
paths using the usual algorithm, or was instantiated by path.

This is useful for code that wants to know whether an image may be
referenced by its shortened name or must be specified by its full name.

5 years agomachine-image: add proper refcounting
Lennart Poettering [Mon, 16 Apr 2018 19:38:24 +0000 (21:38 +0200)] 
machine-image: add proper refcounting

5 years agomachine-image: add APIs for converting arbitrary image paths into Image objects
Lennart Poettering [Fri, 6 Apr 2018 16:58:28 +0000 (18:58 +0200)] 
machine-image: add APIs for converting arbitrary image paths into Image objects

5 years agomachine-image: fix a debug log message
Lennart Poettering [Fri, 6 Apr 2018 16:57:08 +0000 (18:57 +0200)] 
machine-image: fix a debug log message

5 years agomachine-image: rework error handling
Lennart Poettering [Fri, 6 Apr 2018 16:53:57 +0000 (18:53 +0200)] 
machine-image: rework error handling

Let's rework error handling a bit in image_find() and friends: when we
can't find an image, return -ENOENT rather than 0. That's better as
before we violated the usual rule in our codebase that return parameters
are initialized when the return value is >= 0 and otherwise not touched.

This also makes enumeration and validation a bit more strict: we'll only
accept ".raw" as suffix for regular files, and filter out this suffix
handling on directories/subvolumes, where it makes no sense.

5 years agomachine-image: use pretty names if we already have them and validated them
Lennart Poettering [Thu, 5 Apr 2018 16:01:54 +0000 (18:01 +0200)] 
machine-image: use pretty names if we already have them and validated them

5 years agomachine-image: validate pretty names when auto-generating them
Lennart Poettering [Thu, 5 Apr 2018 16:01:27 +0000 (18:01 +0200)] 
machine-image: validate pretty names when auto-generating them

5 years agomachine-image: fix duplicate detection when discovering images
Lennart Poettering [Thu, 5 Apr 2018 15:56:22 +0000 (17:56 +0200)] 
machine-image: fix duplicate detection when discovering images

We need to chop off the .raw suffix from the files we find before we can
test it against the hashmap. Hence do that.

And while we are at it, we can pass the pretty name into image_make(),
since we already have it properly formatted.

5 years agomachine-image: introduce two different classes of images
Lennart Poettering [Thu, 5 Apr 2018 13:39:43 +0000 (15:39 +0200)] 
machine-image: introduce two different classes of images

This distuingishes two different classes of images, one for the purpose
of npsawn-like containers, i.e. "machines", and one for portable
services.

This distinction is mostly about search paths. We look for machine
images in /var/lib/machines and for portable images in
/var/lib/portables.

5 years agoconf-files: beef up conf-files.[ch] a bit
Lennart Poettering [Mon, 16 Apr 2018 19:24:13 +0000 (21:24 +0200)] 
conf-files: beef up conf-files.[ch] a bit

This adds fozr new flags:

- If CONF_FILES_DIRECTORY is specified conf_file_list() and friends
  will look for directories only.

- Similar CONF_FILES_REGULAR means we'll look only for regular files.

- If CONF_FILES_BASENAME is specified the resulting list will contain
  only the basenames of all discovered files or directories, not the
  full paths.

- If CONF_FILES_FILTER_MASKED is specified the resulting list will have
  masked entries removed (i.e. those symlinked to /dev/null and
  suchlike)

These four flags are useful for discovering portable service profile
information.

While we are at it, also improve a couple of other things:

- More debug logging

- use path_hash_ops instead of string_hash_ops when putting together the
  path lists

5 years agofileio: make sure read_full_stream() works on memory-backed streams
Lennart Poettering [Tue, 17 Apr 2018 09:07:56 +0000 (11:07 +0200)] 
fileio: make sure read_full_stream() works on memory-backed streams

5 years agopath-lookup: add flag to optionally force checking split-usr unit dirs
Lennart Poettering [Mon, 16 Apr 2018 10:36:07 +0000 (12:36 +0200)] 
path-lookup: add flag to optionally force checking split-usr unit dirs

When we look into a portable service image it might contain the unit
files in split-usr directories rather than merged-usr directories as on
the host. Hence, let#s add a flag that checking all dirs can be forced.

5 years agoinstall: export unit_file_lookup_state()
Lennart Poettering [Wed, 28 Mar 2018 14:45:44 +0000 (16:45 +0200)] 
install: export unit_file_lookup_state()

5 years agoos-util: add helpers for finding /etc/os-release
Lennart Poettering [Mon, 26 Mar 2018 14:32:40 +0000 (16:32 +0200)] 
os-util: add helpers for finding /etc/os-release

Place this new helpers in a new source file os-util.[ch], and move the
existing and related call path_is_os_tree() to it as well.

5 years agofileio: add parse_env_filev() that is like parse_env_file() but takes a va_list
Lennart Poettering [Mon, 26 Mar 2018 17:20:47 +0000 (19:20 +0200)] 
fileio: add parse_env_filev() that is like parse_env_file() but takes a va_list

5 years agofileio: accept FILE* in addition to path in parse_env_file()
Lennart Poettering [Fri, 23 Mar 2018 20:31:14 +0000 (21:31 +0100)] 
fileio: accept FILE* in addition to path in parse_env_file()

Most our other parsing functions do this, let's do this here too,
internally we accept that anyway. Also, the closely related
load_env_file() and load_env_file_pairs() also do this, so let's be
systematic.

5 years agoprocess-util: add a new FORK_MOUNTNS_SLAVE flag for safe_fork()
Lennart Poettering [Fri, 23 Mar 2018 19:52:46 +0000 (20:52 +0100)] 
process-util: add a new FORK_MOUNTNS_SLAVE flag for safe_fork()

We already have a flag for creating a new mount namespace for the child.
Let's add an extension to that: a new FORK_MOUNTNFS_SLAVE flag. When
used in combination will mark all mounts in the child namespace as
MS_SLAVE so that the child can freely mount or unmount stuff but it
won't leak into the parent.

5 years agodissect: optionally, validate that the image we dissect is a valid OS image
Lennart Poettering [Fri, 23 Mar 2018 19:39:32 +0000 (20:39 +0100)] 
dissect: optionally, validate that the image we dissect is a valid OS image

We already do this kind of validation in nspawn when we operate on a
plain directory, let's also do this on raw images under the same
condition: that we are about too boot the image. Also, do this when we
are about to read OS metadata from it.

5 years agofd-util: add new helper call fd_duplicate_data_fd()
Lennart Poettering [Fri, 9 Mar 2018 21:45:08 +0000 (22:45 +0100)] 
fd-util: add new helper call fd_duplicate_data_fd()

This call creates an fd from another fd containing the same data.
Specifically, repeated read() on the returned fd should return the same
data as the original fd. This call is useful when we want to copy data
out of disk images and suchlike, and want to be pass fds with the data
around without having to keep the disk image continously mounted.

The implementation tries to be somewhat smart and tries to prefer
memfds/pipes over files in /tmp or /var/tmp based on the size of the
data, but has appropropriate fallbacks in place.

5 years agoMerge pull request #8817 from yuwata/cleanup-nsflags
Lennart Poettering [Thu, 24 May 2018 14:49:13 +0000 (16:49 +0200)] 
Merge pull request #8817 from yuwata/cleanup-nsflags

core: allow to specify RestrictNamespaces= multiple times

5 years agonetworkd: Support the ability to set MTU in [Route] sections
Susant Sahani [Mon, 21 May 2018 11:33:36 +0000 (17:03 +0530)] 
networkd: Support the ability to set MTU in [Route] sections

Add support to set the route MTU.

Closes #9047

5 years agoMerge pull request #9020 from poettering/physical-memory-cgroupsv2
Zbigniew Jędrzejewski-Szmek [Thu, 24 May 2018 14:30:46 +0000 (16:30 +0200)] 
Merge pull request #9020 from poettering/physical-memory-cgroupsv2

make sure physical_memory() groks cgroupsv2

5 years agoMerge pull request #9024 from poettering/nspawn-attrs-more
Zbigniew Jędrzejewski-Szmek [Thu, 24 May 2018 14:27:27 +0000 (16:27 +0200)] 
Merge pull request #9024 from poettering/nspawn-attrs-more

make even more nspawn concepts configurable

5 years agoMerge pull request #9068 from poettering/nspawn-pty-deadlock
Zbigniew Jędrzejewski-Szmek [Thu, 24 May 2018 14:25:22 +0000 (16:25 +0200)] 
Merge pull request #9068 from poettering/nspawn-pty-deadlock

nspawn logging deadlock fix

5 years agologind: let's change the type of the runtime directory size to uint64_t 9020/head
Lennart Poettering [Thu, 17 May 2018 02:33:13 +0000 (22:33 -0400)] 
logind: let's change the type of the runtime directory size to uint64_t

Externally it's an uint64_t anyway, and internally we most just
initialize it to physical_memory() which returns uint64_t, hence there's
exactly zero value in using it as size_t internally. Hence, let's fix
that, and use uint64_t everywhere.

5 years agoutil: add debug logging to system_tasks_max()
Lennart Poettering [Thu, 17 May 2018 02:32:15 +0000 (22:32 -0400)] 
util: add debug logging to system_tasks_max()

We should always do debug logging when we eat up error conditions. Let's
do so here too.

5 years agoutil: fix physical_memory() to work correctly on cgroupsv2
Lennart Poettering [Thu, 17 May 2018 02:27:58 +0000 (22:27 -0400)] 
util: fix physical_memory() to work correctly on cgroupsv2

Let's look into the right cgroupsv2 attribute.

Also, while we are at it, add debug logging for all error conditions we
eat up silently otherwise.

5 years agodoc: mention in NEWS that AF_INET{,6} are dropped from logind
Yu Watanabe [Thu, 24 May 2018 04:18:28 +0000 (13:18 +0900)] 
doc: mention in NEWS that AF_INET{,6} are dropped from logind

Closes #9072.

6 years agoMerge pull request #9040 from yuwata/resolved-networkd-use-dynamic-user
Lennart Poettering [Wed, 23 May 2018 19:10:39 +0000 (21:10 +0200)] 
Merge pull request #9040 from yuwata/resolved-networkd-use-dynamic-user

Set DynamicUser= to resolved and networkd

6 years agoinstall: "user" and "global" scopes are equivalent for user presets
Franck Bui [Tue, 22 May 2018 12:22:53 +0000 (14:22 +0200)] 
install: "user" and "global" scopes are equivalent for user presets

Otherwise querying the preset status of a unit to the user instance gives
incorrect results since in this case the scope used by the manager is
UNIT_FILE_USER.

6 years agoMerge pull request #9039 from yuwata/fix-device-allow
Lennart Poettering [Wed, 23 May 2018 19:07:22 +0000 (21:07 +0200)] 
Merge pull request #9039 from yuwata/fix-device-allow

 core: support unit specifiers in IODeviceWeight= and friends

6 years agoMerge pull request #9067 from thedrow/patch-1
Zbigniew Jędrzejewski-Szmek [Wed, 23 May 2018 12:35:39 +0000 (14:35 +0200)] 
Merge pull request #9067 from thedrow/patch-1

Enable ccache and mount it into the build/test container

6 years agotmpfiles: fix documented constant for exit code 73
Will Thompson [Tue, 22 May 2018 14:56:53 +0000 (15:56 +0100)] 
tmpfiles: fix documented constant for exit code 73

sysexits.h has:

    #define EX_CANTCREAT 73 /* can't create (user) output file */

EX_DATAERR is a copy-paste error from the previous sentence, which is
correct.

6 years agoMerge pull request #9065 from poettering/fixup-tab-double-newline
Zbigniew Jędrzejewski-Szmek [Tue, 22 May 2018 15:14:48 +0000 (17:14 +0200)] 
Merge pull request #9065 from poettering/fixup-tab-double-newline

tree-wide: fix some TABs and double newlines

6 years agonspawn: make sure our container PID 1 keeps logging to the original stderr as long... 9068/head
Lennart Poettering [Tue, 22 May 2018 14:52:50 +0000 (16:52 +0200)] 
nspawn: make sure our container PID 1 keeps logging to the original stderr as long as possible

If we log to the pty that is configured as stdin/stdout/stderr of the
container too early we risk filling it up in full before we start
processing the pty from the parent process, resulting in deadlocks.
Let's hence keep a copy of the original tty we were started on before
setting up stdin/stdout/stderr, so that we can log to it, and keep using
it as long as we can.

Since the kernel's pty internal buffer is pretty small this actually
triggered deadlocks when we debug logged at lot from nspawn's child
processes, see: https://github.com/systemd/systemd/pull/9024#issuecomment-390403674

With this change we won't use the pty at all, only the actual payload we
start will, and hence we won't deadlock on it, ever.

6 years agonspawn: make use of log_set_open_when_needed() in nspawn too
Lennart Poettering [Tue, 22 May 2018 14:51:28 +0000 (16:51 +0200)] 
nspawn: make use of log_set_open_when_needed() in nspawn too

Let's make use of log_set_open_when_needed() in nspawn too, i.e. at the
point where we close logging because we are about to rearrange fds,
let's automatically reopen the logging fds when we need them, the same
way as we do that in the service manager. This makes things simpler and
more robust.

6 years agoInstall ccache in container. 9067/head
Omer Katz [Tue, 22 May 2018 14:48:14 +0000 (17:48 +0300)] 
Install ccache in container.

6 years agoEnable ccache and mount it into the build/test container.
Omer Katz [Tue, 22 May 2018 14:45:19 +0000 (17:45 +0300)] 
Enable ccache and mount it into the build/test container.