1
0
mirror of https://github.com/systemd/systemd synced 2024-07-01 07:34:28 +00:00

hostnamed: use Type=notify

This commit is contained in:
Mike Yuan 2024-01-09 19:53:18 +08:00
parent deb869970d
commit 9737e2c850
No known key found for this signature in database
GPG Key ID: 417471C0A40F58B3
2 changed files with 6 additions and 0 deletions

View File

@ -14,6 +14,7 @@
#include "bus-log-control-api.h"
#include "bus-polkit.h"
#include "constants.h"
#include "daemon-util.h"
#include "env-file-label.h"
#include "env-file.h"
#include "env-util.h"
@ -1733,6 +1734,10 @@ static int run(int argc, char *argv[]) {
if (r < 0)
return r;
r = sd_notify(false, NOTIFY_READY);
if (r < 0)
log_warning_errno(r, "Failed to send readiness notification, ignoring: %m");
r = bus_event_loop_with_idle(
context.event,
context.bus,

View File

@ -15,6 +15,7 @@ Documentation=man:machine-info(5)
Documentation=man:org.freedesktop.hostname1(5)
[Service]
Type=notify
BusName=org.freedesktop.hostname1
CapabilityBoundingSet=CAP_SYS_ADMIN
ExecStart={{LIBEXECDIR}}/systemd-hostnamed