chiark / gitweb /
job: info message if JOB_VERIFY_ACTIVE detects an inactive unit
[elogind.git] / src / core / manager.c
index a6013668b8a8221997cf92cda3f3430e506f4758..bd86f89d53fd722abcbac968b54465b44615eade 100644 (file)
@@ -65,6 +65,7 @@
 #include "virt.h"
 #include "watchdog.h"
 #include "cgroup-util.h"
+#include "path-util.h"
 
 /* As soon as 16 units are in our GC queue, make sure to run a gc sweep */
 #define GC_QUEUE_ENTRIES_MAX 16
@@ -521,6 +522,9 @@ void manager_free(Manager *m) {
 
         close_pipe(m->idle_pipe);
 
+        free(m->switch_root);
+        free(m->switch_root_init);
+
         free(m);
 }
 
@@ -678,6 +682,8 @@ int manager_add_job(Manager *m, JobType type, Unit *unit, JobMode mode, bool ove
 
         log_debug("Trying to enqueue job %s/%s/%s", unit->id, job_type_to_string(type), job_mode_to_string(mode));
 
+        job_type_collapse(&type, unit);
+
         tr = transaction_new();
         if (!tr)
                 return -ENOMEM;
@@ -783,7 +789,7 @@ int manager_load_unit_prepare(Manager *m, const char *name, const char *path, DB
         }
 
         if (!name)
-                name = file_name_from_path(path);
+                name = path_get_file_name(path);
 
         t = unit_name_to_type(name);