Lennart Poettering [Wed, 12 Oct 2016 18:33:33 +0000 (20:33 +0200)]
update TODO
Lennart Poettering [Wed, 12 Oct 2016 18:23:43 +0000 (20:23 +0200)]
journalctl: say in which directory we vacuum stuff
Fixes: #4060
Lennart Poettering [Wed, 12 Oct 2016 18:20:53 +0000 (20:20 +0200)]
journalctl: don't claim the journal was stored on disk
Let's just say that the journal takes up space in the file system, not on disk,
as tmpfs is definitely a file system, but not a disk.
Fixes: #4059
Lennart Poettering [Wed, 12 Oct 2016 16:53:35 +0000 (18:53 +0200)]
journal: refuse opening journal files from the future for writing
Never permit that we write to journal files that have newer timestamps than our
local wallclock has. If we'd accept that, then the entries in the file might
end up not being ordered strictly.
Let's refuse this with ETXTBSY, and then immediately rotate to use a new file,
so that each file remains strictly ordered also be wallclock internally.
Lennart Poettering [Wed, 12 Oct 2016 16:49:51 +0000 (18:49 +0200)]
journald: automatically rotate journal files when the clock jumps backwards
As soon as we notice that the clock jumps backwards, rotate journal files. This
is beneficial, as this makes sure that the entries in journal files remain
strictly ordered internally, and thus the bisection algorithm applied on it is
not confused.
This should help avoiding borked wallclock-based bisection on journal files as
witnessed in #4278.
Lennart Poettering [Wed, 12 Oct 2016 16:46:07 +0000 (18:46 +0200)]
journald: use the event loop dispatch timestamp for journal entries
Let's use the earliest linearized event timestamp for journal entries we have:
the event dispatch timestamp from the event loop, instead of requerying the
timestamp at the time of writing.
This makes the time a bit more accurate, allows us to query the kernel time one
time less per event loop, and also makes sure we always use the same timestamp
for both attempts to write an entry to a journal file.
Lennart Poettering [Wed, 12 Oct 2016 10:36:01 +0000 (12:36 +0200)]
journal: when iterating through entry arrays and we hit an invalid one keep going
When iterating through partially synced journal files we need to be prepared
for hitting with invalid entries (specifically: non-initialized). Instead of
generated an error and giving up, let's simply try to preceed with the next one
that is valid (and debug log about this).
This reworks the logic introduced with
caeab8f626e709569cc492b75eb7e119076059e7
to iteration in both directions, and tries to look for valid entries located
after the invalid one. It also extends the behaviour to both iterating through
the global entry array and per-data object entry arrays.
Fixes: #4088
Lennart Poettering [Wed, 12 Oct 2016 10:22:57 +0000 (12:22 +0200)]
journal: add an explicit check for uninitialized objects
Let's make dissecting of borked journal files more expressive: if we encounter
an object whose first 8 bytes are all zeroes, then let's assume the object was
simply never initialized, and say so.
Previously, this would be detected as "overly short object", which is true too
in a away, but it's a lot more helpful printing different debug options for the
case where the size is not initialized at all and where the size is initialized
to some bogus value.
No function behaviour change, only a different log messages for both cases.
Lennart Poettering [Wed, 12 Oct 2016 10:12:58 +0000 (12:12 +0200)]
journal: also check that our entry arrays are properly ordered
Let's and extra check, reusing check_properly_ordered() also for
journal_file_next_entry_for_data().
Lennart Poettering [Wed, 12 Oct 2016 10:12:05 +0000 (12:12 +0200)]
journal: split out check for properly ordered arrays into its own function
This adds a new call check_properly_ordered(), which we can reuse later, and
makes the code a bit more readable.
Lennart Poettering [Wed, 12 Oct 2016 09:54:36 +0000 (11:54 +0200)]
journal: split out array index inc/dec code into a new call bump_array_index()
This allows us to share a bit more code between journal_file_next_entry() and
journal_file_next_entry_for_data().
Lennart Poettering [Tue, 11 Oct 2016 17:12:41 +0000 (19:12 +0200)]
journal: when we encounter a broken journal file, add some debug logging
Let's make it easier to figure out when we see an invalid journal file, why we
consider it invalid, and add some minimal debug logging for it.
This log output is normally not seen (after all, this all is library code),
unless debug logging is exlicitly turned on.
hese10 [Wed, 12 Oct 2016 16:40:28 +0000 (19:40 +0300)]
Avoid forever loop for journalctl --list-boots command (#4278)
When date is changed in system to future and normal user logs to new journal file, and then date is changed back to present time, the "journalctl --list-boot" command goes to forever loop. This commit tries to fix this problem by checking first the boot id list if the found boot id was already in that list. If it is found, then stopping the boot id find loop.
Ben Harris [Wed, 12 Oct 2016 13:41:56 +0000 (14:41 +0100)]
hwdb: Treat Latitude 2110 brightness keys like on Inspiron 1520 (#4355)
Like the Inspiron 1520, the Dell Latitude 2110 emits brightness-control
key events both through atkbd and acpi-video. This suppresses them on
the atkbd side.
Lennart Poettering [Wed, 12 Oct 2016 09:21:11 +0000 (11:21 +0200)]
Merge pull request #4351 from keszybz/nspawn-debugging
Enhance nspawn debug logs for mount/unmount operations
Yu Watanabe [Wed, 12 Oct 2016 09:13:13 +0000 (18:13 +0900)]
units: journal-upload Wants= and After=network-online.target (#4354)
To upload journal entries to a remote server, it is required that
the network is online.
Zbigniew Jędrzejewski-Szmek [Wed, 12 Oct 2016 09:12:11 +0000 (05:12 -0400)]
Allow block and char classes in DeviceAllow bus properties (#4353)
Allowed paths are unified betwen the configuration file parses and the bus
property checker. The biggest change is that the bus code now allows "block-"
and "char-" classes. In addition, path_startswith("/dev") was used in the bus
code, and startswith("/dev") was used in the config file code. It seems
reasonable to use path_startswith() which allows a slightly broader class of
strings.
Fixes #3935.
Andrew Jeddeloh [Wed, 12 Oct 2016 01:28:22 +0000 (21:28 -0400)]
networkd: add dbus interface for lease raw options (#3528)
Add a dbus object to represent dhcp leases and their raw options (i.e.
options 224-254).
0xAX [Tue, 11 Oct 2016 21:30:04 +0000 (00:30 +0300)]
core/main: get rid from excess check of ACTION_TEST (#4350)
If `--test` command line option was passed, the systemd set skip_setup
to true during bootup. But after this we check again that arg_action is
test or help and opens pager depends on result.
We should skip setup in a case when `--test` is passed, but it is also
safe to set skip_setup in a case of `--help`. So let's remove first
check and move skip_setup = true to the second check.
Zbigniew Jędrzejewski-Szmek [Tue, 11 Oct 2016 21:24:03 +0000 (17:24 -0400)]
missing: add a bunch of mount flags
Evgeny Vereshchagin [Tue, 11 Oct 2016 21:18:27 +0000 (00:18 +0300)]
nspawn: let's mount(/tmp) inside the user namespace (#4340)
Fixes:
host# systemd-nspawn -D ... -U -b systemd.unit=multi-user.target
...
$ grep /tmp /proc/self/mountinfo
154 145 0:41 / /tmp rw - tmpfs tmpfs rw,seclabel,uid=
1036124160,gid=
1036124160
$ umount /tmp
umount: /root/tmp: not mounted
$ systemctl poweroff
...
[FAILED] Failed unmounting Temporary Directory.
Zbigniew Jędrzejewski-Szmek [Mon, 10 Oct 2016 19:55:20 +0000 (15:55 -0400)]
nspawn,mount-util: add [u]mount_verbose and use it in nspawn
This makes it easier to debug failed nspawn invocations:
Mounting sysfs on /var/lib/machines/fedora-rawhide/sys (MS_RDONLY|MS_NOSUID|MS_NOEXEC|MS_NODEV "")...
Mounting tmpfs on /var/lib/machines/fedora-rawhide/dev (MS_NOSUID|MS_STRICTATIME "mode=755,uid=
1450901504,gid=
1450901504")...
Mounting tmpfs on /var/lib/machines/fedora-rawhide/dev/shm (MS_NOSUID|MS_NODEV|MS_STRICTATIME "mode=1777,uid=
1450901504,gid=
1450901504")...
Mounting tmpfs on /var/lib/machines/fedora-rawhide/run (MS_NOSUID|MS_NODEV|MS_STRICTATIME "mode=755,uid=
1450901504,gid=
1450901504")...
Bind-mounting /sys/fs/selinux on /var/lib/machines/fedora-rawhide/sys/fs/selinux (MS_BIND "")...
Remounting /var/lib/machines/fedora-rawhide/sys/fs/selinux (MS_RDONLY|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_BIND|MS_REMOUNT "")...
Mounting proc on /proc (MS_NOSUID|MS_NOEXEC|MS_NODEV "")...
Bind-mounting /proc/sys on /proc/sys (MS_BIND "")...
Remounting /proc/sys (MS_RDONLY|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_BIND|MS_REMOUNT "")...
Bind-mounting /proc/sysrq-trigger on /proc/sysrq-trigger (MS_BIND "")...
Remounting /proc/sysrq-trigger (MS_RDONLY|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_BIND|MS_REMOUNT "")...
Mounting tmpfs on /tmp (MS_STRICTATIME "mode=1777,uid=0,gid=0")...
Mounting tmpfs on /sys/fs/cgroup (MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_STRICTATIME "mode=755,uid=0,gid=0")...
Mounting cgroup on /sys/fs/cgroup/systemd (MS_NOSUID|MS_NOEXEC|MS_NODEV "none,name=systemd,xattr")...
Failed to mount cgroup on /sys/fs/cgroup/systemd (MS_NOSUID|MS_NOEXEC|MS_NODEV "none,name=systemd,xattr"): No such file or directory
Zbigniew Jędrzejewski-Szmek [Tue, 11 Oct 2016 18:41:30 +0000 (14:41 -0400)]
nspawn: small cleanups in get_controllers()
- check for oom after strdup
- no need to truncate the line since we're only extracting one field anyway
- use STR_IN_SET
Zbigniew Jędrzejewski-Szmek [Mon, 10 Oct 2016 20:12:50 +0000 (16:12 -0400)]
nspawn: simplify arg_us_cgns passing
We would check the condition cg_ns_supported() twice. No functional
change.
Lennart Poettering [Tue, 11 Oct 2016 18:07:22 +0000 (20:07 +0200)]
core: chown() any TTY used for stdin, not just when StandardInput=tty is used (#4347)
If stdin is supplied as an fd for transient units (using the
StandardInputFileDescriptor pseudo-property for transient units), then we
should also fix up the TTY ownership, not just when we opened the TTY
ourselves.
This simply drops the explicit is_terminal_input()-based check. Note that
chown_terminal() internally does a much more appropriate isatty()-based check
anyway, hence we can drop this without replacement.
Fixes: #4260
Thomas H. P. Andersen [Tue, 11 Oct 2016 17:51:03 +0000 (19:51 +0200)]
resolve: remove unsed counter (#4349)
It was introduced but never used in
45ec7efb.
Zbigniew Jędrzejewski-Szmek [Tue, 11 Oct 2016 17:49:15 +0000 (13:49 -0400)]
Merge pull request #4348 from poettering/docfixes
Various smaller documentation fixes.
Zbigniew Jędrzejewski-Szmek [Tue, 11 Oct 2016 17:40:50 +0000 (13:40 -0400)]
Merge pull request #4067 from poettering/invocation-id
Add an "invocation ID" concept to the service manager
Lennart Poettering [Tue, 11 Oct 2016 16:42:22 +0000 (18:42 +0200)]
man: beef up documentation on per-unit resource limits a bit
Let's clarify that for user services some OS-defined limits bound the settings
in the unit files.
Fixes: #4232
Lennart Poettering [Tue, 11 Oct 2016 16:01:54 +0000 (18:01 +0200)]
man: document that Type=idle is subject to a 5s time-out
Fixes: #4116
Lennart Poettering [Tue, 11 Oct 2016 15:55:04 +0000 (17:55 +0200)]
man: avoid using the term "loaded" for units currently in memory, since we also have a unit state of that name
Fixes: #3971
Lennart Poettering [Tue, 11 Oct 2016 15:46:59 +0000 (17:46 +0200)]
pager: tiny beautification
Lennart Poettering [Tue, 11 Oct 2016 15:45:49 +0000 (17:45 +0200)]
man: expand the documentation of $SYSTEMD_PAGER and related environment variables
Document the default pagers used, as well as $SYSTEMD_LESSCHARSET.
Fixes: #4143
Lennart Poettering [Tue, 11 Oct 2016 15:05:19 +0000 (17:05 +0200)]
Merge pull request #4115 from yuwata/completion-fix
bash-completion: systemctl: do not pass masked or not-found units to filter
Yu Watanabe [Tue, 11 Oct 2016 12:36:14 +0000 (21:36 +0900)]
units: add Wants=initrd-cleanup.service to initrd-switch-root.target (#4345)
`systemctl isolate initrd-switch-root.target` called by initrd-cleanup.service
kills initrd-cleanup.service itself. Then, initrd-cleanup.service failed and
system goes to emergency shell.
To prevent this problem, this commit adds `Wants=initrd-cleanup.service` to
initrd-switch-root.target.
fixes: #4343.
Stefan Schweter [Tue, 11 Oct 2016 07:08:04 +0000 (09:08 +0200)]
udevadm: use parse_sec instead of atoi for timeout option (#4331)
log_error method is used instead of fprintf
Zbigniew Jędrzejewski-Szmek [Tue, 11 Oct 2016 01:24:57 +0000 (21:24 -0400)]
Merge pull request #4337 from poettering/exit-code
Fix for #4275 and more
Lucas Werkmeister [Tue, 11 Oct 2016 00:27:09 +0000 (02:27 +0200)]
man: update unit type count (#4339)
It seems that this count was not updated when snapshot units were
removed in #1841.
Thomas H. P. Andersen [Tue, 11 Oct 2016 00:12:40 +0000 (02:12 +0200)]
resolved: initialize variable (#4338)
r was not initialized and would be used if "tcp" was the only option
used for the stub. We should initialize it to 0 to indicate that no
error happened in the udp case.
Martin Pitt [Mon, 10 Oct 2016 21:13:26 +0000 (23:13 +0200)]
Merge pull request #4336 from dandedrick/journal-remote-non-blocking
Journal remote non blocking
Lennart Poettering [Mon, 10 Oct 2016 20:28:55 +0000 (22:28 +0200)]
core: simplify if branches a bit
We do the same thing in two branches, let's merge them. Let's also add an
explanatory comment, while we are at it.
Lennart Poettering [Mon, 10 Oct 2016 20:28:38 +0000 (22:28 +0200)]
core: make use of IN_SET() in various places in mount.c
Lennart Poettering [Mon, 10 Oct 2016 20:07:30 +0000 (22:07 +0200)]
core: when determining whether a process exit status is clean, consider whether it is a command or a daemon
SIGTERM should be considered a clean exit code for daemons (i.e. long-running
processes, as a daemon without SIGTERM handler may be shut down without issues
via SIGTERM still) while it should not be considered a clean exit code for
commands (i.e. short-running processes).
Let's add two different clean checking modes for this, and use the right one at
the appropriate places.
Fixes: #4275
Lennart Poettering [Mon, 10 Oct 2016 19:56:36 +0000 (21:56 +0200)]
core: lower exit status "level" at one place
When we print information about PID 1's crashdump subprocess failing. In this
case we *know* that we do not generate LSB exit codes, as it's basically PID 1
itself that exited there.
0xAX [Mon, 10 Oct 2016 20:11:36 +0000 (23:11 +0300)]
main: use strdup instead of free_and_strdup to initialize default unit (#4335)
Previously we've used free_and_strdup() to fill arg_default_unit with unit
name, If we didn't pass default unit name through a kernel command line or
command line arguments. But we can use just strdup() instead of
free_and_strdup() for this, because we will start fill arg_default_unit
only if it wasn't set before.
Lennart Poettering [Mon, 10 Oct 2016 19:48:08 +0000 (21:48 +0200)]
exit-status: kill is_clean_exit_lsb(), move logic to sysv-generator
Let's get rid of is_clean_exit_lsb(), let's move the logic for the special
handling of the two LSB exit codes into the sysv-generator by writing out
appropriate SuccessExitStatus= lines if the LSB header exists. This is not only
semantically more correct, bug also fixes a bug as the code in service.c that
chose between is_clean_exit_lsb() and is_clean_exit() based this check on
whether a native unit files was available for the unit. However, that check was
bogus since a long time, since the SysV generator was introduced and native
SysV script support was removed from PID 1, as in that case a unit file always
existed.
Dan Dedrick [Fri, 6 May 2016 19:14:14 +0000 (15:14 -0400)]
journal-remote: fix up misleading man page
The --no-seal and --no-compress options were dropped and replaced with
boolean functionality. This syncs the man page with the code.
Dan Dedrick [Wed, 4 May 2016 21:06:45 +0000 (17:06 -0400)]
journal-remote: make the child pipe non-blocking
We are going to add this child as a source to our event loop so we don't
want to block when reading data from it as this will prevent us from
processing other events. Specifically this will block the signalfds
which means if we are waiting for data from curl we won't handle SIGTERM
or SIGINT until we happen to get more data.
Lennart Poettering [Mon, 10 Oct 2016 18:11:49 +0000 (20:11 +0200)]
install: let's always refer to the actual setting in errors
Lennart Poettering [Mon, 10 Oct 2016 18:11:21 +0000 (20:11 +0200)]
exit-status: reorder the exit status switch table
Let's make sure it's in the same order as the actual enum defining the exit
statuses.
Lennart Poettering [Mon, 10 Oct 2016 18:08:41 +0000 (20:08 +0200)]
exit-status: remove ExitStatus typedef
Do not make up our own type for ExitStatus, but use the type used by POSIX for
this, which is "int". In particular as we never used that type outside of the
definition of exit_status_to_string() where we internally cast the paramter to
(int) every single time we used it.
Hence, let's simplify things, drop the type and use the kernel type directly.
Lennart Poettering [Mon, 10 Oct 2016 17:53:37 +0000 (19:53 +0200)]
update TODO
Susant Sahani [Mon, 10 Oct 2016 17:52:12 +0000 (23:22 +0530)]
networkd: rename Rename CheckSum → Checksum (#4312)
Lennart Poettering [Mon, 10 Oct 2016 17:51:51 +0000 (19:51 +0200)]
Merge pull request #4332 from keszybz/nspawn-arguments-3
nspawn --private-users parsing, v2
0xAX [Mon, 10 Oct 2016 17:51:33 +0000 (20:51 +0300)]
tree-wide: pass return value of make_null_stdio() to warning instead of errno (#4328)
as @poettering suggested in the #4320
Evgeny Vereshchagin [Mon, 10 Oct 2016 17:47:25 +0000 (20:47 +0300)]
Merge pull request #4310 from keszybz/nspawn-autodetect
Autodetect systemd version in containers started by systemd-nspawn
Zbigniew Jędrzejewski-Szmek [Mon, 10 Oct 2016 15:22:45 +0000 (11:22 -0400)]
nspawn: better error messages for parsing errors
In particular, the check for arg_uid_range <= 0 is moved to the end, so that
"foobar:0" gives "Failed to parse UID", and not "UID range cannot be 0.".
Zbigniew Jędrzejewski-Szmek [Mon, 10 Oct 2016 15:12:57 +0000 (11:12 -0400)]
nspawn,man: fix parsing of numeric args for --private-users, accept any boolean
This is like the previous reverted commit, but any boolean is still accepted,
not just "yes" and "no". Man page is adjusted to match the code.
Zbigniew Jędrzejewski-Szmek [Mon, 10 Oct 2016 14:04:31 +0000 (10:04 -0400)]
Revert "nspawn: fix parsing of numeric arguments for --private-users"
This reverts commit
bfd292ec35c7b768f9fb5cff4d921f3133e62b19.
Felipe Sateler [Mon, 10 Oct 2016 13:40:05 +0000 (10:40 -0300)]
login: drop fedora-specific PAM config, add note to DISTRO_PORTING (#4314)
It is impossible to ship a fully generic PAM configuration upstream.
Therefore, ship a minimal configuration with the systemd --user requirements,
and add a note to DISTRO_PORTING documenting this.
Fixes #4284
Franck Bui [Mon, 10 Oct 2016 10:06:26 +0000 (12:06 +0200)]
unit: drop console-shell.service (#4298) (#4325)
console-shell.service was supposed to be useful for normal clean boots
(i.e. multi-user.target or so), as a replacement for logind/getty@.service for
simpler use cases.
But due to the lack of documentation and sanity check one can easily be
confused and enable this service in // with getty@.service.
In this case we end up with both services sharing the same tty which ends up in
strange results.
Even worse, console-shell.service might be failing while getty@.service tries
to acquire the terminal which ends up in the system to poweroff since
console-shell.service uses:
"ExecStopPost=-/usr/bin/systemctl poweroff".
Another issue: this service doesn't work well if plymouth is also used since it
lets the splash screen program run and mess the tty (at least a "plymouth quit"
is missing).
So let's kill it for now.
Lennart Poettering [Mon, 10 Oct 2016 07:37:01 +0000 (09:37 +0200)]
Merge pull request #4323 from keszybz/resolved-in-userns
A fix to get resolved to start in userns
0xAX [Mon, 10 Oct 2016 02:57:03 +0000 (05:57 +0300)]
main: initialize default unit little later (#4321)
systemd fills arg_default_unit during startup with default.target
value. But arg_default_unit may be overwritten in parse_argv() or
parse_proc_cmdline_item().
Let's check value of arg_default_unit after calls of parse_argv()
and parse_proc_cmdline_item() and fill it with default.target if
it wasn't filled before. In this way we will not spend unnecessary
time to for filling arg_default_unit with default.target.
0xAX [Mon, 10 Oct 2016 02:55:24 +0000 (05:55 +0300)]
tree-wide: print warning in a failure case of make_null_stdio() (#4320)
The make_null_stdio() may fail. Let's check its result and print
warning message instead of keeping silence.
Zbigniew Jędrzejewski-Szmek [Sun, 9 Oct 2016 19:04:59 +0000 (15:04 -0400)]
resolved: also disable stub listener on EPERM
When running in a user namespace without private networking, resolved would
fail to start. There isn't much difference between EADDRINUSE and EPERM,
so treat them the same, except for the warning message text.
Zbigniew Jędrzejewski-Szmek [Sun, 9 Oct 2016 18:19:06 +0000 (14:19 -0400)]
resolved: simplify error handling in manager_dns_stub_{udp,tcp}_fd()
Make sure an error is always printed… When systemd-resolved is started in a
user namespace without private network, it would fail on setsockopt, but the
error wouldn't be particularly informative:
"Failed to start manager: permission denied."
Evgeny Vereshchagin [Mon, 10 Oct 2016 00:26:17 +0000 (03:26 +0300)]
Merge pull request #4319 from keszybz/nspawn-arguments
Nspawn arguments parsing and man page update
Lans Zhang [Sun, 9 Oct 2016 22:59:54 +0000 (06:59 +0800)]
sd-boot: trigger to record further logs to tcg 2.0 final event log area (#4302)
According to TCG EFI Protocol Specification for TPM 2.0 family,
all events generated after the invocation of EFI_TCG2_GET_EVENT_LOG
shall be stored in an instance of an EFI_CONFIGURATION_TABLE aka
EFI TCG 2.0 final events table. Hence, it is necessary to trigger the
internal switch through calling get_event_log() in order to allow
to retrieve the logs from OS runtime.
msekletar:
> I've looked at EDK2 and indeed log entry is added to FinalEventsTable only after
> EFI_TCG2_PROTOCOL.GetEventLog was called[1][2]. Also, same patch was currently
> merged to shim by Peter Jones [3].
[1] https://github.com/tianocore/edk2/blob/master/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c#L698
[2] https://github.com/tianocore/edk2/blob/master/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c#L824
[3] rhinstaller/shim#64
Zbigniew Jędrzejewski-Szmek [Sun, 9 Oct 2016 15:48:01 +0000 (11:48 -0400)]
man: describe how to reverse systemd-nspawn -U
Now that systemd-nspawn@.service includes -U, more users might be interested
in this tidbit ;)
Zbigniew Jędrzejewski-Szmek [Sun, 9 Oct 2016 15:44:03 +0000 (11:44 -0400)]
nspawn: fix parsing of numeric arguments for --private-users
The documentation says lists "yes", "no", "pick", and numeric arguments.
But parse_boolean was attempted first, so various numeric arguments were
misinterpreted.
In particular, this fixes --private-users=0 to mean the same thing as
--private-users=0:65536.
While at it, use strndupa to avoid some error handling.
Also give a better error for an empty UID range. I think it's likely that
people will use --private-users=0:0 thinking that the argument means UID:GID.
Zbigniew Jędrzejewski-Szmek [Sun, 9 Oct 2016 15:18:22 +0000 (11:18 -0400)]
nspawn: reindent table
Zbigniew Jędrzejewski-Szmek [Sat, 8 Oct 2016 23:03:53 +0000 (19:03 -0400)]
nspawn: also fall back to legacy cgroup hierarchy for old containers
Current systemd version detection routine cannot detect systemd 230,
only systmed >= 231. This means that we'll still use the legacy hierarchy
in some cases where we wouldn't have too. If somebody figures out a nice
way to detect systemd 230 this can be later improved.
0xAX [Sat, 8 Oct 2016 21:49:33 +0000 (00:49 +0300)]
machinectl: enable pager on help (#4313)
as its output is fairly long.
Zbigniew Jędrzejewski-Szmek [Sat, 8 Oct 2016 06:18:26 +0000 (02:18 -0400)]
nspawn: use mixed cgroup hierarchy only when container has new systemd
systemd-soon-to-be-released-232 is able to deal with the mixed hierarchy.
So make an educated guess, and use the mixed hierarchy in that case.
Tested by running the host with mixed hierarchy (i.e. simply using a recent
kernel with systemd from git), and booting first a container with older systemd,
and then one with a newer systemd.
Fixes #4008.
Zbigniew Jędrzejewski-Szmek [Fri, 7 Oct 2016 14:31:47 +0000 (10:31 -0400)]
nspawn: fix spurious reboot if container process returns 133
Zbigniew Jędrzejewski-Szmek [Sun, 2 Oct 2016 19:32:38 +0000 (21:32 +0200)]
nspawn: move the main loop body out to a new function
The new function has 416 lines by itself!
"return log_error_errno" is used to nicely reduce the volume of error
handling code.
A few minor issues are fixed on the way:
- positive value was used as error value (EIO), causing systemd-nspawn
to return success, even though it shouldn't.
- In two places random values were used as error status, when the
actual value was in an unusual place (etc_password_lock, notify_socket).
Those are the only functional changes.
There is another potential issue, which is marked with a comment, and left
unresolved: the container can also return 133 by itself, causing a spurious
reboot.
Zbigniew Jędrzejewski-Szmek [Sun, 2 Oct 2016 18:07:22 +0000 (20:07 +0200)]
nspawn: check env var first, detect second
If we are going to use the env var to override the detection result
anyway, there is not point in doing the detection, especially that
it can fail.
Zbigniew Jędrzejewski-Szmek [Sun, 2 Oct 2016 13:51:27 +0000 (15:51 +0200)]
path-util: add a function to peek into a container and guess systemd version
This is a bit crude and only works for new systemd versions which
have libsystemd-shared.
Stefan Schweter [Sat, 8 Oct 2016 11:59:34 +0000 (13:59 +0200)]
systemd-resolve: use sha256 for local-part of openpgp key (#4193)
Susant Sahani [Sat, 8 Oct 2016 11:05:41 +0000 (16:35 +0530)]
networkd: address add support to configure flags (#4201)
This patch enables to configure
IFA_F_HOMEADDRESS
IFA_F_NODAD
IFA_F_MANAGETEMPADDR
IFA_F_NOPREFIXROUTE
IFA_F_MCAUTOJOIN
Lennart Poettering [Fri, 7 Oct 2016 21:38:03 +0000 (23:38 +0200)]
Merge pull request #4061 from dm0-/coreos-1545
resolved: add an option to disable the stub resolver
David Michael [Wed, 31 Aug 2016 22:34:29 +0000 (15:34 -0700)]
resolved: add an option to control the DNS stub listener
Lennart Poettering [Fri, 7 Oct 2016 18:32:23 +0000 (20:32 +0200)]
update TODO
Lennart Poettering [Wed, 31 Aug 2016 10:23:27 +0000 (12:23 +0200)]
man: update sd-id128(3) a bit
Let's add documentation about SD_ID128_NULL and sd_id128_is_null().
Let's also indent our examples by 8chs, as is generally our coding style.
Lennart Poettering [Tue, 30 Aug 2016 21:18:46 +0000 (23:18 +0200)]
core: add "invocation ID" concept to service manager
This adds a new invocation ID concept to the service manager. The invocation ID
identifies each runtime cycle of a unit uniquely. A new randomized 128bit ID is
generated each time a unit moves from and inactive to an activating or active
state.
The primary usecase for this concept is to connect the runtime data PID 1
maintains about a service with the offline data the journal stores about it.
Previously we'd use the unit name plus start/stop times, which however is
highly racy since the journal will generally process log data after the service
already ended.
The "invocation ID" kinda matches the "boot ID" concept of the Linux kernel,
except that it applies to an individual unit instead of the whole system.
The invocation ID is passed to the activated processes as environment variable.
It is additionally stored as extended attribute on the cgroup of the unit. The
latter is used by journald to automatically retrieve it for each log logged
message and attach it to the log entry. The environment variable is very easily
accessible, even for unprivileged services. OTOH the extended attribute is only
accessible to privileged processes (this is because cgroupfs only supports the
"trusted." xattr namespace, not "user."). The environment variable may be
altered by services, the extended attribute may not be, hence is the better
choice for the journal.
Note that reading the invocation ID off the extended attribute from journald is
racy, similar to the way reading the unit name for a logging process is.
This patch adds APIs to read the invocation ID to sd-id128:
sd_id128_get_invocation() may be used in a similar fashion to
sd_id128_get_boot().
PID1's own logging is updated to always include the invocation ID when it logs
information about a unit.
A new bus call GetUnitByInvocationID() is added that allows retrieving a bus
path to a unit by its invocation ID. The bus path is built using the invocation
ID, thus providing a path for referring to a unit that is valid only for the
current runtime cycleof it.
Outlook for the future: should the kernel eventually allow passing of cgroup
information along AF_UNIX/SOCK_DGRAM messages via a unique cgroup id, then we
can alter the invocation ID to be generated as hash from that rather than
entirely randomly. This way we can derive the invocation race-freely from the
messages.
Lennart Poettering [Tue, 30 Aug 2016 19:49:26 +0000 (21:49 +0200)]
util: use SPECIAL_ROOT_SLICE macro where appropriate
Lennart Poettering [Tue, 30 Aug 2016 19:02:36 +0000 (21:02 +0200)]
log: minor fixes
Most important is a fix to negate the error number if necessary, before we
first access it.
Lennart Poettering [Tue, 30 Aug 2016 19:01:58 +0000 (21:01 +0200)]
journal: fix format string used for usec_t
Lennart Poettering [Tue, 30 Aug 2016 19:00:52 +0000 (21:00 +0200)]
journal: complete slice info in journal metadata
We are already attaching the system slice information to log messages, now add
theuser slice info too, as well as the object slice info.
Lennart Poettering [Fri, 26 Aug 2016 17:20:02 +0000 (19:20 +0200)]
bus-util: generalize helper for ID128 prpoerties
This way, we can make use of this in other code, too.
Lennart Poettering [Fri, 26 Aug 2016 17:18:15 +0000 (19:18 +0200)]
strv: fix STRV_FOREACH_BACKWARDS() to be a single statement only
Let's make sure people invoking STRV_FOREACH_BACKWARDS() as a single statement
of an if statement don't fall into a trap, and find the tail for the list via
strv_length().
Lennart Poettering [Fri, 7 Oct 2016 16:30:53 +0000 (18:30 +0200)]
Merge pull request #4304 from poettering/notify-nul-check
3 minor improvements for notification message handling
Zbigniew Jędrzejewski-Szmek [Fri, 7 Oct 2016 13:39:42 +0000 (09:39 -0400)]
core: only warn on short reads on signal fd
Susant Sahani [Fri, 7 Oct 2016 13:46:18 +0000 (19:16 +0530)]
networkd: remote checksum offload for vxlan (#4110)
This patch adds support to remote checksum checksum offload to VXLAN.
This patch adds RemoteCheckSumTx and RemoteCheckSumRx vxlan configuration
to enable remote checksum offload for transmit and receive on the VXLAN tunnel.
rwmjones [Fri, 7 Oct 2016 12:56:27 +0000 (13:56 +0100)]
architecture: Add support for the RISC-V architecture. (#4305)
RISC-V is an open source ISA in development since 2010 at UCB.
For more information, see https://riscv.org/
I am adding RISC-V support to Fedora:
https://fedoraproject.org/wiki/Architectures/RISC-V
There are three major variants of the architecture (32-, 64- and
128-bit). The 128-bit variant is a paper exercise, but the other
two really exist in silicon. RISC-V is always little endian.
On Linux, the default kernel uname(2) can return "riscv" for all
variants. However a patch was added recently which makes the kernel
return one of "riscv32" or "riscv64" (or in future "riscv128"). So
systemd should be prepared to handle any of "riscv", "riscv32" or
"riscv64" (in future, "riscv128" but that is not included in the
current patch). If the kernel returns "riscv" then you need to use
the pointer size in order to know the real variant.
The Fedora/RISC-V kernel only ever returns "riscv64" since we're
only doing Fedora for 64 bit at the moment, and we've patched the
kernel so it doesn't return "riscv".
As well as the major bitsize variants, there are also architecture
extensions. However I'm trying to ensure that uname(2) does *not*
return any other information about those in utsname.machine, so that
we don't end up with "riscv64abcde" nonsense. Instead those
extensions will be exposed in /proc/cpuinfo similar to how flags
work in x86.
Lennart Poettering [Fri, 7 Oct 2016 10:14:33 +0000 (12:14 +0200)]
manager: tighten incoming notification message checks
Let's not accept datagrams with embedded NUL bytes. Previously we'd simply
ignore everything after the first NUL byte. But given that sending us that is
pretty ugly let's instead complain and refuse.
With this change we'll only accept messages that have exactly zero or one NUL
bytes at the very end of the datagram.
Lennart Poettering [Fri, 7 Oct 2016 10:12:10 +0000 (12:12 +0200)]
manager: be stricter with incomining notifications, warn properly about too large ones
Let's make the kernel let us know the full, original datagram size of the
incoming message. If it's larger than the buffer space provided by us, drop the
whole message with a warning.
Before this change the kernel would truncate the message for us to the buffer
space provided, and we'd not complain about this, and simply process the
incomplete message as far as it made sense.
Lennart Poettering [Fri, 7 Oct 2016 10:08:51 +0000 (12:08 +0200)]
manager: don't ever busy loop when we get a notification message we can't process
If the kernel doesn't permit us to dequeue/process an incoming notification
datagram message it's still better to stop processing the notification messages
altogether than to enter a busy loop where we keep getting notified but can't
do a thing about it.
With this change, manager_dispatch_notify_fd() behaviour is changed like this:
- if an error indicating a spurious wake-up is seen on recvmsg(), ignore it
(EAGAIN/EINTR)
- if any other error is seen on recvmsg() propagate it, thus disabling
processing of further wakeups
- if any error is seen on later code in the function, warn about it but do not
propagate it, as in this cas we're not going to busy loop as the offending
message is already dequeued.
Lennart Poettering [Fri, 7 Oct 2016 07:58:25 +0000 (09:58 +0200)]
Merge pull request #4300 from keszybz/mkosi
Various mkosi bits
Lukáš Nykrýn [Fri, 7 Oct 2016 01:08:21 +0000 (03:08 +0200)]
core: add possibility to set action for ctrl-alt-del burst (#4105)
For some certification, it should not be possible to reboot the machine through ctrl-alt-delete. Currently we suggest our customers to mask the ctrl-alt-delete target, but that is obviously not enough.
Patching the keymaps to disable that is really not a way to go for them, because the settings need to be easily checked by some SCAP tools.