platform/upstream/systemd.git
6 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.

6 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`

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

6 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

6 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.

6 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'

6 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.

6 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`.

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

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

6 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

6 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

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

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

Noticed by Craig Barnes.

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

Fixes #9089.

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

Closes #9086.

6 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

6 years agojournalctl: add with-unit mode
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.

6 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.

6 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

6 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

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

6 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

6 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

6 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.

6 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.

6 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.

6 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.

6 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.

6 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.

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

6 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

6 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

6 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.

6 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

6 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

6 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.

6 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.

6 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

6 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

6 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.

6 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()

6 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.

6 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

6 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.

6 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.

6 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.

6 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.

6 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

6 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

6 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

6 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

6 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

6 years agologind: let's change the type of the runtime directory size to uint64_t
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.

6 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.

6 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.

6 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...
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.
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.

6 years agoupdate TODO
Lennart Poettering [Mon, 7 May 2018 15:50:31 +0000 (17:50 +0200)]
update TODO

6 years agonspawn: let's rename _FORCE_ENUM_WIDTH → _SETTING_FORCE_ENUM_WIDTH
Lennart Poettering [Tue, 22 May 2018 12:39:50 +0000 (14:39 +0200)]
nspawn: let's rename _FORCE_ENUM_WIDTH → _SETTING_FORCE_ENUM_WIDTH

Just some preparation in case we need a similar hack in another enum one
day.

6 years agonspawn: similar to the previous patches, also make /etc/localtime handling more confi...
Lennart Poettering [Thu, 17 May 2018 03:43:03 +0000 (23:43 -0400)]
nspawn: similar to the previous patches, also make /etc/localtime handling more configurable

Fixes: #9009

6 years agonspawn: complain if people still use --share-system
Lennart Poettering [Sat, 12 May 2018 20:17:38 +0000 (13:17 -0700)]
nspawn: complain if people still use --share-system

6 years agonspawn: make --link-journal= configurable through .nspawn files, too
Lennart Poettering [Sat, 12 May 2018 20:17:16 +0000 (13:17 -0700)]
nspawn: make --link-journal= configurable through .nspawn files, too

6 years agonspawn: add a bit of debug logging to resolved_listening()
Lennart Poettering [Sat, 12 May 2018 19:51:20 +0000 (12:51 -0700)]
nspawn: add a bit of debug logging to resolved_listening()

6 years agonspawn: add greater control over how /etc/resolv.conf is handled
Lennart Poettering [Sat, 12 May 2018 19:50:57 +0000 (12:50 -0700)]
nspawn: add greater control over how /etc/resolv.conf is handled

Fixes: #8014 #1781

6 years agoMerge pull request #9062 from poettering/parse-conf-macro
Lennart Poettering [Tue, 22 May 2018 14:14:49 +0000 (16:14 +0200)]
Merge pull request #9062 from poettering/parse-conf-macro

add new CONFIG_PARSER_PROTOTYPE() macro

6 years agopid1: fix ShowStatus property
Zbigniew Jędrzejewski-Szmek [Tue, 22 May 2018 12:48:33 +0000 (14:48 +0200)]
pid1: fix ShowStatus property

It is not const, because a) systemd can bump it on its own if
errors occur, and b) the user can change it using signals.
Also it's not boolean.

$ busctl get-property org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager ShowStatus
b true
$ sudo kill -SIGRTMIN+21 1
$ busctl get-property org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager ShowStatus
b false

Fixes #4503.

6 years agotree-wide: remove some double newlines in headers, too
Lennart Poettering [Tue, 22 May 2018 14:08:26 +0000 (16:08 +0200)]
tree-wide: remove some double newlines in headers, too

6 years agofind-double-newline: look in headers too
Lennart Poettering [Tue, 22 May 2018 14:07:18 +0000 (16:07 +0200)]
find-double-newline: look in headers too

6 years agotree-wide: fix a couple of TABs
Lennart Poettering [Tue, 22 May 2018 14:01:21 +0000 (16:01 +0200)]
tree-wide: fix a couple of TABs

6 years agotools: add a script for fixing up TABs
Lennart Poettering [Tue, 22 May 2018 14:00:30 +0000 (16:00 +0200)]
tools: add a script for fixing up TABs

This is similar to "find-double-newline.sh" but looks for TABs that
should not be there.

6 years agonetwork: set DynamicUser= to systemd-networkd.service
Yu Watanabe [Tue, 22 May 2018 13:37:34 +0000 (22:37 +0900)]
network: set DynamicUser= to systemd-networkd.service

6 years agoresolve: enable DynamicUser= for systemd-resolved.service
Yu Watanabe [Sat, 19 May 2018 16:18:21 +0000 (01:18 +0900)]
resolve: enable DynamicUser= for systemd-resolved.service

6 years agocore: chown RuntimeDirectory= if DynamicUser= is set
Yu Watanabe [Tue, 22 May 2018 13:26:22 +0000 (22:26 +0900)]
core: chown RuntimeDirectory= if DynamicUser= is set

When DynamicUser= is set, then RuntimeDirectory= should be always
chowned, as the service unit may enable RuntimeDirectoryPreserve=,
and the uid or gid may changed from the last run.
This also makes easier to migrate the service to use DynamicUser=.

6 years agotimesync,shared: move logic requesting bus name to shared
Yu Watanabe [Sat, 19 May 2018 16:55:39 +0000 (01:55 +0900)]
timesync,shared: move logic requesting bus name to shared

Preparation for setting DynamicUser= to other services which
request bus names.

6 years agounit: drop After=systemd-sysusers.service from timesyncd
Yu Watanabe [Sat, 19 May 2018 16:09:57 +0000 (01:09 +0900)]
unit: drop After=systemd-sysusers.service from timesyncd

After=systemd-sysusers.service is not necessary, as timesyncd
already enables DynamicUser=.

6 years agonspawn: support pivot-root option during directory validation
Arnaud Rebillout [Mon, 21 May 2018 04:10:21 +0000 (11:10 +0700)]
nspawn: support pivot-root option during directory validation

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
6 years agoMerge pull request #9059 from keszybz/rm-rf-generators
Lennart Poettering [Tue, 22 May 2018 12:30:03 +0000 (14:30 +0200)]
Merge pull request #9059 from keszybz/rm-rf-generators

Allow removing generators dirs on real fs

6 years agoMerge pull request #9061 from poettering/dump-string-table
Lennart Poettering [Tue, 22 May 2018 12:28:38 +0000 (14:28 +0200)]
Merge pull request #9061 from poettering/dump-string-table

add new DUMP_STRING_TABLE() macro and make use of it everywhere

6 years agoMerge pull request #9058 from keszybz/fun-with-uint64_c
Lennart Poettering [Tue, 22 May 2018 11:23:56 +0000 (13:23 +0200)]
Merge pull request #9058 from keszybz/fun-with-uint64_c

Fun with UINT64_C

6 years agoconf-parser: make use of free_and_replace() at one more place
Lennart Poettering [Tue, 22 May 2018 11:12:48 +0000 (13:12 +0200)]
conf-parser: make use of free_and_replace() at one more place

6 years agotree-wide: port over all code to the new CONFIG_PARSER_PROTOTYPE() macro
Lennart Poettering [Tue, 22 May 2018 11:10:17 +0000 (13:10 +0200)]
tree-wide: port over all code to the new CONFIG_PARSER_PROTOTYPE() macro

This makes most header files easier to look at. Also Emacs gets really
slow when browsing through large sections of overly long prototypes,
which is much improved by this macro.

We should probably not do something similar with too many other cases,
as macros like this might help readability for some, but make it worse
for others. But I think given the complexity of this specific prototype
and how often we use it, it's worth doing.

6 years agoconfig-parser: introduce new CONFIG_PARSER_PROTOTYPE() macro
Lennart Poettering [Tue, 22 May 2018 11:03:19 +0000 (13:03 +0200)]
config-parser: introduce new CONFIG_PARSER_PROTOTYPE() macro

This builds on the previous GENERIC_PARSER_ARGS macro work. I think in
general it is a better idea to declare macros that generate full C
statements instead of just parts of them, hence, let's introduce
CONFIG_PARSER_PROTOTYPE() which defines a full C function prototype,
instead of the pre-existing way of defining the C function prototype
manually, but then using GENERIC_PARSER_ARGS to define its arguments.

This doesn't drop GENERIC_PARSER_ARGS though, but renames it to
CONFIG_PARSER_ARGUMENTS, and changes the ConfigParserCallback function
type to use it. The new name follows more closely how the other symbols
in the header are named.

6 years agodetect-virt: add new --list command for showing all currently known VM/container...
Lennart Poettering [Tue, 22 May 2018 10:12:44 +0000 (12:12 +0200)]
detect-virt: add new --list command for showing all currently known VM/container envs

6 years agotree-wide: port various bits of the tree over to the new DUMP_STRING_TABLE() macro
Lennart Poettering [Tue, 22 May 2018 10:10:56 +0000 (12:10 +0200)]
tree-wide: port various bits of the tree over to the new DUMP_STRING_TABLE() macro

6 years agovolatile-mode: use the usual string table macros for implementing volatile_mode_from_...
Lennart Poettering [Tue, 22 May 2018 10:09:59 +0000 (12:09 +0200)]
volatile-mode: use the usual string table macros for implementing volatile_mode_from_string()

Let's shorten our code a bit, and also add the matching _to_string()
call.

6 years agocoredumpctl: always output proper english sentence
Lennart Poettering [Tue, 22 May 2018 10:08:30 +0000 (12:08 +0200)]
coredumpctl: always output proper english sentence

Let's uppercase the first character, and finish them in a full stop.

6 years agostring-table: add new DUMP_STRING_TABLE() macro
Lennart Poettering [Tue, 22 May 2018 10:06:54 +0000 (12:06 +0200)]
string-table: add new DUMP_STRING_TABLE() macro

The macro is inspired by the other string table macros, and takes the
same arguments in the same order and dumps a string table to stdout.
Since it's typesafe it's nice to implement this as macro rather than
regular function.

This new macro is useful for implementing commands such as "systemctl -t
help" and similar, i.e. wherever we want to dump all values of an enum
to stdout.

6 years agoGenerator dirs might be on a real filesystem
Zbigniew Jędrzejewski-Szmek [Tue, 22 May 2018 09:56:31 +0000 (11:56 +0200)]
Generator dirs might be on a real filesystem

Most of the time, tmpfs is used for /tmp, but this is not required.
Applied to both pid1 and systemd-analyze verify.

Fixes #8592.

6 years agobasic/rm-rf: include the path in error messages
Zbigniew Jędrzejewski-Szmek [Tue, 22 May 2018 09:33:01 +0000 (11:33 +0200)]
basic/rm-rf: include the path in error messages

Attempted to remove disk file system under "/tmp/systemd-temporary-aWPkbQ", and we can't allow that.

6 years agosystemd-nspawn: make SettingsMask 64 bit wide
Zbigniew Jędrzejewski-Szmek [Tue, 22 May 2018 07:13:31 +0000 (09:13 +0200)]
systemd-nspawn: make SettingsMask 64 bit wide

The use of UINT64_C() in the SettingsMask enum definition is misleading:
it does not mean that individual fields have this width. E.g., with
enum {
   FOO = UINT64_C(1)
}
sizeof(FOO) gives 4. It only means that the shift is done properly. So
1 << 35 is undefined, but UINT64_C(1) << 35 is the expected 64 bit
constant. Thus, the use UINT64_C() is useful, because we know that the shifts
are done properly, no matter what the value of _RLIMIT_MAX is, but when those
fields are used in expressions, we don't know what size they will be
(probably 4). Let's add a define which "hides" the enum definition behind a
define which gives the same value but is actually 64 bit. I think this is a
nicer solution than requiring all users to cast SETTING_RLIMIT_FIRST before
use.

Fixes #9035.