diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-04-18 03:07:42 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-04-18 03:07:42 +0200 |
commit | 41447faf1fc57463becabce399d983df762a104c (patch) | |
tree | fe449b8a472b12b2005280ed5552d7f53d19524b /systemctl.vala | |
parent | 6dde1f33e1249a8a6b354372dd95065f26b8c712 (diff) |
snapshot: implement snapshot unit logic
Diffstat (limited to 'systemctl.vala')
-rw-r--r-- | systemctl.vala | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/systemctl.vala b/systemctl.vala index 8f16b90482..4de856e756 100644 --- a/systemctl.vala +++ b/systemctl.vala @@ -83,7 +83,9 @@ int main (string[] args) { " stop [NAME...] Stop on or more units\n" + " restart [NAME...] Restart on or more units\n" + " reload [NAME...] Reload on or more units\n" + - " monitor Monitor unit/job changes\n"); + " monitor Monitor unit/job changes\n" + + " dump Dump servier status\n" + + " snapshot [NAME] Create a snapshot\n"); try { context.parse(ref args); @@ -224,7 +226,17 @@ int main (string[] args) { } else if (args[1] == "dump") stdout.puts(manager.dump()); - else { + else if (args[1] == "snapshot") { + + ObjectPath p = manager.create_snapshot(args.length > 2 ? args[2] : ""); + + Unit u = bus.get_object( + "org.freedesktop.systemd1", + p, + "org.freedesktop.systemd1.Unit") as Unit; + + stdout.printf("%s\n", u.id); + } else { stderr.printf("Unknown command %s.\n", args[1]); return 1; } |