]>
git.ipfire.org Git - people/ms/systemd.git/blob - main.c
eb659c79fb77549c6c48127f90ac8ee35ec28e0a
1 /*-*- Mode: C; c-basic-offset: 8 -*-*/
13 int main(int argc
, char *argv
[]) {
19 assert_se(set_unit_path("test1") >= 0);
21 if (!(m
= manager_new())) {
22 log_error("Failed to allocate manager object: %s", strerror(ENOMEM
));
26 if ((r
= manager_coldplug(m
)) < 0) {
27 log_error("Failed to retrieve coldplug information: %s", strerror(-r
));
31 if ((r
= manager_load_unit(m
, SPECIAL_DEFAULT_TARGET
, &target
)) < 0) {
32 log_error("Failed to load default target: %s", strerror(-r
));
36 printf("→ By units:\n");
37 manager_dump_units(m
, stdout
, "\t");
39 if ((r
= manager_add_job(m
, JOB_START
, target
, JOB_REPLACE
, false, &job
)) < 0) {
40 log_error("Failed to start default target: %s", strerror(-r
));
44 printf("→ By jobs:\n");
45 manager_dump_jobs(m
, stdout
, "\t");
47 if ((r
= manager_loop(m
)) < 0) {
48 log_error("Failed to run mainloop: %s", strerror(-r
));