]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
7 years agomkosi: change /etc/issue text a bit for mkosi images build from systemd tree
Lennart Poettering [Tue, 6 Dec 2016 22:17:57 +0000 (23:17 +0100)] 
mkosi: change /etc/issue text a bit for mkosi images build from systemd tree

7 years agomkosi: run tests when building mkosi images
Lennart Poettering [Tue, 6 Dec 2016 22:17:30 +0000 (23:17 +0100)] 
mkosi: run tests when building mkosi images

7 years agobuild-sys: include the builddir in $PATH while testing
Lennart Poettering [Tue, 6 Dec 2016 21:55:43 +0000 (22:55 +0100)] 
build-sys: include the builddir in $PATH while testing

udev-test.pl shells out systemd-detect-virt, and it really should invoke the
version from the build tree instead of one supplied by the installed system,
hence let's add the builddir to $PATH while building.

7 years agoutil-lib: rework rename_process() to be able to make use of PR_SET_MM_ARG_START
Lennart Poettering [Tue, 6 Dec 2016 19:29:07 +0000 (20:29 +0100)] 
util-lib: rework rename_process() to be able to make use of PR_SET_MM_ARG_START

PR_SET_MM_ARG_START allows us to relatively cleanly implement process renaming.
However, it's only available with privileges. Hence, let's try to make use of
it, and if we can't fall back to the traditional way of overriding argv[0].

This removes size restrictions on the process name shown in argv[] at least for
privileged processes.

7 years agosysv-generator: properly translate sysv facilities
Lennart Poettering [Tue, 6 Dec 2016 18:36:30 +0000 (19:36 +0100)] 
sysv-generator: properly translate sysv facilities

We used the wrong return value in one case, so that our translations were
thrown away.

While we are at it, make sure to always initialize *ret on successful function
exits.

Fixes: #4762
7 years agomachinectl: make "machinectl -E … shell" work
Lennart Poettering [Tue, 6 Dec 2016 18:35:31 +0000 (19:35 +0100)] 
machinectl: make "machinectl -E … shell" work

Fixes: #4823
7 years agojournalctl: improve wording in an errors message
Lennart Poettering [Tue, 6 Dec 2016 18:34:18 +0000 (19:34 +0100)] 
journalctl: improve wording in an errors message

Fixes: #4660
7 years agoman: document that "systemctl show" shows low-level properties
Lennart Poettering [Tue, 6 Dec 2016 18:33:36 +0000 (19:33 +0100)] 
man: document that "systemctl show" shows low-level properties

Fixes: #4654
7 years agoman: minor fixes for sd_journal_print(3)
Lennart Poettering [Tue, 6 Dec 2016 18:27:17 +0000 (19:27 +0100)] 
man: minor fixes for sd_journal_print(3)

When sd_journal_perror() was added some footers weren't updated accordingly.
Let's do so.

Fixes: #4755
7 years agomkosi: update mkosi.fedora so that we can run "make check" during build
Lennart Poettering [Tue, 6 Dec 2016 17:41:27 +0000 (18:41 +0100)] 
mkosi: update mkosi.fedora so that we can run "make check" during build

Our tests require "diff" and "tree", hence let's add them to the set of
development packages.

7 years agonspawn: flush out environment block of the -a stub init process
Lennart Poettering [Tue, 6 Dec 2016 17:19:23 +0000 (18:19 +0100)] 
nspawn: flush out environment block of the -a stub init process

The container detection code in virt.c we ship checks for /proc/1/environ,
looking for "container=" in it. Let's make sure our "-a" init stub exposes that
correctly.

Without this "systemd-detect-virt" run in a "-a" container won't detect that it
is being run in a container.

7 years agoutil-lib: improve container detection logic
Lennart Poettering [Tue, 6 Dec 2016 14:51:26 +0000 (15:51 +0100)] 
util-lib: improve container detection logic

Previously, systemd-detect-virt was unable to detect "systemd-nspawn -a"
container environments, i.e. where PID 1 is a stub process running in host
context, as in that case /proc/1/environ was inherited from the host. Let's
improve that, and add an additional check for container environments where
/proc/1/environ is not cleaned up and does not contain the $container
environment variable:

The /proc/1/sched file shows the host PID in the first line. if this is not
1, we know we are running in a PID namespace (but not which implementation).

With these changes we should be able to detect container environments that
don't set $container at all.

7 years agoAdd sd_is_socket_sockaddr (#4885)
Zbigniew Jędrzejewski-Szmek [Wed, 14 Dec 2016 10:51:26 +0000 (05:51 -0500)] 
Add sd_is_socket_sockaddr (#4885)

Fixes #1188.

7 years agoMerge pull request #4889 from evverx/fix-test-fs-util-memleak
Ronny Chevalier [Wed, 14 Dec 2016 10:34:48 +0000 (11:34 +0100)] 
Merge pull request #4889 from evverx/fix-test-fs-util-memleak

test-fs-util: fix memleak

7 years agogenerator: order fsck service After= the device
Lennart Poettering [Wed, 7 Dec 2016 19:00:31 +0000 (20:00 +0100)] 
generator: order fsck service After= the device

Otherwise we might get started too early.

7 years agocore: rework logic to determine when we decide to add automatic deps for mounts
Lennart Poettering [Tue, 29 Nov 2016 21:50:21 +0000 (22:50 +0100)] 
core: rework logic to determine when we decide to add automatic deps for mounts

This adds a concept of "extrinsic" mounts. If mounts are extrinsic we consider
them managed by something else and do not add automatic ordering against
umount.target, local-fs.target, remote-fs.target.

Extrinsic mounts are considered:

- All mounts if we are running in --user mode

- API mounts such as everything below /proc, /sys, /dev, which exist from
  earliest boot to latest shutdown.

- All mounts marked as initrd mounts, if we run on the host

- The initrd's private directory /run/initrams that should survive until last
  reboot.

This primarily merges a couple of different exclusion lists into a single
concept.

7 years agocore: make sure targets that get a default Conflicts=shutdown.target are also ordered...
Lennart Poettering [Tue, 29 Nov 2016 20:07:05 +0000 (21:07 +0100)] 
core: make sure targets that get a default Conflicts=shutdown.target are also ordered against it

Let's tweak the automatic dependency generation of target units: not only add a
Conflicts= towards shutdown.target but also an After= line for it, so that we
can be sure the new target is not started when the old target is still up.

Discovered in the context of #4733

(Also, exclude dependency generation if for shutdown.target itself. — This is
strictly speaking redundant, as unit_add_two_dependencies_by_name() detects
that and becomes a NOP, but let's make this explicit for readability.)

7 years agoAdd a bit of documentation for the various undocumented environment variables we...
Lennart Poettering [Thu, 24 Nov 2016 16:47:39 +0000 (17:47 +0100)] 
Add a bit of documentation for the various undocumented environment variables we honour

7 years agoutil: Fine tune running_in_chroot() a bit
Lennart Poettering [Thu, 24 Nov 2016 16:42:19 +0000 (17:42 +0100)] 
util: Fine tune running_in_chroot() a bit

Let's be a bit more careful when detecting chroot() environments, so that we
can discern them from namespaced environments.

Previously this would simply check if the root directory of PID 1 matches our
own root directory. With this commit, we also check whether the namespaces of
PID 1 and ourselves are the same. If not we assume we are running inside of a
namespaced environment instead of a chroot() environment.

This has the benefit that systemctl (which uses running_in_chroot()) will work
as usual when invoked in a namespaced service.

7 years agoMerge pull request #4806 from poettering/keyring-init
Zbigniew Jędrzejewski-Szmek [Wed, 14 Dec 2016 04:24:42 +0000 (23:24 -0500)] 
Merge pull request #4806 from poettering/keyring-init

set up a per-service session kernel keyring, and store the invocation ID in it

7 years agoMerge pull request #4727 from poettering/exec-bind
Zbigniew Jędrzejewski-Szmek [Wed, 14 Dec 2016 03:30:07 +0000 (22:30 -0500)] 
Merge pull request #4727 from poettering/exec-bind

More namespace improvements

7 years agotest-fs-util: fix memleak 4889/head
Evgeny Vereshchagin [Wed, 14 Dec 2016 00:31:53 +0000 (00:31 +0000)] 
test-fs-util: fix memleak

Fixes:
```
$ ./libtool --mode=execute valgrind --leak-check=full ./test-fs-util
...
==22871==
==22871== 27 bytes in 1 blocks are definitely lost in loss record 1 of 1
==22871==    at 0x4C2FC47: realloc (vg_replace_malloc.c:785)
==22871==    by 0x4E86D05: strextend (string-util.c:726)
==22871==    by 0x4E8F347: chase_symlinks (fs-util.c:712)
==22871==    by 0x109EBF: test_chase_symlinks (test-fs-util.c:75)
==22871==    by 0x10C381: main (test-fs-util.c:305)
==22871==
```
Closes #4888

7 years agoupdate TODO 4727/head
Lennart Poettering [Thu, 24 Nov 2016 00:51:36 +0000 (01:51 +0100)] 
update TODO

7 years agocore: make "Restart" service property accessible via the transient API
Lennart Poettering [Wed, 23 Nov 2016 23:44:57 +0000 (00:44 +0100)] 
core: make "Restart" service property accessible via the transient API

Fixes: #4402
7 years agocore: add ability to define arbitrary bind mounts for services
Lennart Poettering [Wed, 23 Nov 2016 21:21:40 +0000 (22:21 +0100)] 
core: add ability to define arbitrary bind mounts for services

This adds two new settings BindPaths= and BindReadOnlyPaths=. They allow
defining arbitrary bind mounts specific to particular services. This is
particularly useful for services with RootDirectory= set as this permits making
specific bits of the host directory available to chrooted services.

The two new settings follow the concepts nspawn already possess in --bind= and
--bind-ro=, as well as the .nspawn settings Bind= and BindReadOnly= (and these
latter options should probably be renamed to BindPaths= and BindReadOnlyPaths=
too).

Fixes: #3439
7 years agonamespace: instead of chasing mount symlinks a priori, do so as-we-go
Lennart Poettering [Tue, 13 Dec 2016 23:51:37 +0000 (00:51 +0100)] 
namespace: instead of chasing mount symlinks a priori, do so as-we-go

This is relevant as many of the mounts we try to establish only can be followed
when some other prior mount that is a prefix of it is established. Hence: move
the symlink chasing into the actual mount functions, so that we do it as late
as possibly but as early as necessary.

Fixes: #4588
7 years agocore: rename BindMount structure → MountEntry
Lennart Poettering [Tue, 13 Dec 2016 23:48:52 +0000 (00:48 +0100)] 
core: rename BindMount structure → MountEntry

After all, these don#t strictly encapsulate bind mounts anymore, and we are
preparing this for adding arbitrary user-defined bind mounts in a later commit,
at which point this would become really confusing. Let's clean this up, rename
the BindMount structure to MountEntry, so that it is clear that it can contain
information about any kind of mount.

7 years agonamespace: add explicit read-only flag
Lennart Poettering [Wed, 23 Nov 2016 00:09:14 +0000 (01:09 +0100)] 
namespace: add explicit read-only flag

This reworks handling of the read-only management for mount points. This will
become handy as soon as we add arbitrary bind mount support (which comes in a
later commit).

7 years agonamespace: reindent protect_system_strict_table[] as well
Lennart Poettering [Tue, 22 Nov 2016 19:21:23 +0000 (20:21 +0100)] 
namespace: reindent protect_system_strict_table[] as well

All other tables got reindented, but one was forgotten. Fix that.

7 years agocore: hook up MountFlags= to the transient unit logic
Lennart Poettering [Tue, 22 Nov 2016 19:19:08 +0000 (20:19 +0100)] 
core: hook up MountFlags= to the transient unit logic

This makes "systemd-run -p MountFlags=shared -t /bin/sh" work, by making
MountFlags= to the list of properties that may be accessed transiently.

7 years agopam: include pam_keyinit.so in our PAM fragments 4806/head
Lennart Poettering [Wed, 7 Dec 2016 19:14:43 +0000 (20:14 +0100)] 
pam: include pam_keyinit.so in our PAM fragments

We want that systemd --user gets its own keyring as usual, even if the
barebones PAM snippet we ship upstream is used. If we don't do this we get the
basic keyring systemd --system sets up for us.

7 years agocore: store the invocation ID in the per-service keyring
Lennart Poettering [Fri, 2 Dec 2016 14:05:55 +0000 (15:05 +0100)] 
core: store the invocation ID in the per-service keyring

Let's store the invocation ID in the per-service keyring as a root-owned key,
with strict access rights. This has the advantage over the environment-based ID
passing that it also works from SUID binaries (as they key cannot be overidden
by unprivileged code starting them), in contrast to the secure_getenv() based
mode.

The invocation ID is now passed in three different ways to a service:

- As environment variable $INVOCATION_ID. This is easy to use, but may be
  overriden by unprivileged code (which might be a bad or a good thing), which
  means it's incompatible with SUID code (see above).

- As extended attribute on the service cgroup. This cannot be overriden by
  unprivileged code, and may be queried safely from "outside" of a service.
  However, it is incompatible with containers right now, as unprivileged
  containers generally cannot set xattrs on cgroupfs.

- As "invocation_id" key in the kernel keyring. This has the benefit that the
  key cannot be changed by unprivileged service code, and thus is safe to
  access from SUID code (see above). But do note that service code can replace
  the session keyring with a fresh one that lacks the key. However in that case
  the key will not be owned by root, which is easily detectable. The keyring is
  also incompatible with containers right now, as it is not properly namespace
  aware (but this is being worked on), and thus most container managers mask
  the keyring-related system calls.

Ideally we'd only have one way to pass the invocation ID, but the different
ways all have limitations. The invocation ID hookup in journald is currently
only available on the host but not in containers, due to the mentioned
limitations.

How to verify the new invocation ID in the keyring:

 # systemd-run -t /bin/sh
 Running as unit: run-rd917366c04f847b480d486017f7239d6.service
 Press ^] three times within 1s to disconnect TTY.
 # keyctl show
 Session Keyring
  680208392 --alswrv      0     0  keyring: _ses
  250926536 ----s-rv      0     0   \_ user: invocation_id
 # keyctl request user invocation_id
 250926536
 # keyctl read 250926536
 16 bytes of data in key:
 9c96317c ac64495a a42b9cd7 4f3ff96b
 # echo $INVOCATION_ID
 9c96317cac64495aa42b9cd74f3ff96b
 # ^D

This creates a new transient service runnint a shell. Then verifies the
contents of the keyring, requests the invocation ID key, and reads its payload.
For comparison the invocation ID as passed via the environment variable is also
displayed.

7 years agocore: run each system service with a fresh session keyring
Lennart Poettering [Fri, 2 Dec 2016 00:54:41 +0000 (01:54 +0100)] 
core: run each system service with a fresh session keyring

This patch ensures that each system service gets its own session kernel keyring
automatically, and implicitly. Without this a keyring is allocated for it
on-demand, but is then linked with the user's kernel keyring, which is OK
behaviour for logged in users, but not so much for system services.

With this change each service gets a session keyring that is specific to the
service and ceases to exist when the service is shut down. The session keyring
is not linked up with the user keyring and keys hence only search within the
session boundaries by default.

(This is useful in a later commit to store per-service material in the keyring,
for example the invocation ID)

(With input from David Howells)

7 years agoMerge pull request #4877 from evverx/fix-machine-id
Lennart Poettering [Tue, 13 Dec 2016 19:31:09 +0000 (20:31 +0100)] 
Merge pull request #4877 from evverx/fix-machine-id

handle corrupted /etc/machine-id nicer

7 years agotest: check that we can boot with broken machine-id 4877/head
Evgeny Vereshchagin [Tue, 13 Dec 2016 12:46:11 +0000 (12:46 +0000)] 
test: check that we can boot with broken machine-id

7 years agosd-id128: id128_write overwrites target file
Evgeny Vereshchagin [Tue, 13 Dec 2016 11:45:01 +0000 (11:45 +0000)] 
sd-id128: id128_write overwrites target file

7 years agomachine-id-setup: `--print --commit` respects the --root option
Evgeny Vereshchagin [Tue, 13 Dec 2016 11:34:09 +0000 (11:34 +0000)] 
machine-id-setup: `--print --commit` respects the --root option

7 years agocore: machine_id_setup overwrites broken machine-id
Evgeny Vereshchagin [Tue, 13 Dec 2016 10:36:03 +0000 (10:36 +0000)] 
core: machine_id_setup overwrites broken machine-id

7 years agonspawn: when getting SIGCHLD make sure it's from the first child (#4855)
Andrey Ulanov [Tue, 13 Dec 2016 01:38:18 +0000 (17:38 -0800)] 
nspawn: when getting SIGCHLD make sure it's from the first child (#4855)

When getting SIGCHLD we should not assume that it was the first
child forked from system-nspawn that has died as it may also be coming
from an orphan process. This change adds a signal handler that ignores
SIGCHLD unless it came from the first containerized child - the real
child.

Before this change the problem can be reproduced as follows:

$ sudo systemd-nspawn --directory=/container-root --share-system
Press ^] three times within 1s to kill container.
[root@andreyu-coreos ~]# { true & } &
[1] 22201
[root@andreyu-coreos ~]#
Container root-fedora-latest terminated by signal KILL

7 years agocatalog: update french translation following 5a1d6cb (#4872)
Sylvain Plantefève [Mon, 12 Dec 2016 21:17:51 +0000 (22:17 +0100)] 
catalog: update french translation following 5a1d6cb (#4872)

7 years agocatalog: update Polish translation (#4874)
Piotr Drąg [Mon, 12 Dec 2016 21:04:50 +0000 (22:04 +0100)] 
catalog: update Polish translation (#4874)

7 years agoMerge pull request #4771 from keszybz/udev-property-ordering
Martin Pitt [Mon, 12 Dec 2016 15:03:52 +0000 (16:03 +0100)] 
Merge pull request #4771 from keszybz/udev-property-ordering

Udev property ordering

7 years agoMerge pull request #4868 from keszybz/man
Martin Pitt [Mon, 12 Dec 2016 07:12:10 +0000 (08:12 +0100)] 
Merge pull request #4868 from keszybz/man

Ellipsization

7 years agoMerge pull request #4867 from keszybz/catalog-messages
Lennart Poettering [Sun, 11 Dec 2016 23:02:01 +0000 (00:02 +0100)] 
Merge pull request #4867 from keszybz/catalog-messages

Catalog message improvements

7 years agohwdb: emit warning when matches are specified at the very end of file 4771/head
Zbigniew Jędrzejewski-Szmek [Thu, 1 Dec 2016 16:46:40 +0000 (11:46 -0500)] 
hwdb: emit warning when matches are specified at the very end of file

This is also an error, but it wasn't caught.

[/tmp/tmp.YWeKax4fMI/etc/udev/hwdb.d/10-bad.hwdb:26] Property expected, ignoring record with no properties

7 years agoman: two trivial formatting fixes 4868/head
Zbigniew Jędrzejewski-Szmek [Sun, 11 Dec 2016 22:17:17 +0000 (17:17 -0500)] 
man: two trivial formatting fixes

7 years agoman: use unicode ellipsis in more places
Zbigniew Jędrzejewski-Szmek [Sun, 11 Dec 2016 22:01:07 +0000 (17:01 -0500)] 
man: use unicode ellipsis in more places

As requested in
https://github.com/systemd/systemd/pull/4864#pullrequestreview-12372557.

docbook will substitute triple dots for the ellipsis in man output, so this has
no effect on the troff output, only on HTML, making it infinitesimally nicer.

In some places we show output from programs, which use dots, and those places
should not be changed. In some tables, the alignment would change if dots were
changed to the ellipsis which is only one character. Since docbook replaces the
ellipsis automatically, we should leave those be. This patch changes all other
places.

7 years agobasic/log: CODE_FUNCTION → CODE_FUNC 4867/head
Zbigniew Jędrzejewski-Szmek [Sun, 11 Dec 2016 20:40:55 +0000 (15:40 -0500)] 
basic/log: CODE_FUNCTION → CODE_FUNC

systemd.journal-fields(7) documents CODE_FUNC=. Internally, we were
inconsistent: sd_journal_print uses CODE_FUNC=, log.h has CODE_FUNCTION=,
python-systemd and bootchart also used CODE_FUNC=, when they were internal.
Most external projects use sd_journal_* functions, so CODE_FUNC=,
python-systemd still uses CODE_FUNC=, as does systemd-bootchart, and
independent reimplementations in golang-github-coreos-go-systemd, qtbase,
network manager, glib, pulseaudio. Hence, I don't think there's much
choice.

7 years agoshare/log: change log_syntax from "[a:b] " to "a:b: "
Zbigniew Jędrzejewski-Szmek [Sun, 11 Dec 2016 19:37:12 +0000 (14:37 -0500)] 
share/log: change log_syntax from "[a:b] " to "a:b: "

Those square brackets don't fit how our other messages look like; we use colons
everywhere else. The "[a:b]" format was originally added in
ed5bcfbe3c3b68e59242c03649eea03a9707d318, and remained unchanged for 7 years,
but in the meantime other conventions evolved.

The new version is also one character shorter.

[/etc/systemd/system/systemd-networkd.service.d/override.conf:2] Failed to parse sec value, ignoring: ...
  ↓
/etc/systemd/system/systemd-networkd.service.d/override.conf:2: Failed to parse sec value, ignoring: ...

7 years agobasic/log: merge two big log_struct_internal invocations into one
Zbigniew Jędrzejewski-Szmek [Sun, 11 Dec 2016 19:34:45 +0000 (14:34 -0500)] 
basic/log: merge two big log_struct_internal invocations into one

We can take advantage of the fact a NULL argument terminates the list.

7 years agotools/catalog-report.py: a script to scour the journal for bad catalog entries
Zbigniew Jędrzejewski-Szmek [Sun, 11 Dec 2016 19:25:45 +0000 (14:25 -0500)] 
tools/catalog-report.py: a script to scour the journal for bad catalog entries

I think it can be a useful tool to find such issues.

SD_MESSAGE_UNIT_STARTING 7d4958e842da4a758f6c1cdc7b36dcc5: no field UNIT
../src/core/unit.c:1239 unit_status_log_starting_stopping_reloading
    Starting Paths.
    SYSLOG_FACILITY=3
    SYSLOG_IDENTIFIER=systemd
    PRIORITY=6
    USER_UNIT=paths.target

SD_MESSAGE_UNIT_STARTED 39f53479d3a045ac8e11786248231fbf: no field UNIT
../src/core/job.c:721 job_log_status_message
    Reached target Paths.
    SYSLOG_FACILITY=3
    SYSLOG_IDENTIFIER=systemd
    PRIORITY=6
    RESULT=done
    USER_UNIT=paths.target

SD_MESSAGE_STARTUP_FINISHED b07a249cd024414a82dd00cd181378ff: no field KERNEL_USEC
../src/core/manager.c:2532 manager_check_finished
    Startup finished in 19ms.
    SYSLOG_FACILITY=3
    SYSLOG_IDENTIFIER=systemd
    PRIORITY=6
    USERSPACE_USEC=19670

SD_MESSAGE_STARTUP_FINISHED b07a249cd024414a82dd00cd181378ff: no field INITRD_USEC
../src/core/manager.c:2532 manager_check_finished
    Startup finished in 19ms.
    SYSLOG_FACILITY=3
    SYSLOG_IDENTIFIER=systemd
    PRIORITY=6
    USERSPACE_USEC=19670

unknown 0ce153587afa4095832d233c17a88001: no catalog entry
gsm-manager.c:1366 start_phase
    Entering running state
    SYSLOG_IDENTIFIER=gnome-session
    PRIORITY=5

SD_MESSAGE_UNIT_STOPPING de5b426a63be47a7b6ac3eaac82e2f6f: no field UNIT
../src/core/unit.c:1239 unit_status_log_starting_stopping_reloading
    Stopping Default.
    SYSLOG_FACILITY=3
    SYSLOG_IDENTIFIER=systemd
    PRIORITY=6
    USER_UNIT=default.target

SD_MESSAGE_UNIT_STOPPED 9d1aaa27d60140bd96365438aad20286: no field UNIT
../src/core/job.c:729 job_log_status_message
    Stopped target Default.
    SYSLOG_FACILITY=3
    SYSLOG_IDENTIFIER=systemd
    PRIORITY=6
    RESULT=done
    USER_UNIT=default.target

SD_MESSAGE_TIME_CHANGE c7a787079b354eaaa9e77b371893cd27: no field REALTIME
src/core/manager.c:2049 manager_dispatch_time_change_fd
    Time has been changed
    SYSLOG_FACILITY=3
    SYSLOG_IDENTIFIER=systemd
    PRIORITY=6

unknown f3ea493c22934e26811cd62abe8e203a: no catalog entry
shell-global.c:1375 shell_global_log_structured
    GNOME Shell started at Sat Jun 11 2016 12:37:46 GMT-0400 (EDT)
    SYSLOG_IDENTIFIER=gnome-shell

SD_MESSAGE_UNIT_FAILED be02cf6855d2428ba40df7e9d022f03d: no field UNIT
src/core/job.c:803 job_log_status_message
    Failed to start GNOME Terminal Server.
    SYSLOG_FACILITY=3
    SYSLOG_IDENTIFIER=systemd
    RESULT=failed
    PRIORITY=3
    USER_UNIT=gnome-terminal-server.service

SD_MESSAGE_LID_CLOSED b72ea4a2881545a0b50e200e55b9b070: no catalog entry
src/login/logind-button.c:198 button_dispatch
    Lid closed.
    SYSLOG_FACILITY=4
    SYSLOG_IDENTIFIER=systemd-logind
    PRIORITY=6

SD_MESSAGE_LID_OPENED b72ea4a2881545a0b50e200e55b9b06f: no catalog entry
src/login/logind-button.c:219 button_dispatch
    Lid opened.
    SYSLOG_FACILITY=4
    SYSLOG_IDENTIFIER=systemd-logind
    PRIORITY=6

SD_MESSAGE_SUSPEND_KEY b72ea4a2881545a0b50e200e55b9b072: no catalog entry
src/login/logind-button.c:177 button_dispatch
    Suspend key pressed.
    SYSLOG_FACILITY=4
    SYSLOG_IDENTIFIER=systemd-logind
    PRIORITY=6

SD_MESSAGE_CONFIG_ERROR c772d24e9a884cbeb9ea12625c306c01: no catalog entry
src/shared/conf-parser.c:469 config_parse_sec
    [/etc/systemd/system/systemd-networkd.service.d/override.conf:2] Failed to parse sec value, ignoring:
    UNIT=systemd-networkd.service
    SYSLOG_FACILITY=3
    ERRNO=22
    SYSLOG_IDENTIFIER=systemd
    PRIORITY=3
    CONFIG_LINE=2
    CONFIG_FILE=/etc/systemd/system/systemd-networkd.service.d/override.conf

unknown 10dd2dc188b54a5e98970f56499d1f73: no catalog entry
gsm-manager.c:308 on_display_server_failure
    Unrecoverable failure in required component org.gnome.Shell.desktop
    PRIORITY=3
    SYSLOG_IDENTIFIER=gnome-session-binary

unknown 52fb62f99e2c49d89cfbf9d6de5e3555: no catalog entry
src/journal/test-journal-send.c:85 main
    Hello World!
    PAGE_SIZE=4096
    TERM=xterm-256color
    SYSLOG_IDENTIFIER=lt-test-journal-send
    PRIORITY=5
    N_CPUS=2
    HOME=/home/zbyszek

unknown 9348174c5cc74001a71ef26bd79d302e: no catalog entry
/usr/lib/python3.5/site-packages/dnf-plugins/system_upgrade.py:422 log_status
    Download finished.
    SYSLOG_IDENTIFIER=python3
    DNF_VERSION=1.1.10
    TARGET_RELEASEVER=25
    SYSTEM_RELEASEVER=24
    PRIORITY=5

unknown fef1cc509d5047268b83a3a553f54b43: no catalog entry
/usr/lib/python3.5/site-packages/dnf-plugins/system_upgrade.py:422 log_status
    Rebooting to perform upgrade.
    SYSLOG_IDENTIFIER=python3
    DNF_VERSION=1.1.10
    TARGET_RELEASEVER=25
    SYSTEM_RELEASEVER=24
    PRIORITY=5

unknown 3e0a5636d16b4ca4bbe5321d06c6aa62: no catalog entry
/usr/lib/python3.5/site-packages/dnf-plugins/system_upgrade.py:422 log_status
    Starting system upgrade. This will take a while.
    SYSLOG_IDENTIFIER=python3
    DNF_VERSION=1.1.10
    SYSTEM_RELEASEVER=24
    PRIORITY=5
    TARGET_RELEASEVER=25

unknown 0123456789abcdef0123456789abcdef: no catalog entry
<doctest systemd.journal.JournalHandler[9]>:1 <module>
    Message with ID
    SYSLOG_IDENTIFIER=/usr/lib/python2.7/site-packages/py/test.py
    LOGGER=custom_logger_name
    PRIORITY=4
    THREAD_NAME=MainThread

7 years agoMerge pull request #4859 from keszybz/networkd
Lennart Poettering [Sun, 11 Dec 2016 19:38:15 +0000 (20:38 +0100)] 
Merge pull request #4859 from keszybz/networkd

Networkd man page update and fixes for the fallout

7 years agoMerge pull request #4864 from keszybz/build-sys
Lennart Poettering [Sun, 11 Dec 2016 19:12:32 +0000 (20:12 +0100)] 
Merge pull request #4864 from keszybz/build-sys

Fix some build issues and warnings

7 years agoMerge pull request #4861 from keszybz/dissect-tweaks
Lennart Poettering [Sun, 11 Dec 2016 19:09:04 +0000 (20:09 +0100)] 
Merge pull request #4861 from keszybz/dissect-tweaks

A prettification of the dissect code, mkosi and TODO updates

7 years agopid1,catalog: use a different MESSAGE_ID for user manager startup
Zbigniew Jędrzejewski-Szmek [Sun, 11 Dec 2016 16:32:28 +0000 (11:32 -0500)] 
pid1,catalog: use a different MESSAGE_ID for user manager startup

This add a new message id for the end of user instance startup.
User manager startup is a different beast then the system startup.
Their descriptions are completely different too. Let's just separate
them.

Partially fixes #3351.

Also remove "successful" from the description, since we don't know if
the startup was successful or not.

7 years agobasic/extract-word,man: clarify "correction" of invalid escapes 4864/head
Zbigniew Jędrzejewski-Szmek [Sun, 11 Dec 2016 04:20:42 +0000 (23:20 -0500)] 
basic/extract-word,man: clarify "correction" of invalid escapes

Our warning message was misleading, because we wouldn't "correct" anything,
we'd just ignore unkown escapes. Update the message.

Also, print just the extracted word (which contains the offending sequences) in
the message, instead of the whole line.

Fixes #4697.

7 years agopid1: remove unnecessary counter
Zbigniew Jędrzejewski-Szmek [Sun, 11 Dec 2016 04:07:46 +0000 (23:07 -0500)] 
pid1: remove unnecessary counter

The loop must terminate after at most three iterations anyway.

7 years agoAdded Debian config for mkosi (#4865)
AsciiWolf [Sun, 11 Dec 2016 05:14:19 +0000 (06:14 +0100)] 
Added Debian config for mkosi (#4865)

7 years agoshared/firewall-util: remove warning about net/if.h workaround
Zbigniew Jędrzejewski-Szmek [Sat, 10 Dec 2016 18:55:13 +0000 (13:55 -0500)] 
shared/firewall-util: remove warning about net/if.h workaround

This is already fixed upstream, so warning is not useful.
Let's keep the workaround until the fix has percolated downstream.

7 years agojournal: fix warning about LZ4_compress_limitedOutput
Zbigniew Jędrzejewski-Szmek [Sat, 10 Dec 2016 18:52:49 +0000 (13:52 -0500)] 
journal: fix warning about LZ4_compress_limitedOutput

7 years agodissect: assume GPT_ROOT_SECONDARY_VERITY is defined when GPT_ROOT_SECONDARY is
Zbigniew Jędrzejewski-Szmek [Sat, 10 Dec 2016 18:35:47 +0000 (13:35 -0500)] 
dissect: assume GPT_ROOT_SECONDARY_VERITY is defined when GPT_ROOT_SECONDARY is

We define those macros, and there's no reason to have one without
the other.

7 years agobuild-sys: define arm as secondary architecture for arm64
Zbigniew Jędrzejewski-Szmek [Sat, 10 Dec 2016 18:01:22 +0000 (13:01 -0500)] 
build-sys: define arm as secondary architecture for arm64

Completely unstested. Fixes #4862.

7 years agoMerge pull request #4844 from hadess/sensor-quirks
Lennart Poettering [Sat, 10 Dec 2016 15:28:50 +0000 (16:28 +0100)] 
Merge pull request #4844 from hadess/sensor-quirks

udev: Add rules for accelerometer orientation quirks

7 years agohwdb_parser: make sure that our patterns match the full property 4844/head
Zbigniew Jędrzejewski-Szmek [Sat, 10 Dec 2016 07:28:24 +0000 (02:28 -0500)] 
hwdb_parser: make sure that our patterns match the full property

We would catch stuff like:
 ACCEL_MOUNT_MATRIX=0, -1, 0; -1, 0, 0; 0, 0.0., 0
but not
 ACCEL_MOUNT_MATRIX=0, -1, 0; -1, 0, 0; 0, 0, 0.0.
because the match would stop at the next-to-last char. Fix that
by requiring a line end.

7 years agohwdb_parser: add support for ACCEL_MOUNT_MATRIX
Zbigniew Jędrzejewski-Szmek [Sat, 10 Dec 2016 07:26:37 +0000 (02:26 -0500)] 
hwdb_parser: add support for ACCEL_MOUNT_MATRIX

We test that we have exactly three rows of three reals separated by two
semicolons.

7 years agoudev: Add rules for accelerometer orientation quirks
Bastien Nocera [Tue, 6 Dec 2016 16:16:43 +0000 (17:16 +0100)] 
udev: Add rules for accelerometer orientation quirks

This commit adds a rules file to extract the properties from hwdb
to set on i2c IIO devices. This is used to set the ACCEL_MOUNT_MATRIX
property on IIO devices, to be consumed by iio-sensor-proxy or
equivalent daemon.

The hwdb file contains documentation on how to write quirks. Note
however that mount information is usually exported in:
- the device-tree for ARM devices
- the ACPI DSDT for Intel-compatible devices
but currently not extracted by the kernel.

Also note that some devices have the framebuffer rotation that changes
between the bootloader and the main system, which might mean that the
accelerometer is then wrongly oriented. This is a missing feature in the
i915 kernel driver: https://bugs.freedesktop.org/show_bug.cgi?id=94894
which needs to be fixed, and won't require quirks.

7 years agomkosi: we need diff to run ./configure 4861/head
Zbigniew Jędrzejewski-Szmek [Wed, 7 Dec 2016 21:08:34 +0000 (16:08 -0500)] 
mkosi: we need diff to run ./configure

checking if gcc supports -fno-rtti -fno-exceptions... ./configure: line 10083: diff: command not found
no

7 years agoTODO: add dissect section
Zbigniew Jędrzejewski-Szmek [Sat, 10 Dec 2016 06:41:36 +0000 (01:41 -0500)] 
TODO: add dissect section

7 years agoMerge pull request #4835 from poettering/unit-name-printf
Zbigniew Jędrzejewski-Szmek [Sat, 10 Dec 2016 06:29:52 +0000 (01:29 -0500)] 
Merge pull request #4835 from poettering/unit-name-printf

Various specifier resolution fixes.

7 years agoMerge pull request #4795 from poettering/dissect
Zbigniew Jędrzejewski-Szmek [Sat, 10 Dec 2016 06:08:13 +0000 (01:08 -0500)] 
Merge pull request #4795 from poettering/dissect

Generalize image dissection logic of nspawn, and make it useful for other tools.

7 years agonspawn: add missing -E to getopt_long (#4860)
Wim de With [Sat, 10 Dec 2016 04:33:58 +0000 (05:33 +0100)] 
nspawn: add missing -E to getopt_long (#4860)

7 years agoman: make the examples in systemd.network(5) more useful 4859/head
Zbigniew Jędrzejewski-Szmek [Fri, 2 Dec 2016 19:00:46 +0000 (14:00 -0500)] 
man: make the examples in systemd.network(5) more useful

We shouldn't just have snippets of configuration, but instead
examples which show all the parts necessary to build a certain kind
of setup, with short explanations.

7 years agonetworkd: check that VTI/VTI6 tunnels have a local address
Zbigniew Jędrzejewski-Szmek [Fri, 2 Dec 2016 18:34:35 +0000 (13:34 -0500)] 
networkd: check that VTI/VTI6 tunnels have a local address

Otherwise we'd fail with an assertion:
Assertion 't->family == AF_INET' failed at ../src/network/netdev/tunnel.c:244, function netdev_vti_fill_message_create(). Aborting.

7 years agonetworkd: tighten parsing of Tunnel addresses
Zbigniew Jędrzejewski-Szmek [Fri, 2 Dec 2016 18:28:01 +0000 (13:28 -0500)] 
networkd: tighten parsing of Tunnel addresses

When assigning addresses, we'd set the family, and later
verify that the address on the other end has the same family.
But when the address was specified as "any", we'd simply unset
the family. Instead, only unset the family if both addresses
are wiped.

Also, don't bother setting family = AF_UNSPEC, since it's the default (0).

7 years agonetworkd: use log_netdev_error in a two more places
Zbigniew Jędrzejewski-Szmek [Fri, 2 Dec 2016 18:24:30 +0000 (13:24 -0500)] 
networkd: use log_netdev_error in a two more places

7 years agonetworkd: do not print ": Success" in debug message
Zbigniew Jędrzejewski-Szmek [Fri, 2 Dec 2016 16:33:31 +0000 (11:33 -0500)] 
networkd: do not print ": Success" in debug message

%m isn't useful in success path.

7 years agopid1: simplify the logic in two statements related to killing processes
Zbigniew Jędrzejewski-Szmek [Tue, 15 Nov 2016 20:01:40 +0000 (15:01 -0500)] 
pid1: simplify the logic in two statements related to killing processes

Generally non-inverted conditions are nicer, and ternary operators
with complex conditions are a bit hard to read.

No functional change.

7 years agotree-wide: replace all readdir cycles with FOREACH_DIRENT{,_ALL} (#4853)
Reverend Homer [Fri, 9 Dec 2016 09:04:30 +0000 (12:04 +0300)] 
tree-wide: replace all readdir cycles with FOREACH_DIRENT{,_ALL} (#4853)

7 years agoMerge pull request #4686 from poettering/machine-id-app-specific
Zbigniew Jędrzejewski-Szmek [Fri, 9 Dec 2016 04:24:28 +0000 (23:24 -0500)] 
Merge pull request #4686 from poettering/machine-id-app-specific

Add new "khash" API and add new sd_id128_get_machine_app_specific() function

7 years agonetwork: fix const qualifier (#4849)
David Michael [Wed, 7 Dec 2016 21:42:17 +0000 (13:42 -0800)] 
network: fix const qualifier (#4849)

Follow up for #4809.

7 years agonspawn: resolv.conf might not be created initially (#4799)
Franck Bui [Wed, 7 Dec 2016 20:36:39 +0000 (21:36 +0100)] 
nspawn: resolv.conf might not be created initially (#4799)

This might happen that resolv.conf is missing in a minimal rootfs and in this
case the following warning is emitted:

 Failed to mount n/a on /mnt/etc/resolv.conf (MS_BIND ""): No such file or directory

This patch fixes this case.

7 years agoMerge pull request #4843 from joukewitteveen/protocol
Lennart Poettering [Wed, 7 Dec 2016 20:35:07 +0000 (21:35 +0100)] 
Merge pull request #4843 from joukewitteveen/protocol

Go through stop_post on failure (#4770)

7 years agodissect: add DISSECT_IMAGE_DISCARD_ANY mask
Zbigniew Jędrzejewski-Szmek [Wed, 7 Dec 2016 20:26:11 +0000 (15:26 -0500)] 
dissect: add DISSECT_IMAGE_DISCARD_ANY mask

This makes the code to set arg_flags much more readable.

7 years agonetwork: support negation in matching patterns (#4809)
David Michael [Wed, 7 Dec 2016 18:12:10 +0000 (10:12 -0800)] 
network: support negation in matching patterns (#4809)

7 years agocore: add a note clarifying that we should be careful when adding new specifiers 4835/head
Lennart Poettering [Wed, 7 Dec 2016 18:03:22 +0000 (19:03 +0100)] 
core: add a note clarifying that we should be careful when adding new specifiers

7 years agocore: deprecate %c, %r, %R specifiers
Lennart Poettering [Wed, 7 Dec 2016 17:58:09 +0000 (18:58 +0100)] 
core: deprecate %c, %r, %R specifiers

%c and %r rely on settings made in the unit files themselves and hence resolve
to different values depending on whether they are used before or after Slice=.
Let's simply deprecate them and drop them from the documentation, as that's not
really possible to fix. Moreover they are actually redundant, as the same
information may always be queried from /proc/self/cgroup and /proc/1/cgroup.

(Accurately speaking, %R is actually not broken like this as it is constant.
However, let's remove all cgroup-related specifiers at once, as it is also
redundant, and doesn't really make much sense alone.)

7 years agoupdate TODO
Lennart Poettering [Mon, 5 Dec 2016 19:14:13 +0000 (20:14 +0100)] 
update TODO

7 years agotests: let's make function tables static/const
Lennart Poettering [Mon, 5 Dec 2016 19:12:46 +0000 (20:12 +0100)] 
tests: let's make function tables static/const

7 years agocore: add specifier expansion to ReadOnlyPaths= and friends
Lennart Poettering [Mon, 5 Dec 2016 18:42:25 +0000 (19:42 +0100)] 
core: add specifier expansion to ReadOnlyPaths= and friends

Expanding specifiers here definitely makes sense.

Also simplifies the loop a bit, as there's no reason to keep "prev" around...

7 years agocore: add specifier expansion to RequiresMountsFor=
Lennart Poettering [Mon, 5 Dec 2016 18:40:13 +0000 (19:40 +0100)] 
core: add specifier expansion to RequiresMountsFor=

This might be useful for some people, for example to pull in mounts for paths
including the machine ID or hostname.

7 years agocore: turn on specifier expansion for more unit file settings
Lennart Poettering [Mon, 5 Dec 2016 18:38:39 +0000 (19:38 +0100)] 
core: turn on specifier expansion for more unit file settings

Let's permit specifier expansion at a numbre of additional fields, where
arbitrary strings might be passed where this might be useful one day. (Or at
least where there's no clear reason where it wouldn't make sense to have.)

7 years agocore: use unit_full_printf() at a couple of locations we used unit_name_printf()...
Lennart Poettering [Mon, 5 Dec 2016 18:25:44 +0000 (19:25 +0100)] 
core: use unit_full_printf() at a couple of locations we used unit_name_printf() before

For settings that are not taking unit names there's no reason to use
unit_name_printf(). Use unit_full_printf() instead, as the names are validated
anyway in one form or another after expansion.

7 years agocore: resolve more specifiers in unit_name_printf()
Lennart Poettering [Mon, 5 Dec 2016 18:12:54 +0000 (19:12 +0100)] 
core: resolve more specifiers in unit_name_printf()

unit_name_printf() is usually what we use when the resulting string shall
qualify as unit name, and it hence avoids resolving specifiers that almost
certainly won't result in valid unit names.

Add a couple of more specifiers that unit_full_printf() resolves also to the
list unit_name_printf() resolves, as they are likely to be useful in valid unit
names too. (Note that there might be cases where this doesn't hold, but we
should still permit this, as more often than not they are safe, and if people
want to use them that way, they should be able to.)

7 years agoman: drop reference to %U being useless
Lennart Poettering [Mon, 5 Dec 2016 18:10:44 +0000 (19:10 +0100)] 
man: drop reference to %U being useless

This paragraph was a missed left-over from
79413b673b45adc98dfeaec882bbdda2343cb2f9. Drop it now.

7 years agocore: move specifier expansion out of service.c/socket.c
Lennart Poettering [Mon, 5 Dec 2016 17:56:25 +0000 (18:56 +0100)] 
core: move specifier expansion out of service.c/socket.c

This monopolizes unit file specifier expansion in load-fragment.c, and removes
it from socket.c + service.c. This way expansion becomes an operation done exclusively at time of loading unit files.

Previously specifiers were resolved for all settings during loading of unit
files with the exception of ExecStart= and friends which were resolved in
socket.c and service.c. With this change the latter is also moved to the
loading of unit files.

Fixes: #3061
7 years agoman: update the nspawn man page, and document what kind of dissection features we... 4795/head
Lennart Poettering [Wed, 7 Dec 2016 17:36:08 +0000 (18:36 +0100)] 
man: update the nspawn man page, and document what kind of dissection features we now support

7 years agonspawn/dissect: automatically discover dm-verity verity partitions
Lennart Poettering [Wed, 7 Dec 2016 17:28:13 +0000 (18:28 +0100)] 
nspawn/dissect: automatically discover dm-verity verity partitions

This adds support for discovering and making use of properly tagged dm-verity
data integrity partitions. This extends both systemd-nspawn and systemd-dissect
with a new --root-hash= switch that takes the root hash to use for the root
partition, and is otherwise fully automatic.

Verity partitions are discovered automatically by GPT table type UUIDs, as
listed in
https://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/
(which I updated prior to this change, to include new UUIDs for this purpose.

mkosi with https://github.com/systemd/mkosi/pull/39 applied may generate images
that carry the necessary integrity data. With that PR and this commit, the
following simply lines suffice to boot up an integrity-protected container image:

```
 # mkdir test
 # cd test
 # mkosi --verity
 # systemd-nspawn -i ./image.raw -bn
```

Note that mkosi writes the image file to "image.raw" next to a a file
"image.roothash" that contains the root hash. systemd-nspawn will look for that
file and use it if it exists, in case --root-hash= is not specified explicitly.

7 years agonspawn: when generating a machine name from an image name, truncate .raw suffix
Lennart Poettering [Wed, 7 Dec 2016 16:42:40 +0000 (17:42 +0100)] 
nspawn: when generating a machine name from an image name, truncate .raw suffix

Let's prettify the machine name we generate for image-based containers: let's
chop off the .raw suffix before using it as machine name.

7 years agodissect: add support for encrypted images
Lennart Poettering [Mon, 5 Dec 2016 15:26:48 +0000 (16:26 +0100)] 
dissect: add support for encrypted images

This adds support to the image dissector to deal with encrypted images (only
LUKS). Given that we now have a neatly isolated image dissector codebase, let's
add a new feature to it: support for automatically dealing with encrypted
images. This is then exposed in systemd-dissect and nspawn.

It's pretty basic: only support for passphrase-based encryption.

In order to ensure that "systemd-dissect --mount" results in mount points whose
backing LUKS DM devices are cleaned up automatically we use the DM_DEV_REMOVE
ioctl() directly on the device (in DM_DEFERRED_REMOVE mode). libgcryptsetup at
the moment doesn't provide a proper API for this. Thankfully, the ioctl() API
is pretty easy to use.

7 years agominor code beautifications
Lennart Poettering [Mon, 5 Dec 2016 15:09:04 +0000 (16:09 +0100)] 
minor code beautifications