1 /*-*- Mode: C; c-basic-offset: 8 -*-*/
11 int main(int argc, char *argv[]) {
17 assert_se(set_unit_path("test1") >= 0);
19 if (!(m = manager_new()) < 0) {
20 log_error("Failed to allocate manager object: %s", strerror(ENOMEM));
24 if ((r = manager_coldplug(m)) < 0) {
25 log_error("Failed to retrieve coldplug information: %s", strerror(-r));
29 if ((r = manager_load_unit(m, SPECIAL_DEFAULT_TARGET, &target)) < 0) {
30 log_error("Failed to load default target: %s", strerror(-r));
34 printf("→ By units:\n");
35 manager_dump_units(m, stdout, "\t");
37 if ((r = manager_add_job(m, JOB_START, target, JOB_REPLACE, false, &job)) < 0) {
38 log_error("Failed to start default target: %s", strerror(-r));
42 printf("→ By jobs:\n");
43 manager_dump_jobs(m, stdout, "\t");
45 if ((r = manager_loop(m)) < 0) {
46 log_error("Failed to run mainloop: %s", strerror(-r));