]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/home/homed.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
6 #include "bus-log-control-api.h"
7 #include "daemon-util.h"
8 #include "homed-manager.h"
9 #include "homed-manager-bus.h"
11 #include "main-func.h"
12 #include "service-util.h"
13 #include "signal-util.h"
15 static int run(int argc
, char *argv
[]) {
16 _cleanup_(notify_on_cleanup
) const char *notify_stop
= NULL
;
17 _cleanup_(manager_freep
) Manager
*m
= NULL
;
22 r
= service_parse_argv("systemd-homed.service",
23 "A service to create, remove, change or inspect home areas.",
24 BUS_IMPLEMENTATIONS(&manager_object
,
32 if (setenv("SYSTEMD_BYPASS_USERDB", "io.systemd.Home", 1) < 0)
33 return log_error_errno(SYNTHETIC_ERRNO(EINVAL
), "Failed to set $SYSTEMD_BYPASS_USERDB: %m");
35 assert_se(sigprocmask_many(SIG_BLOCK
, NULL
, SIGCHLD
, SIGTERM
, SIGINT
, -1) >= 0);
39 return log_error_errno(r
, "Could not create manager: %m");
41 r
= manager_startup(m
);
43 return log_error_errno(r
, "Failed to start up daemon: %m");
45 notify_stop
= notify_start(NOTIFY_READY
, NOTIFY_STOPPING
);
47 r
= sd_event_loop(m
->event
);
49 return log_error_errno(r
, "Event loop failed: %m");
54 DEFINE_MAIN_FUNCTION(run
);