mirror of
https://github.com/systemd/systemd.git
synced 2026-08-10 17:14:31 +00:00
Currently the varlink interface for hostname is only available
after sysinit. This means it is not available until systemd-firstboot
is finished. But there is information like the boot-id in there that
is useful to get early.
My use-case is to query the system early via the varlink-http-bridge
and currently I can't get data from io.systemd.Hostname until
systemd-firstboot is completed which is a bit limiting.
So to fix it this commit sets DefaultDependencies=no on both the socket
and service units.
It also changes hostnamed.c to use
bus_open_system_watch_bind_with_description() which means we will
reconnect once dbus is available. This mimics what resolved-bus.c
is doing (and which was originally introduced in d7afd945b).
Thanks to Lennart for pointing this out.
24 lines
731 B
SYSTEMD
24 lines
731 B
SYSTEMD
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
#
|
|
# This file is part of systemd.
|
|
#
|
|
# systemd is free software; you can redistribute it and/or modify it
|
|
# under the terms of the GNU Lesser General Public License as published by
|
|
# the Free Software Foundation; either version 2.1 of the License, or
|
|
# (at your option) any later version.
|
|
|
|
[Unit]
|
|
Description=Hostname Service Socket
|
|
Documentation=man:systemd-hostnamed.service(8)
|
|
Documentation=man:hostname(5)
|
|
Documentation=man:machine-info(5)
|
|
DefaultDependencies=no
|
|
Conflicts=shutdown.target
|
|
Before=shutdown.target sockets.target
|
|
|
|
[Socket]
|
|
ListenStream=/run/systemd/io.systemd.Hostname
|
|
Symlinks=/run/varlink/registry/io.systemd.Hostname
|
|
FileDescriptorName=varlink
|
|
SocketMode=0666
|