Fix off-by-one error in "Missed X kernel messages" warning

On receiving a message, "kernel_seqnum" is set to "serial + 1". So
subtracting 1 will cause messages like "Missed 0 kernel messages",
which should be "Missed 1 kernel messages".
machine: don't return uninitialized variable

Repotred by Ronny Chevalier

(cherry picked from commit f14aa1f1b2e4e99ee20393871b5f64f1378ed6c3)
core: do not read system boot timestamps in systemd --user mode

Before:
  $ systemd-analyze --user
  Startup finished in 2.810s (firmware) + 48ms (loader) + 122ms (userspace) = 122ms

After:
  $ systemd-analyze --user
  Startup finished in 122ms (userspace) = 122ms

(cherry picked from commit 530a9662aa3d291555e5b3f6eb43199e1b04f63c)
udev: do not export "static node" tags for non-existing devices

(cherry picked from commit ca2bb1606a170ce2e45de1345b0119bd220f4f0d)
logind: don't print error if devices vanish during ACL-init

If a device is unplugged while we initialize it, we will get ENOENT for
ACL-init (and related stuff). We currently print errors then, which is
misleading. Print a debug-message early and continue.

(cherry picked from commit 8016b904849a2d2bd8b0171ed8493db5524b5ff7)
journal: fix export of messages containing newlines

In "export" format, newlines are significant, and messages containing
newlines must be exported as "binary".

(cherry picked from commit 0ade5ffe2778e7b238bba8d979ca4d53dee1e702)
systemctl: update NAME to PATTERN in help()

Previously the man page was modified, but not help().

(cherry picked from commit b3ae710c251d0ce5cf2cef63208e325497b5e323)
tty-ask-password-agent: return negative errno

Return negative errno in wall_tty_block(). get_ctty_devnr() already
returns a negative errno in case of failure, no need to negate it again.

Reported-by: Simon <hwold@odai.homelinux.net>
(cherry picked from commit ee0e4cca5ac37a094dfe1074907dae70c7b7701c)
systemd-python: use .hex instead of .get_hex()

It turns out the latter got removed in Python 3.

https://bugs.freedesktop.org/show_bug.cgi?id=77086
(cherry picked from commit b532cf3722e04adb0bd075666eb9989a9390d0a2)
systemd-python: fix failing assert

A parameter which was always null before, now get's set to
the module.

(cherry picked from commit b65f24238b0627143916a9c7f8315483a9666676)
journal-remote-parse: avoid passing null to memchr

Found with scan-build

(cherry picked from commit 609211792b83267ca202b40f25d1755a004c8c96)
cgls: fix running with -M option

systemd-machined doesn't store cgroup path in a state file anymore.
Let's figure it out from the scope.

(cherry picked from commit 13be49798cc4d1bdf84780b6a315e920f20fa11a)
nspawn: Fix erroneous OOM when building group list

change_uid_gid() never initialises sz which may cause greedy_realloc to
skip the initial buffer allocation.

(cherry picked from commit 70f539ca147694c2a61131b7068526d88decd931)
journal: cleanup up error handling in update_catalog()

- Negative/positive errno mixup caused duplicates not to be detected properly.
  Now we get a warning about some duplicate entries in our own catalogs...
- Errors in update_catalog would be ignored, but they should not be.

(cherry picked from commit e3b9d9c8027a7c4c55cf1614e0fe9423fad69e8f)
core: Make sure a stamp file exists for all Persistent=true timers

If a persistent timer has no stamp file yet, it behaves just like a normal
timer until it runs for the first time. If the system is always shut down
while the timer is supposed to run, a stamp file is never created and
Peristent=true has no effect.

This patch fixes this by creating a stamp file with the current time
when the timer is first started.

(cherry picked from commit 472fc28fdade525e700ebf4b25d026a8c907796d)
util: ignore kernel errors reported via close(), unless it is EBADF

The kernel can return pretty much anything there, even though the fd is
closed. Let's not get confused by that.

(cherry picked from commit d96ea5048b2a901143059eecd32cb1607ceae041)
tmpfiles: fix permissions on new journal files

When starting up journald on a new system, set the proper permissions on
the system.journal files, not only on the journal directory.

(cherry picked from commit a606871da508995f5ede113a8fc6538afd98966c)
cryptsetup: copy value, not key for (rd.)luks.key

(cherry picked from commit 66aaf85e178492c27f699d9c94c84a98466a1435)
implement a union to pad out file_handle

Cases where name_to_handle_at is used allocated the full struct to be
MAX_HANDLE_SZ, and assigned this size to handle_bytes. This is wrong
since handle_bytes should describe the length of the flexible array
member and not the whole struct.

Define a union type which includes sufficient padding to allow
assignment of MAX_HANDLE_SZ to be correct.

(cherry picked from commit 370c860f748d149097710dc7952a64f627db9de7)
systemctl: delete REBOOT_PARAM_FILE if no parameter is specified

And move it to sperate function.

(cherry picked from commit c5220a940d00fc2520c702104939d0a4cf637254)