]> err.no Git - systemd/commitdiff
swap: expose swap exec env proprties via dbus
authorLennart Poettering <lennart@poettering.net>
Tue, 26 Oct 2010 20:05:52 +0000 (22:05 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 26 Oct 2010 20:05:52 +0000 (22:05 +0200)
TODO
src/dbus-mount.c
src/dbus-swap.c

diff --git a/TODO b/TODO
index 45ef095d6365b7fe45b4b0c14b686812edf01e02..50ad9fa1df5aa6171e18896c358d7cd6eb1ecc07 100644 (file)
--- a/TODO
+++ b/TODO
@@ -80,7 +80,7 @@
 
 * make description of .swap files nicer: resolve /dev/by-uuid/ symlink
 
-* systemctl status getty@tty1.service
+* only add quotacheck deps t .mount units which mention grpquota/usrquota in the mount flags
 
 External:
 
index 92d74cb92ff40873e59b599929d7902cba991912..4de00f7fac38d3b73614d53eb19e021d6e23e014 100644 (file)
@@ -137,16 +137,16 @@ static int bus_mount_append_type(Manager *n, DBusMessageIter *i, const char *pro
 DBusHandlerResult bus_mount_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
         const BusProperty properties[] = {
                 BUS_UNIT_PROPERTIES,
-                { "org.freedesktop.systemd1.Mount", "Where",         bus_property_append_string, "s", u->mount.where         },
-                { "org.freedesktop.systemd1.Mount", "What",          bus_mount_append_what,      "s", u                      },
-                { "org.freedesktop.systemd1.Mount", "Options",       bus_mount_append_options,   "s", u                      },
-                { "org.freedesktop.systemd1.Mount", "Type",          bus_mount_append_type,      "s", u                      },
-                { "org.freedesktop.systemd1.Mount", "TimeoutUSec",   bus_property_append_usec,   "t", &u->mount.timeout_usec },
+                { "org.freedesktop.systemd1.Mount", "Where",         bus_property_append_string, "s", u->mount.where           },
+                { "org.freedesktop.systemd1.Mount", "What",          bus_mount_append_what,      "s", u                        },
+                { "org.freedesktop.systemd1.Mount", "Options",       bus_mount_append_options,   "s", u                        },
+                { "org.freedesktop.systemd1.Mount", "Type",          bus_mount_append_type,      "s", u                        },
+                { "org.freedesktop.systemd1.Mount", "TimeoutUSec",   bus_property_append_usec,   "t", &u->mount.timeout_usec   },
                 BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Mount", u->mount.exec_command+MOUNT_EXEC_MOUNT,   "ExecMount"),
                 BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Mount", u->mount.exec_command+MOUNT_EXEC_UNMOUNT, "ExecUnmount"),
                 BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Mount", u->mount.exec_command+MOUNT_EXEC_REMOUNT, "ExecRemount"),
                 BUS_EXEC_CONTEXT_PROPERTIES("org.freedesktop.systemd1.Mount", u->mount.exec_context),
-                { "org.freedesktop.systemd1.Mount", "ControlPID",    bus_property_append_pid,    "u", &u->mount.control_pid  },
+                { "org.freedesktop.systemd1.Mount", "ControlPID",    bus_property_append_pid,    "u", &u->mount.control_pid    },
                 { "org.freedesktop.systemd1.Mount", "DirectoryMode", bus_property_append_mode,   "u", &u->mount.directory_mode },
                 { NULL, NULL, NULL, NULL, NULL }
         };
index c345d4bc7dae9f6f1625afd0de51c025ba673549..70cccdcab8f41e379b0c3ee627383613f9227a2d 100644 (file)
 
 #include "dbus-unit.h"
 #include "dbus-swap.h"
+#include "dbus-execute.h"
 
 #define BUS_SWAP_INTERFACE                                              \
         " <interface name=\"org.freedesktop.systemd1.Swap\">\n"         \
         "  <property name=\"What\" type=\"s\" access=\"read\"/>\n"      \
         "  <property name=\"Priority\" type=\"i\" access=\"read\"/>\n"  \
+        "  <property name=\"TimeoutUSec\" type=\"t\" access=\"read\"/>\n" \
+        BUS_EXEC_COMMAND_INTERFACE("ExecActivate")                      \
+        BUS_EXEC_COMMAND_INTERFACE("ExecDeactivate")                    \
+        BUS_EXEC_CONTEXT_INTERFACE                                      \
+        "  <property name=\"ControlPID\" type=\"u\" access=\"read\"/>\n" \
         " </interface>\n"
 
 #define INTROSPECTION                                                   \
@@ -46,6 +52,9 @@ const char bus_swap_interface[] = BUS_SWAP_INTERFACE;
 const char bus_swap_invalidating_properties[] =
         "What\0"
         "Priority\0"
+        "ExecActivate\0"
+        "ExecDeactivate\0"
+        "ControlPID\0"
         "\0";
 
 static int bus_swap_append_priority(Manager *m, DBusMessageIter *i, const char *property, void *data) {
@@ -75,8 +84,12 @@ static int bus_swap_append_priority(Manager *m, DBusMessageIter *i, const char *
 DBusHandlerResult bus_swap_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
         const BusProperty properties[] = {
                 BUS_UNIT_PROPERTIES,
-                { "org.freedesktop.systemd1.Swap", "What",     bus_property_append_string, "s", u->swap.what },
-                { "org.freedesktop.systemd1.Swap", "Priority", bus_swap_append_priority,   "i", u            },
+                { "org.freedesktop.systemd1.Swap", "What",       bus_property_append_string, "s", u->swap.what          },
+                { "org.freedesktop.systemd1.Swap", "Priority",   bus_swap_append_priority,   "i", u                     },
+                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Swap", u->swap.exec_command+SWAP_EXEC_ACTIVATE,   "ExecActivate"),
+                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Swap", u->swap.exec_command+SWAP_EXEC_DEACTIVATE, "ExecDeactivate"),
+                BUS_EXEC_CONTEXT_PROPERTIES("org.freedesktop.systemd1.Swap", u->swap.exec_context),
+                { "org.freedesktop.systemd1.Swap", "ControlPID", bus_property_append_pid,    "u", &u->swap.control_pid },
                 { NULL, NULL, NULL, NULL, NULL }
         };