chiark / gitweb /
unit: unit type dependent status messages
[elogind.git] / src / core / swap.c
index 3881d2831f8469dc21d6dedf711f5c9ab0de2ba0..ba4413bd3ccc76659c9c7f0e9e49d043b1cea637 100644 (file)
@@ -38,6 +38,7 @@
 #include "bus-errors.h"
 #include "exit-status.h"
 #include "def.h"
+#include "path-util.h"
 
 static const UnitActiveState state_translation_table[_SWAP_STATE_MAX] = {
         [SWAP_DEAD] = UNIT_INACTIVE,
@@ -1377,7 +1378,6 @@ const UnitVTable swap_vtable = {
 
         .no_alias = true,
         .no_instances = true,
-        .show_status = true,
 
         .init = swap_init,
         .load = swap_load,
@@ -1413,5 +1413,23 @@ const UnitVTable swap_vtable = {
         .following_set = swap_following_set,
 
         .enumerate = swap_enumerate,
-        .shutdown = swap_shutdown
+        .shutdown = swap_shutdown,
+
+        .status_message_formats = {
+                .starting_stopping = {
+                        [0] = "Activating swap %s...",
+                        [1] = "Deactivating swap %s...",
+                },
+                .finished_start_job = {
+                        [JOB_DONE]       = "Activated swap %s.",
+                        [JOB_FAILED]     = "Failed to activate swap %s.",
+                        [JOB_DEPENDENCY] = "Dependency failed for %s.",
+                        [JOB_TIMEOUT]    = "Timed out activating swap %s.",
+                },
+                .finished_stop_job = {
+                        [JOB_DONE]       = "Deactivated swap %s.",
+                        [JOB_FAILED]     = "Failed deactivating swap %s.",
+                        [JOB_TIMEOUT]    = "Timed out deactivating swap %s.",
+                },
+        },
 };