mirror of
https://github.com/systemd/systemd.git
synced 2024-11-23 02:03:37 +08:00
hostnamed: use Type=notify
This commit is contained in:
parent
deb869970d
commit
9737e2c850
@ -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,
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user