[systemd-commits] 7 commits - dbus-unit.c dbus-unit.h swap.c systemadm.vala systemd-interfaces.vala unit.c util.c util.h

Lennart Poettering lennart at kemper.freedesktop.org
Sun May 16 09:14:43 PDT 2010


 dbus-unit.c             |   19 +++++
 dbus-unit.h             |   59 ++++++++++++------
 swap.c                  |    3 
 systemadm.vala          |  157 +++++++++++++++++++++++++++++++++++++++---------
 systemd-interfaces.vala |   16 ++++
 unit.c                  |    2 
 util.c                  |   10 +++
 util.h                  |    2 
 8 files changed, 219 insertions(+), 49 deletions(-)

New commits:
commit 3ff467472ee1167f75d8fd60544df8872c63c116
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sun May 16 18:14:35 2010 +0200

    systemadm: show details for a unit after loading it

diff --git a/systemadm.vala b/systemadm.vala
index 83d6f8f..bd0062a 100644
--- a/systemadm.vala
+++ b/systemadm.vala
@@ -885,6 +885,7 @@ public class MainWindow : Window {
                         m.run();
                         m.destroy();
 
+                        show_unit(u);
                 } catch (DBus.Error e) {
                         show_error(e.message);
                 }
commit f58eedd538b3a138814a54b94b0c2c89ef727d82
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sun May 16 18:14:17 2010 +0200

    systemadm: show in window title whether we inspect the session or the system bus

diff --git a/systemadm.vala b/systemadm.vala
index de2fa3a..83d6f8f 100644
--- a/systemadm.vala
+++ b/systemadm.vala
@@ -103,7 +103,7 @@ public class MainWindow : Window {
         private ComboBox unit_type_combo_box;
 
         public MainWindow() throws DBus.Error {
-                title = "systemadm";
+                title = session ? "systemd Session Manager" : "systemd System Manager";
                 position = WindowPosition.CENTER;
                 set_default_size(1000, 700);
                 set_border_width(12);
commit 8407a5d0183d9513349754f1eac86e2fdec8bd76
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sun May 16 18:13:58 2010 +0200

    swap: don't add mount links for swap devices

diff --git a/swap.c b/swap.c
index 174ce1d..bd49e1e 100644
--- a/swap.c
+++ b/swap.c
@@ -70,6 +70,9 @@ int swap_add_one_mount_link(Swap *s, Mount *m) {
             m->meta.load_state != UNIT_LOADED)
                 return 0;
 
+        if (is_device_path(s->what))
+                return 0;
+
         if (!path_startswith(s->what, m->where))
                 return 0;
 
diff --git a/unit.c b/unit.c
index ee0c120..1959b1b 100644
--- a/unit.c
+++ b/unit.c
@@ -1864,7 +1864,7 @@ int unit_add_node_link(Unit *u, const char *what, bool wants) {
 
         /* Adds in links to the device node that this unit is based on */
 
-        if (!path_startswith(what, "/dev/") && !path_startswith(what, "/sys/"))
+        if (!is_device_path(what))
                 return 0;
 
         if (!(e = unit_name_build_escape(what+1, NULL, ".device")))
diff --git a/util.c b/util.c
index 5e3654d..f7d538a 100644
--- a/util.c
+++ b/util.c
@@ -1927,6 +1927,16 @@ bool is_clean_exit(int code, int status) {
         return false;
 }
 
+bool is_device_path(const char *path) {
+
+        /* Returns true on paths that refer to a device, either in
+         * sysfs or in /dev */
+
+        return
+                path_startswith(path, "/dev/") ||
+                path_startswith(path, "/sys/");
+}
+
 static const char *const ioprio_class_table[] = {
         [IOPRIO_CLASS_NONE] = "none",
         [IOPRIO_CLASS_RT] = "realtime",
diff --git a/util.h b/util.h
index d0fc319..a77a952 100644
--- a/util.h
+++ b/util.h
@@ -231,6 +231,8 @@ ssize_t loop_read(int fd, void *buf, size_t nbytes);
 
 int path_is_mount_point(const char *path);
 
+bool is_device_path(const char *path);
+
 extern char * __progname;
 
 const char *ioprio_class_to_string(int i);
commit d4e6a6f66b7b3c797a1446816b8512d82c92278f
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sun May 16 18:02:41 2010 +0200

    systemadm: show dependencies in the UI

diff --git a/systemadm.vala b/systemadm.vala
index c5c90b3..de2fa3a 100644
--- a/systemadm.vala
+++ b/systemadm.vala
@@ -47,6 +47,13 @@ public class RightLabel : Label {
                 else
                         set_text(text);
         }
+
+        public void set_markup_or_na(string? text = null) {
+                if (text == null || text == "")
+                        set_markup("<i>n/a</i>");
+                else
+                        set_markup(text);
+        }
 }
 
 public class MainWindow : Window {
@@ -77,6 +84,7 @@ public class MainWindow : Window {
 
         private RightLabel unit_id_label;
         private RightLabel unit_aliases_label;
+        private RightLabel unit_dependency_label;
         private RightLabel unit_description_label;
         private RightLabel unit_load_state_label;
         private RightLabel unit_active_state_label;
@@ -189,6 +197,7 @@ public class MainWindow : Window {
 
                 unit_id_label = new RightLabel();
                 unit_aliases_label = new RightLabel();
+                unit_dependency_label = new RightLabel();
                 unit_description_label = new RightLabel();
                 unit_load_state_label = new RightLabel();
                 unit_active_state_label = new RightLabel();
@@ -204,6 +213,10 @@ public class MainWindow : Window {
                 job_state_label = new RightLabel();
                 job_type_label = new RightLabel();
 
+                unit_dependency_label.set_track_visited_links(false);
+                unit_dependency_label.set_selectable(false);
+                unit_dependency_label.activate_link += on_activate_link;
+
                 Table unit_table = new Table(8, 6, false);
                 unit_table.set_row_spacings(6);
                 unit_table.set_border_width(0);
@@ -220,27 +233,29 @@ public class MainWindow : Window {
                 unit_table.attach(unit_aliases_label,                       1, 6, 1, 2, AttachOptions.EXPAND|AttachOptions.FILL, AttachOptions.FILL, 0, 0);
                 unit_table.attach(new LeftLabel("Description:"),            0, 1, 2, 3, AttachOptions.FILL, AttachOptions.FILL, 0, 0);
                 unit_table.attach(unit_description_label,                   1, 6, 2, 3, AttachOptions.EXPAND|AttachOptions.FILL, AttachOptions.FILL, 0, 0);
-                unit_table.attach(new LeftLabel("Fragment Path:"),          0, 1, 3, 4, AttachOptions.FILL, AttachOptions.FILL, 0, 0);
-                unit_table.attach(unit_fragment_path_label,                 1, 6, 3, 4, AttachOptions.EXPAND|AttachOptions.FILL, AttachOptions.FILL, 0, 0);
-                unit_table.attach(new LeftLabel("Control Group:"),          0, 1, 4, 5, AttachOptions.FILL, AttachOptions.FILL, 0, 0);
-                unit_table.attach(unit_cgroup_label,                        1, 6, 4, 5, AttachOptions.EXPAND|AttachOptions.FILL, AttachOptions.FILL, 0, 0);
-
-                unit_table.attach(new LeftLabel("Load State:"),             0, 1, 5, 6, AttachOptions.FILL, AttachOptions.FILL, 0, 0);
-                unit_table.attach(unit_load_state_label,                    1, 2, 5, 6, AttachOptions.EXPAND|AttachOptions.FILL, AttachOptions.FILL, 0, 0);
-                unit_table.attach(new LeftLabel("Active State:"),           0, 1, 6, 7, AttachOptions.FILL, AttachOptions.FILL, 0, 0);
-                unit_table.attach(unit_active_state_label,                  1, 2, 6, 7, AttachOptions.EXPAND|AttachOptions.FILL, AttachOptions.FILL, 0, 0);
-                unit_table.attach(new LeftLabel("Unit State:"),             0, 1, 7, 8, AttachOptions.FILL, AttachOptions.FILL, 0, 0);
-                unit_table.attach(unit_sub_state_label,                     1, 2, 7, 8, AttachOptions.EXPAND|AttachOptions.FILL, AttachOptions.FILL, 0, 0);
-
-                unit_table.attach(new LeftLabel("Active Enter Timestamp:"), 2, 3, 6, 7, AttachOptions.FILL, AttachOptions.FILL, 0, 0);
-                unit_table.attach(unit_active_enter_timestamp_label,        3, 4, 6, 7, AttachOptions.EXPAND|AttachOptions.FILL, AttachOptions.FILL, 0, 0);
-                unit_table.attach(new LeftLabel("Active Exit Timestamp:"),  2, 3, 7, 8, AttachOptions.FILL, AttachOptions.FILL, 0, 0);
-                unit_table.attach(unit_active_exit_timestamp_label,         3, 4, 7, 8, AttachOptions.EXPAND|AttachOptions.FILL, AttachOptions.FILL, 0, 0);
-
-                unit_table.attach(new LeftLabel("Can Start/Stop:"),         4, 5, 6, 7, AttachOptions.FILL, AttachOptions.FILL, 0, 0);
-                unit_table.attach(unit_can_start_label,                     5, 6, 6, 7, AttachOptions.EXPAND|AttachOptions.FILL, AttachOptions.FILL, 0, 0);
-                unit_table.attach(new LeftLabel("Can Reload:"),             4, 5, 7, 8, AttachOptions.FILL, AttachOptions.FILL, 0, 0);
-                unit_table.attach(unit_can_reload_label,                    5, 6, 7, 8, AttachOptions.EXPAND|AttachOptions.FILL, AttachOptions.FILL, 0, 0);
+                unit_table.attach(new LeftLabel("Dependencies:"),           0, 1, 3, 4, AttachOptions.FILL, AttachOptions.FILL, 0, 0);
+                unit_table.attach(unit_dependency_label,                    1, 6, 3, 4, AttachOptions.EXPAND|AttachOptions.FILL, AttachOptions.FILL, 0, 0);
+                unit_table.attach(new LeftLabel("Fragment Path:"),          0, 1, 4, 5, AttachOptions.FILL, AttachOptions.FILL, 0, 0);
+                unit_table.attach(unit_fragment_path_label,                 1, 6, 4, 5, AttachOptions.EXPAND|AttachOptions.FILL, AttachOptions.FILL, 0, 0);
+                unit_table.attach(new LeftLabel("Control Group:"),          0, 1, 5, 6, AttachOptions.FILL, AttachOptions.FILL, 0, 0);
+                unit_table.attach(unit_cgroup_label,                        1, 6, 5, 6, AttachOptions.EXPAND|AttachOptions.FILL, AttachOptions.FILL, 0, 0);
+
+                unit_table.attach(new LeftLabel("Load State:"),             0, 1, 6, 7, AttachOptions.FILL, AttachOptions.FILL, 0, 0);
+                unit_table.attach(unit_load_state_label,                    1, 2, 6, 7, AttachOptions.EXPAND|AttachOptions.FILL, AttachOptions.FILL, 0, 0);
+                unit_table.attach(new LeftLabel("Active State:"),           0, 1, 7, 8, AttachOptions.FILL, AttachOptions.FILL, 0, 0);
+                unit_table.attach(unit_active_state_label,                  1, 2, 7, 8, AttachOptions.EXPAND|AttachOptions.FILL, AttachOptions.FILL, 0, 0);
+                unit_table.attach(new LeftLabel("Unit State:"),             0, 1, 8, 9, AttachOptions.FILL, AttachOptions.FILL, 0, 0);
+                unit_table.attach(unit_sub_state_label,                     1, 2, 8, 9, AttachOptions.EXPAND|AttachOptions.FILL, AttachOptions.FILL, 0, 0);
+
+                unit_table.attach(new LeftLabel("Active Enter Timestamp:"), 2, 3, 7, 8, AttachOptions.FILL, AttachOptions.FILL, 0, 0);
+                unit_table.attach(unit_active_enter_timestamp_label,        3, 4, 7, 8, AttachOptions.EXPAND|AttachOptions.FILL, AttachOptions.FILL, 0, 0);
+                unit_table.attach(new LeftLabel("Active Exit Timestamp:"),  2, 3, 8, 9, AttachOptions.FILL, AttachOptions.FILL, 0, 0);
+                unit_table.attach(unit_active_exit_timestamp_label,         3, 4, 8, 9, AttachOptions.EXPAND|AttachOptions.FILL, AttachOptions.FILL, 0, 0);
+
+                unit_table.attach(new LeftLabel("Can Start/Stop:"),         4, 5, 7, 8, AttachOptions.FILL, AttachOptions.FILL, 0, 0);
+                unit_table.attach(unit_can_start_label,                     5, 6, 7, 8, AttachOptions.EXPAND|AttachOptions.FILL, AttachOptions.FILL, 0, 0);
+                unit_table.attach(new LeftLabel("Can Reload:"),             4, 5, 8, 9, AttachOptions.FILL, AttachOptions.FILL, 0, 0);
+                unit_table.attach(unit_can_reload_label,                    5, 6, 8, 9, AttachOptions.EXPAND|AttachOptions.FILL, AttachOptions.FILL, 0, 0);
 
                 job_table.attach(new LeftLabel("Id:"),                      0, 1, 0, 1, AttachOptions.FILL, AttachOptions.FILL, 0, 0);
                 job_table.attach(job_id_label,                              1, 2, 0, 1, AttachOptions.EXPAND|AttachOptions.FILL, AttachOptions.FILL, 0, 0);
@@ -390,6 +405,7 @@ public class MainWindow : Window {
                 unit_id_label.set_text_or_na();
                 unit_aliases_label.set_text_or_na();
                 unit_description_label.set_text_or_na();
+                unit_description_label.set_text_or_na();
                 unit_load_state_label.set_text_or_na();
                 unit_active_state_label.set_text_or_na();
                 unit_sub_state_label.set_text_or_na();
@@ -401,6 +417,30 @@ public class MainWindow : Window {
                 unit_cgroup_label.set_text_or_na();
         }
 
+        public string make_dependency_string(string? prefix, string word, string[] dependencies) {
+                bool first = true;
+                string r;
+
+                if (prefix == null)
+                        r = "";
+                else
+                        r = prefix;
+
+                foreach (string i in dependencies) {
+                        if (r != "")
+                                r += first ? "\n" : ",";
+
+                        if (first) {
+                                r += word;
+                                first = false;
+                        }
+
+                        r += " <a href=\"" + i + "\">" + i + "</a>";
+                }
+
+                return r;
+        }
+
         public void show_unit(Unit unit) {
                 current_unit_id = unit.id;
 
@@ -418,6 +458,44 @@ public class MainWindow : Window {
                 }
 
                 unit_aliases_label.set_text_or_na(a);
+
+                string[]
+                        requires = unit.requires,
+                        requires_overridable = unit.requires_overridable,
+                        requisite = unit.requisite,
+                        requisite_overridable = unit.requisite_overridable,
+                        wants = unit.wants,
+                        required_by = unit.required_by,
+                        required_by_overridable = unit.required_by_overridable,
+                        wanted_by = unit.wanted_by,
+                        conflicts = unit.conflicts,
+                        before = unit.before,
+                        after = unit.after;
+
+                unit_dependency_label.set_markup_or_na(
+                                make_dependency_string(
+                                make_dependency_string(
+                                make_dependency_string(
+                                make_dependency_string(
+                                make_dependency_string(
+                                make_dependency_string(
+                                make_dependency_string(
+                                make_dependency_string(
+                                make_dependency_string(
+                                make_dependency_string(
+                                make_dependency_string(null,
+                                "requires", requires),
+                                "overridable requires", requires_overridable),
+                                "requisite", requisite),
+                                "overridable requisite", requisite_overridable),
+                                "wants", wants),
+                                "conflicts", conflicts),
+                                "required by", required_by),
+                                "overridable required by", required_by_overridable),
+                                "wanted by", wanted_by),
+                                "after", after),
+                                "before", before));
+
                 unit_description_label.set_text_or_na(unit.description);
                 unit_load_state_label.set_text_or_na(unit.load_state);
                 unit_active_state_label.set_text_or_na(unit.active_state);
@@ -816,6 +894,24 @@ public class MainWindow : Window {
                 unit_load_button.set_sensitive(unit_load_entry.get_text() != "");
         }
 
+        public bool on_activate_link(string uri) {
+
+                try {
+                        string path = manager.get_unit(uri);
+
+                        Unit u = bus.get_object(
+                                        "org.freedesktop.systemd1",
+                                        path,
+                                        "org.freedesktop.systemd1.Unit") as Unit;
+
+                        show_unit(u);
+                } catch (DBus.Error e) {
+                        show_error(e.message);
+                }
+
+                return true;
+        }
+
         public void show_error(string e) {
                 var m = new MessageDialog(this,
                                           DialogFlags.DESTROY_WITH_PARENT,
diff --git a/systemd-interfaces.vala b/systemd-interfaces.vala
index 72655d6..7282bf3 100644
--- a/systemd-interfaces.vala
+++ b/systemd-interfaces.vala
@@ -83,6 +83,17 @@ public interface Unit : DBus.Object {
 
         public abstract string id { owned get; }
         public abstract string[] names { owned get; }
+        public abstract string[] requires { owned get; }
+        public abstract string[] requires_overridable { owned get; }
+        public abstract string[] requisite { owned get; }
+        public abstract string[] requisite_overridable { owned get; }
+        public abstract string[] wants { owned get; }
+        public abstract string[] required_by { owned get; }
+        public abstract string[] required_by_overridable { owned get; }
+        public abstract string[] wanted_by { owned get; }
+        public abstract string[] conflicts { owned get; }
+        public abstract string[] before { owned get; }
+        public abstract string[] after { owned get; }
         public abstract string description { owned get; }
         public abstract string load_state { owned get; }
         public abstract string active_state { owned get; }
@@ -94,10 +105,11 @@ public interface Unit : DBus.Object {
         public abstract uint64 inactive_enter_timestamp { owned get; }
         public abstract bool can_start { owned get; }
         public abstract bool can_reload { owned get; }
-        public abstract JobLink job { owned get; /* FIXME: this setter is a temporary fix to make valac not segfault */ set; }
+        public abstract JobLink job { owned get; }
         public abstract bool recursive_stop { owned get; }
         public abstract bool stop_when_unneeded { owned get; }
         public abstract string default_control_group { owned get; }
+        public abstract string[] control_groups { owned get; }
 
         public abstract ObjectPath start(string mode) throws DBus.Error;
         public abstract ObjectPath stop(string mode) throws DBus.Error;
@@ -117,7 +129,7 @@ public interface Job : DBus.Object {
         public abstract uint32 id { owned get; }
         public abstract string state { owned get; }
         public abstract string job_type { owned get; }
-        public abstract UnitLink unit { owned get; /* FIXME: this setter is a temporary fix to make valac not segfault */ set; }
+        public abstract UnitLink unit { owned get; }
 
         public abstract void cancel() throws DBus.Error;
 
commit 92aa6f363360cbb4e300648e5cbdb6fe4cce1b57
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sun May 16 16:21:08 2010 +0200

    systemadm: ignore entry activation on empty string

diff --git a/systemadm.vala b/systemadm.vala
index ac4c19e..c5c90b3 100644
--- a/systemadm.vala
+++ b/systemadm.vala
@@ -785,8 +785,13 @@ public class MainWindow : Window {
         }
 
         public void on_unit_load() {
+                string t = unit_load_entry.get_text();
+
+                if (t == "")
+                        return;
+
                 try {
-                        var path = manager.load_unit(unit_load_entry.get_text());
+                        var path = manager.load_unit(t);
 
                         Unit u = bus.get_object(
                                         "org.freedesktop.systemd1",
commit 416f4a8457da80453dd69e67753a0190d6ec26d5
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sun May 16 16:20:51 2010 +0200

    systemadm: add space to both sides of the unit load entry box

diff --git a/systemadm.vala b/systemadm.vala
index b5985fa..ac4c19e 100644
--- a/systemadm.vala
+++ b/systemadm.vala
@@ -137,9 +137,9 @@ public class MainWindow : Window {
                 unit_load_entry.activate += on_unit_load;
                 unit_load_button.clicked += on_unit_load;
 
-                Gtk.Alignment unit_load_button_alignment = new Gtk.Alignment(0.5f, 0.5f, 1f, 1f);
-                unit_load_button_alignment.right_padding = 24;
-                unit_load_button_alignment.add(unit_load_button);
+                Box unit_load_hbox = new HBox(false, 6);
+                unit_load_hbox.pack_start(unit_load_entry, false, true, 0);
+                unit_load_hbox.pack_start(unit_load_button, false, true, 0);
 
                 server_snapshot_button = new Button.with_mnemonic("Take S_napshot");
                 server_reload_button = new Button.with_mnemonic("Reload _Configuration");
@@ -149,8 +149,7 @@ public class MainWindow : Window {
 
                 type_hbox.pack_end(server_snapshot_button, false, true, 0);
                 type_hbox.pack_end(server_reload_button, false, true, 0);
-                type_hbox.pack_end(unit_load_button_alignment, false, true, 0);
-                type_hbox.pack_end(unit_load_entry, false, true, 0);
+                type_hbox.pack_end(unit_load_hbox, false, true, 24);
 
                 unit_model = new ListStore(7, typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(Unit));
                 job_model = new ListStore(6, typeof(string), typeof(string), typeof(string), typeof(string), typeof(Job), typeof(uint32));
commit 5301be81d094129232becb2a087f8db4967d1fc6
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sun May 16 16:20:24 2010 +0200

    dbus: expoose unit dependencies

diff --git a/dbus-unit.c b/dbus-unit.c
index 0c311ea..e3e1be1 100644
--- a/dbus-unit.c
+++ b/dbus-unit.c
@@ -44,6 +44,25 @@ int bus_unit_append_names(Manager *m, DBusMessageIter *i, const char *property,
         return 0;
 }
 
+int bus_unit_append_dependencies(Manager *m, DBusMessageIter *i, const char *property, void *data) {
+        Unit *u;
+        Iterator j;
+        DBusMessageIter sub;
+        Set *s = data;
+
+        if (!dbus_message_iter_open_container(i, DBUS_TYPE_ARRAY, "s", &sub))
+                return -ENOMEM;
+
+        SET_FOREACH(u, s, j)
+                if (!dbus_message_iter_append_basic(&sub, DBUS_TYPE_STRING, &u->meta.id))
+                        return -ENOMEM;
+
+        if (!dbus_message_iter_close_container(i, &sub))
+                return -ENOMEM;
+
+        return 0;
+}
+
 int bus_unit_append_description(Manager *m, DBusMessageIter *i, const char *property, void *data) {
         Unit *u = data;
         const char *d;
diff --git a/dbus-unit.h b/dbus-unit.h
index db1716e..c5840d5 100644
--- a/dbus-unit.h
+++ b/dbus-unit.h
@@ -47,6 +47,17 @@
         "  <signal name=\"Changed\"/>"                                  \
         "  <property name=\"Id\" type=\"s\" access=\"read\"/>"          \
         "  <property name=\"Names\" type=\"as\" access=\"read\"/>"      \
+        "  <property name=\"Requires\" type=\"as\" access=\"read\"/>"   \
+        "  <property name=\"RequiresOverridable\" type=\"as\" access=\"read\"/>" \
+        "  <property name=\"Requisite\" type=\"as\" access=\"read\"/>"  \
+        "  <property name=\"RequisiteOverridable\" type=\"as\" access=\"read\"/>" \
+        "  <property name=\"Wants\" type=\"as\" access=\"read\"/>"      \
+        "  <property name=\"RequiredBy\" type=\"as\" access=\"read\"/>" \
+        "  <property name=\"RequiredByOverridable\" type=\"as\" access=\"read\"/>" \
+        "  <property name=\"WantedBy\" type=\"as\" access=\"read\"/>"   \
+        "  <property name=\"Conflicts\" type=\"as\" access=\"read\"/>"  \
+        "  <property name=\"Before\" type=\"as\" access=\"read\"/>"     \
+        "  <property name=\"After\" type=\"as\" access=\"read\"/>"      \
         "  <property name=\"Description\" type=\"s\" access=\"read\"/>" \
         "  <property name=\"LoadState\" type=\"s\" access=\"read\"/>"   \
         "  <property name=\"ActiveState\" type=\"s\" access=\"read\"/>" \
@@ -66,26 +77,38 @@
         " </interface>"
 
 #define BUS_UNIT_PROPERTIES \
-        { "org.freedesktop.systemd1.Unit", "Id",                   bus_property_append_string,     "s",    u->meta.id                      }, \
-        { "org.freedesktop.systemd1.Unit", "Names",                bus_unit_append_names,          "as",   u                               }, \
-        { "org.freedesktop.systemd1.Unit", "Description",          bus_unit_append_description,    "s",    u                               }, \
-        { "org.freedesktop.systemd1.Unit", "LoadState",            bus_unit_append_load_state,     "s",    &u->meta.load_state             }, \
-        { "org.freedesktop.systemd1.Unit", "ActiveState",          bus_unit_append_active_state,   "s",    u                               }, \
-        { "org.freedesktop.systemd1.Unit", "SubState",             bus_unit_append_sub_state,      "s",    u                               }, \
-        { "org.freedesktop.systemd1.Unit", "FragmentPath",         bus_property_append_string,     "s",    u->meta.fragment_path           }, \
-        { "org.freedesktop.systemd1.Unit", "InactiveExitTimestamp",bus_property_append_uint64,     "t",    &u->meta.inactive_exit_timestamp}, \
-        { "org.freedesktop.systemd1.Unit", "ActiveEnterTimestamp", bus_property_append_uint64,     "t",    &u->meta.active_enter_timestamp }, \
-        { "org.freedesktop.systemd1.Unit", "ActiveExitTimestamp",  bus_property_append_uint64,     "t",    &u->meta.active_exit_timestamp  }, \
-        { "org.freedesktop.systemd1.Unit", "InActiveEnterTimestamp",bus_property_append_uint64,    "t",    &u->meta.inactive_enter_timestamp}, \
-        { "org.freedesktop.systemd1.Unit", "CanStart",             bus_unit_append_can_start,      "b",    u                               }, \
-        { "org.freedesktop.systemd1.Unit", "CanReload",            bus_unit_append_can_reload,     "b",    u                               }, \
-        { "org.freedesktop.systemd1.Unit", "Job",                  bus_unit_append_job,            "(uo)", u                               }, \
-        { "org.freedesktop.systemd1.Unit", "RecursiveStop",        bus_property_append_bool,       "b",    &u->meta.recursive_stop         }, \
-        { "org.freedesktop.systemd1.Unit", "StopWhenUneeded",      bus_property_append_bool,       "b",    &u->meta.stop_when_unneeded     }, \
-        { "org.freedesktop.systemd1.Unit", "DefaultControlGroup",  bus_unit_append_default_cgroup, "s",    u                               }, \
-        { "org.freedesktop.systemd1.Unit", "ControlGroups",        bus_unit_append_cgroups,        "as",   u                               }
+        { "org.freedesktop.systemd1.Unit", "Id",                   bus_property_append_string,     "s",    u->meta.id                        }, \
+        { "org.freedesktop.systemd1.Unit", "Names",                bus_unit_append_names,          "as",   u                                 }, \
+        { "org.freedesktop.systemd1.Unit", "Requires",             bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_REQUIRES] }, \
+        { "org.freedesktop.systemd1.Unit", "RequiresOverridable",  bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_REQUIRES_OVERRIDABLE] }, \
+        { "org.freedesktop.systemd1.Unit", "Requisite",            bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_REQUISITE] }, \
+        { "org.freedesktop.systemd1.Unit", "RequisiteOverridable", bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_REQUISITE_OVERRIDABLE] }, \
+        { "org.freedesktop.systemd1.Unit", "Wants",                bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_WANTS]  }, \
+        { "org.freedesktop.systemd1.Unit", "RequiredBy",           bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_REQUIRED_BY] }, \
+        { "org.freedesktop.systemd1.Unit", "RequiredByOverridable",bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_REQUIRED_BY_OVERRIDABLE] }, \
+        { "org.freedesktop.systemd1.Unit", "WantedBy",             bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_WANTED_BY] }, \
+        { "org.freedesktop.systemd1.Unit", "Conflicts",            bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_CONFLICTS] }, \
+        { "org.freedesktop.systemd1.Unit", "Before",               bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_BEFORE] }, \
+        { "org.freedesktop.systemd1.Unit", "After",                bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_AFTER]  }, \
+        { "org.freedesktop.systemd1.Unit", "Description",          bus_unit_append_description,    "s",    u                                 }, \
+        { "org.freedesktop.systemd1.Unit", "LoadState",            bus_unit_append_load_state,     "s",    &u->meta.load_state               }, \
+        { "org.freedesktop.systemd1.Unit", "ActiveState",          bus_unit_append_active_state,   "s",    u                                 }, \
+        { "org.freedesktop.systemd1.Unit", "SubState",             bus_unit_append_sub_state,      "s",    u                                 }, \
+        { "org.freedesktop.systemd1.Unit", "FragmentPath",         bus_property_append_string,     "s",    u->meta.fragment_path             }, \
+        { "org.freedesktop.systemd1.Unit", "InactiveExitTimestamp",bus_property_append_uint64,     "t",    &u->meta.inactive_exit_timestamp  }, \
+        { "org.freedesktop.systemd1.Unit", "ActiveEnterTimestamp", bus_property_append_uint64,     "t",    &u->meta.active_enter_timestamp   }, \
+        { "org.freedesktop.systemd1.Unit", "ActiveExitTimestamp",  bus_property_append_uint64,     "t",    &u->meta.active_exit_timestamp    }, \
+        { "org.freedesktop.systemd1.Unit", "InactiveEnterTimestamp",bus_property_append_uint64,    "t",    &u->meta.inactive_enter_timestamp }, \
+        { "org.freedesktop.systemd1.Unit", "CanStart",             bus_unit_append_can_start,      "b",    u                                 }, \
+        { "org.freedesktop.systemd1.Unit", "CanReload",            bus_unit_append_can_reload,     "b",    u                                 }, \
+        { "org.freedesktop.systemd1.Unit", "Job",                  bus_unit_append_job,            "(uo)", u                                 }, \
+        { "org.freedesktop.systemd1.Unit", "RecursiveStop",        bus_property_append_bool,       "b",    &u->meta.recursive_stop           }, \
+        { "org.freedesktop.systemd1.Unit", "StopWhenUneeded",      bus_property_append_bool,       "b",    &u->meta.stop_when_unneeded       }, \
+        { "org.freedesktop.systemd1.Unit", "DefaultControlGroup",  bus_unit_append_default_cgroup, "s",    u                                 }, \
+        { "org.freedesktop.systemd1.Unit", "ControlGroups",        bus_unit_append_cgroups,        "as",   u                                 }
 
 int bus_unit_append_names(Manager *m, DBusMessageIter *i, const char *property, void *data);
+int bus_unit_append_dependencies(Manager *m, DBusMessageIter *i, const char *property, void *data);
 int bus_unit_append_description(Manager *m, DBusMessageIter *i, const char *property, void *data);
 int bus_unit_append_load_state(Manager *m, DBusMessageIter *i, const char *property, void *data);
 int bus_unit_append_active_state(Manager *m, DBusMessageIter *i, const char *property, void *data);


More information about the systemd-commits mailing list