Lennart Poettering [Mon, 25 Jun 2018 16:44:55 +0000 (18:44 +0200)]
sd-boot: factor out searching for loader entry
Lennart Poettering [Mon, 25 Jun 2018 16:36:40 +0000 (18:36 +0200)]
sd-boot: also set an ID for the reboot-into-firmware entry
Lennart Poettering [Mon, 25 Jun 2018 16:19:09 +0000 (18:19 +0200)]
sd-boot: write the IDs of all discovered entries to an EFI variable
This is primarily useful for debugging, but can be useful for other
purposes too. For example userspace could check whether "auto-windows"
is included in the list, before triggering a boot-into-windows
operation.
Lennart Poettering [Mon, 25 Jun 2018 16:18:20 +0000 (18:18 +0200)]
efi: make efivar_set_raw() buffer argument VOID*
No need to define a type if it is just some arbitrary buffer for us
anyway.
Lennart Poettering [Wed, 20 Jun 2018 16:25:01 +0000 (18:25 +0200)]
sd-boot: add boot counting mechanism
Lennart Poettering [Thu, 21 Jun 2018 16:51:14 +0000 (18:51 +0200)]
sd-boot: coding style fix, don't rely on C's downgrade-to-bool feature for numerical values
Lennart Poettering [Thu, 21 Jun 2018 09:25:46 +0000 (11:25 +0200)]
sd-boot: remove left-over lgpl blurb
Lennart Poettering [Wed, 20 Jun 2018 21:32:21 +0000 (23:32 +0200)]
sd-boot: simplify memory management in processing of unified kernel image a bit
Lennart Poettering [Wed, 20 Jun 2018 21:20:47 +0000 (23:20 +0200)]
sd-boot: properly free all config entry fields
Lennart Poettering [Wed, 20 Jun 2018 16:49:10 +0000 (18:49 +0200)]
sd-boot: rename ConfigEntry field 'file' to 'id'
The field derives from a file name only in very specific cases, for
many cases it's a fixed string (for example, all "auto-" items are like
this). Also, even when it derives from a file name, it is processed a
bit, as suffixes are removed and the string is converted to lower case.
hence, let's name this field "id" instead, because that's what it is
used for: as general identification token.
Lennart Poettering [Wed, 20 Jun 2018 16:45:58 +0000 (18:45 +0200)]
sd-boot: break overly long function argument lists following our usual coding style
Lennart Poettering [Wed, 20 Jun 2018 16:25:19 +0000 (18:25 +0200)]
sd-boot: drop initialization of 'line' which we override in the next line anyway
Lennart Poettering [Thu, 21 Jun 2018 16:48:21 +0000 (18:48 +0200)]
efi: explicity check for NULL in FreePoolp()
Firmware implementations are generally pretty bad, hence let's better
add an explicit check for NULL before invokin FreePool(), in particular
is it doesn't appear to be documented whether FreePool() is supposed to
be happy with NULL.
Lennart Poettering [Thu, 21 Jun 2018 16:50:07 +0000 (18:50 +0200)]
efi: add cleanup handler for closing file descriptors
Lennart Poettering [Thu, 21 Jun 2018 16:49:52 +0000 (18:49 +0200)]
efi: add poor man's offsetof() implementation
Lennart Poettering [Thu, 21 Jun 2018 16:47:33 +0000 (18:47 +0200)]
mkosi: update the boot loader from our freshly built one
Lennart Poettering [Tue, 16 Oct 2018 11:56:14 +0000 (13:56 +0200)]
siphash24: add helper for calculating the hash value for a string
Let's shorten some code.
Lennart Poettering [Tue, 16 Oct 2018 14:26:44 +0000 (16:26 +0200)]
Merge pull request #10416 from poettering/udev-coverity
three simple coverity fixes
Lennart Poettering [Tue, 16 Oct 2018 11:49:28 +0000 (13:49 +0200)]
udev: (void)ify calls to kill() where we knowingly ignore the return values
CID 1368231
CID 1368229
Lennart Poettering [Tue, 16 Oct 2018 11:48:25 +0000 (13:48 +0200)]
udev: don't use devname before we acquired it
CID 1396107
Lennart Poettering [Tue, 16 Oct 2018 11:47:23 +0000 (13:47 +0200)]
core: log about unit_watch_pid() failing
CID 1237509
Lennart Poettering [Tue, 16 Oct 2018 10:48:01 +0000 (12:48 +0200)]
Merge pull request #10327 from yuwata/test-sd-device-enumerator-subsystem
sd-device-enumerator: dedup enumerated devices and add test for subsystem filtering
Lennart Poettering [Tue, 16 Oct 2018 09:32:09 +0000 (11:32 +0200)]
Set theme jekyll-theme-cayman
Zbigniew Jędrzejewski-Szmek [Mon, 15 Oct 2018 20:41:49 +0000 (22:41 +0200)]
catalog: fix name of variable
All the messages would (literally) say "The start-up result is RESULT."
because @RESULT@ was not defined.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1639482
and the first part of #8005.
Fixup for
646cc98dc81c4d0edbc1b57e7bca0f474b47e270.
Harry Mallon [Mon, 15 Oct 2018 16:10:44 +0000 (17:10 +0100)]
rules: Add ID_REVISION environment var for NVMe devices
Zbigniew Jędrzejewski-Szmek [Tue, 16 Oct 2018 07:34:27 +0000 (09:34 +0200)]
Merge pull request #9824 from poettering/login-unit-fixes
many logind improvements
Zbigniew Jędrzejewski-Szmek [Tue, 16 Oct 2018 06:42:34 +0000 (08:42 +0200)]
Merge pull request #10391 from poettering/systemctl-exit-code-fixes
systemctl exit code fixes
Zbigniew Jędrzejewski-Szmek [Mon, 15 Oct 2018 13:39:05 +0000 (15:39 +0200)]
Merge pull request #10373 from poettering/systemd-io
adopt systemd.io urls
Yu Watanabe [Sun, 14 Oct 2018 22:15:12 +0000 (07:15 +0900)]
Merge pull request #10392 from poettering/manager-no-inotify-fail
make sure /etc/localtime issues don't cause systemd to fail boot
Ben Boeckel [Sun, 14 Oct 2018 21:16:43 +0000 (17:16 -0400)]
man/systemd.nspawn: fix reference to --timezone argument (#10403)
Lennart Poettering [Sun, 14 Oct 2018 18:11:19 +0000 (20:11 +0200)]
Merge pull request #10394 from yuwata/fixes-found-by-clang
Fix warnings reported by clang
Yu Watanabe [Sat, 13 Oct 2018 14:28:02 +0000 (23:28 +0900)]
Yu Watanabe [Sun, 14 Oct 2018 09:58:36 +0000 (18:58 +0900)]
Merge pull request #10381 from poettering/coverity-fixes
fixes for various recent coverity issues
Yu Watanabe [Sat, 13 Oct 2018 14:59:16 +0000 (23:59 +0900)]
test: use fabsl instead of fabs as json_variant_real() returns 'long double'
Yu Watanabe [Sat, 13 Oct 2018 14:56:07 +0000 (23:56 +0900)]
busctl: drop unused variable
Yu Watanabe [Sat, 13 Oct 2018 14:50:04 +0000 (23:50 +0900)]
core: set _unused_ attribute to 'reloading'
Follow-up for
4df7d537c8203557d330b68ba7833515ddd4e985.
Lennart Poettering [Sat, 13 Oct 2018 13:12:41 +0000 (15:12 +0200)]
core: ensure it's not fatal if we cannot watch /etc/localtime
See: #9602
Lennart Poettering [Sat, 13 Oct 2018 13:12:16 +0000 (15:12 +0200)]
core: add debug logging if we cant watch /etc/localtime itself
Yu Watanabe [Tue, 9 Oct 2018 13:53:13 +0000 (22:53 +0900)]
test: make test-sd-device stricter
Yu Watanabe [Tue, 9 Oct 2018 13:52:33 +0000 (22:52 +0900)]
sd-device: dedup enumerated devices
Yu Watanabe [Tue, 9 Oct 2018 09:44:41 +0000 (18:44 +0900)]
test: add test for subsystem filtering of sd_device_enumerator
Yu Watanabe [Sat, 13 Oct 2018 07:30:49 +0000 (16:30 +0900)]
hashmap: introduce hashmap_first_key_and_value() and friends
Lennart Poettering [Sat, 13 Oct 2018 12:38:46 +0000 (14:38 +0200)]
systemctl: clean up start_unit_one() error handling
Let's split exit code handling in two: "r" is only used for errno-style
errors, and "ret" is used for exit() codes. Then, let's use EXIT_SUCCESS
for checking whether the latter is already used.
This way it should always be clear what kind of error we are processing,
and when we propaate one into the other.
Moreover this allows us to drop "q" form all inner loops, avoiding
confusion when to use "q" and when "r" to store received errors.
Fixes: #9704
Lennart Poettering [Sat, 13 Oct 2018 12:34:56 +0000 (14:34 +0200)]
systemctl: add missing OOM check
Lennart Poettering [Tue, 9 Oct 2018 20:23:41 +0000 (22:23 +0200)]
logind: validate /run/user/1000 before we set it
Let's be safe than sorry, in particular as logind doesn't set it up
anymore, but user-runtime-dir@.service does, and logind doesn't really
track success of that.
Lennart Poettering [Tue, 9 Oct 2018 20:23:14 +0000 (22:23 +0200)]
core: fix unfortunate typo in unit_is_unneeded()
Follow-up for
a3c1168ac293f16d9343d248795bb4c246aaff4a.
Lennart Poettering [Tue, 9 Oct 2018 20:22:52 +0000 (22:22 +0200)]
core: make destructive transaction error a bit more useful
Lennart Poettering [Tue, 7 Aug 2018 09:01:46 +0000 (11:01 +0200)]
update TODO
Lennart Poettering [Tue, 25 Sep 2018 10:40:35 +0000 (12:40 +0200)]
man: also use "yes"/"no" rather than "true"/"false" in man pages
We usually use yes/no in all our unit files, do the same in the man
pages.
Triggered by:
https://github.com/systemd/systemd/pull/9824#issuecomment-
420729987
Lennart Poettering [Wed, 12 Sep 2018 17:04:24 +0000 (19:04 +0200)]
units: use =yes rather than =true everywhere
So far we always used "yes" instead of "true" in all our unit files,
except for one outlier. Let's do this here too. No change in behaviour
whatsoever, except that it looks prettier ;-)
Lennart Poettering [Wed, 8 Aug 2018 14:04:40 +0000 (16:04 +0200)]
logind: automatically GC lingering users for who now user@.service (nor slice, not runtime dir service) is running anymore
This heavily borrows from @intelfx' PR #5546, but watches all three
units that are associated with a user now: the slice, the user@.service
and user-runtime-dir@.service.
The logic and reasoning behind it is the same though: there's no value
in keeping lingering users around if all their three services are gone.
Replaces: #5546
Fixes: #4162
Lennart Poettering [Wed, 8 Aug 2018 14:03:11 +0000 (16:03 +0200)]
logind: improve error propagation of user_check_linger_file()
Let's make this a bit prettier, and propagate unexpected access() errors
correctly.
(The callers of this function will suppress them, but it's nicer of they
do that, rather than us doing that twice in both the callers and the
callees)
Lennart Poettering [Wed, 8 Aug 2018 13:27:49 +0000 (15:27 +0200)]
logind: add a RequiresMountsFor= dependency from the session scope unit to the home directory of the user
This is useful so that during shutdown scope units are always terminated
before the mounts necessary for the home directory.
(Ideally we'd also add a similar dependency from the user@.service
instance to the home directory, but this isn't as easy as that service
is defined statically and not dynamically, and hence not easy to modify
dynamically, in particular when it comes to deps)
Lennart Poettering [Wed, 8 Aug 2018 12:50:57 +0000 (14:50 +0200)]
logind: change user-runtime-dir to query runtime dir size from logind via the bus
I think this is a slightly cleaner approach than parsing the
configuration file at multiple places, as this way there's only a single
reload cycle for logind.conf, and that's systemd-logind.service's
runtime.
This means that logind and dbus become a requirement of
user-runtime-dir, but given that XDG_RUNTIME_DIR is not set anyway
without logind and dbus around this isn't really any limitation.
This also simplifies linking a bit as this means user-runtime-dir
doesn't have to link against any code of logind itself.
Lennart Poettering [Tue, 7 Aug 2018 11:49:34 +0000 (13:49 +0200)]
logind: optionally watch utmp for login data
This allows us to determine the TTY an ssh session is for, which is
useful to to proper idle detection for ssh sessions.
Fixes: #9622
Lennart Poettering [Tue, 7 Aug 2018 10:08:24 +0000 (12:08 +0200)]
logind: add hashtable for finding session by leader PID
This is useful later on, when we quickly want to find the session for a
leader PID.
Lennart Poettering [Tue, 7 Aug 2018 09:02:00 +0000 (11:02 +0200)]
logind: optionally, keep the user@.service instance for eached logged in user around for a while
This should speed up rapid logout/login cycles a bit.
By default this timeout is now set to 10s.
Fixes: #8410
Replaces: #4434
Lennart Poettering [Tue, 7 Aug 2018 08:40:50 +0000 (10:40 +0200)]
logind: minor session time handling tweaks
Lennart Poettering [Mon, 6 Aug 2018 19:44:45 +0000 (21:44 +0200)]
logind: rework how we manage the slice and user-runtime-dir@.service unit for each user
Instead of managing it explicitly, let's simplify things and rely on
regular Wants=/Requires= dependencies to pull in these units from
user@.service and the session scope, and StopWhenUneeded= to stop these
auxiliary units again. This way, they can be pulled in easily by
unrelated units too.
This simplifies things quite a bit: for each session we now only need to
manage the session scope, and for each user the user@.service, the other
units are not something we need to manage anymore.
This patch also makes sure that if user@.service of a user is masked we
will continue to work, and user-runtime-dir@.service will still be
correctly pulled in, as it is now a dependency of the scope unit.
Fixes: #9461
Replaces: #5546
Lennart Poettering [Mon, 6 Aug 2018 19:41:54 +0000 (21:41 +0200)]
logind: don't clobber bus error structure if we don't fail
Lennart Poettering [Mon, 6 Aug 2018 17:35:44 +0000 (19:35 +0200)]
logind: propagate session stop errors
Let's propagate errors from stopping sessions via seat_stop(). This is
similar to how we propagate such errors in user_stop() for all sessions
associated with a user.
Note that we propagate these errors, but we don't abort the function.
Lennart Poettering [Mon, 6 Aug 2018 17:34:39 +0000 (19:34 +0200)]
logind: introduce little helper that checks whether a session is ready
Lennart Poettering [Mon, 6 Aug 2018 17:34:09 +0000 (19:34 +0200)]
logind: use TAKE_PTR() where we can
Lennart Poettering [Mon, 6 Aug 2018 17:05:57 +0000 (19:05 +0200)]
logind: prefer strjoin() over asprintf()
Lennart Poettering [Mon, 6 Aug 2018 17:05:26 +0000 (19:05 +0200)]
logind: don't rely on downgrade-to-bool
Lennart Poettering [Mon, 6 Aug 2018 17:04:49 +0000 (19:04 +0200)]
logind: voidify a few calls
Lennart Poettering [Mon, 6 Aug 2018 17:03:27 +0000 (19:03 +0200)]
logind: make better use of logging functions
Lennart Poettering [Mon, 6 Aug 2018 17:02:29 +0000 (19:02 +0200)]
logind: never elect a session that is stopping as display
Lennart Poettering [Mon, 6 Aug 2018 17:00:49 +0000 (19:00 +0200)]
logind: make unit/job active checking more debuggable
Let's log the error messages if we get any at debug level.
Lennart Poettering [Mon, 6 Aug 2018 16:54:51 +0000 (18:54 +0200)]
man: add missing space
Lennart Poettering [Mon, 6 Aug 2018 16:54:03 +0000 (18:54 +0200)]
sd-bus: add new API call sd_bus_error_move()
This new call move an sd_bus_error into another one.
Lennart Poettering [Mon, 6 Aug 2018 16:21:37 +0000 (18:21 +0200)]
logind: fix bad error propagation
Lennart Poettering [Mon, 6 Aug 2018 16:19:45 +0000 (18:19 +0200)]
logind: correct bad clean-up path
Lennart Poettering [Mon, 6 Aug 2018 16:14:11 +0000 (18:14 +0200)]
logind: save/restore User object's "stopping" field during restarts
Whether we are stopping or not is highly relevant, hence don't forget it
across restarts.
Lennart Poettering [Fri, 3 Aug 2018 18:21:27 +0000 (20:21 +0200)]
logind: improve logging in manager_connect_console()
let's make sure we log about every failure
Also, complain about systems where /dev/tty0 exists but
/sys/class/tty/tty0/active does not. Such systems (usually container
environments) are pretty broken as they mount something that is not a VC
to /dev/tty0 and they really shouldn't.
Systems should either have a VC or not, but not badly fake one by
mounting things wildly.
This just adds a warning message, as before we'll simply turn off VC
handling in this case.
Lennart Poettering [Fri, 3 Aug 2018 18:20:50 +0000 (20:20 +0200)]
logind: initialize Manager object with structure initialization too
Lennart Poettering [Mon, 6 Aug 2018 16:15:07 +0000 (18:15 +0200)]
units: improve Description= string a bit
Let's not use the word "wrapper", as it's not clear what that is, and in
some way any unit file is a "wrapper"... let's simply say that it's
about the runtime directory.
Lennart Poettering [Fri, 3 Aug 2018 18:19:38 +0000 (20:19 +0200)]
units: set StopWhenUnneeded= for the user slice units too
We'd like them to go away, just like the user-runtime-dir@.service when
they aren't needed anymore.
Lennart Poettering [Fri, 3 Aug 2018 18:18:55 +0000 (20:18 +0200)]
logind: turn of stdio locking when writing session files too
This just copies what we already do for user and seat files to session
files.
Lennart Poettering [Fri, 3 Aug 2018 17:04:35 +0000 (19:04 +0200)]
logind: fix serialization/deserialization of user's "display session"
Previously this was serialized as part of the user object. This didn't
work however, as we load users first, and sessions seconds and hence
referencing a session from the user load logic cannot work.
Fix this by storing an IS_DISPLAY property along with each session, and
make the session with this set display session when it is loaded.
Lennart Poettering [Fri, 3 Aug 2018 16:53:09 +0000 (18:53 +0200)]
logind: rework Seat/Session/User object allocation and freeing a bit
Let's update things a bit to follow current practices:
- User structure initialization rather than zero-initialized allocation
- Always propagate proper errors from allocation functions
- Use _cleanup_ for freeing objects when allocation fails half-way
- Make destructors return NULL
Lennart Poettering [Fri, 12 Oct 2018 17:02:23 +0000 (19:02 +0200)]
format-table: don't use unsigned when there's no point in it
CID 1394372
Lennart Poettering [Fri, 12 Oct 2018 16:59:23 +0000 (18:59 +0200)]
journal-upload: check for overflow
CID 1394386
Lennart Poettering [Fri, 12 Oct 2018 16:54:37 +0000 (18:54 +0200)]
wait-online: more voidifyin of sd_event_add_signal()
CID 1394444
Lennart Poettering [Fri, 12 Oct 2018 16:53:17 +0000 (18:53 +0200)]
machinectl: voidify calls to sd_event_add_signal()
CID 1394445
Lennart Poettering [Fri, 12 Oct 2018 16:52:11 +0000 (18:52 +0200)]
udevadm: assert_se() around sigprocmask()
CID #1395708
Lennart Poettering [Fri, 12 Oct 2018 16:50:46 +0000 (18:50 +0200)]
efivars: add missing OOM check
CID #1395833
Lennart Poettering [Fri, 12 Oct 2018 16:49:18 +0000 (18:49 +0200)]
sd-ndisc: change return value of ndisc_reset() to void
We never generate anything other than 0 anyway, and we never check it,
hence let's just simplify things.
Lennart Poettering [Fri, 12 Oct 2018 16:47:28 +0000 (18:47 +0200)]
sd-ndisc: voidify sd_ndisc_stop() call
CID 1395839
Lennart Poettering [Fri, 12 Oct 2018 16:38:40 +0000 (18:38 +0200)]
json: fix memleak on OOM
CID 1396083
Lennart Poettering [Fri, 12 Oct 2018 16:32:22 +0000 (18:32 +0200)]
cgroup: voidify a few things
Lennart Poettering [Fri, 12 Oct 2018 16:31:30 +0000 (18:31 +0200)]
cgroup: make sure whitelist_device() always returns a valid return value
CID 1396094
Lennart Poettering [Fri, 12 Oct 2018 16:26:02 +0000 (18:26 +0200)]
journal: voidify fd_nonblock()
CID #1396098
CID #1396096
CID #1396091
CID #1396086
Yu Watanabe [Sat, 13 Oct 2018 08:45:14 +0000 (17:45 +0900)]
Revert "alloc-util: return NULL if 0-sized allocation is requested"
This reverts commit
c05107767b589e9aac9711eb385738887f86eb77.
Lucas Werkmeister [Sat, 13 Oct 2018 08:31:40 +0000 (10:31 +0200)]
man: systemctl: clarify that --lines=0 is allowed (#10375)
The term “positive” is often read to exclude 0 (though “strictly
positive” is sometimes used to clarify this), so let’s explicitly state
that --lines=0 is legal and completely disables journal output.
Motivated by an answer on StackExchange [1].
[1]: https://unix.stackexchange.com/a/475068/44049
Yu Watanabe [Sat, 13 Oct 2018 08:30:44 +0000 (17:30 +0900)]
Merge pull request #10371 from poettering/sd-event-man-fix
trivial sd-event man page fixes
Jason A. Donenfeld [Sat, 13 Oct 2018 08:28:49 +0000 (10:28 +0200)]
networkd: fix attribute length for wireguard (#10380)
This is actually a u16, not a u32, so the kernel complains:
kernel: netlink: 'systemd-network': attribute type 5 has an invalid length
This is due to:
if (nla_attr_len[pt->type] && attrlen != nla_attr_len[pt->type]) {
pr_warn_ratelimited("netlink: '%s': attribute type %d has an invalid length.\n",
current->comm, type);
}
Presumably this has been working fine in functionality on little-endian
systems, but nobody bothered to try on big-endian systems.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Davide Cavalca [Sat, 13 Oct 2018 08:26:48 +0000 (01:26 -0700)]
shared: add %g, %G specifiers for group / gid (#10368)
Yu Watanabe [Sat, 13 Oct 2018 08:25:36 +0000 (17:25 +0900)]
Merge pull request #10366 from poettering/in-set-fixes
IN_SET() compile time check fixes
Lennart Poettering [Fri, 12 Oct 2018 16:43:04 +0000 (18:43 +0200)]
Merge pull request #10356 from dtardon/covscan
assorted coverity/clang fixes