diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-04-22 02:42:59 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-04-22 02:42:59 +0200 |
commit | c497c7a9e4db487eab4f92421a74d721d9558186 (patch) | |
tree | 6699ec66f8f69fd8a8432f88bb5d67eab50b04ea /systemctl.vala | |
parent | c9c0cadbf8d8e4c1b99c35a8150c08558f361ebd (diff) |
manager: introduce 'isolate' job mode which kills all units but the requested one
Diffstat (limited to 'systemctl.vala')
-rw-r--r-- | systemctl.vala | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/systemctl.vala b/systemctl.vala index a0237bb734..feacdb2b7b 100644 --- a/systemctl.vala +++ b/systemctl.vala @@ -81,6 +81,7 @@ int main (string[] args) { " cancel [JOB...] Cancel one or more jobs\n" + " start [NAME...] Start on or more units\n" + " stop [NAME...] Stop on or more units\n" + + " enter [NAME] Start one unit and stop all others\n" + " restart [NAME...] Restart on or more units\n" + " reload [NAME...] Reload on or more units\n" + " monitor Monitor unit/job changes\n" + @@ -214,6 +215,22 @@ int main (string[] args) { u.reload(mode); } + } else if (args[1] == "isolate") { + + if (args.length != 3) { + stderr.printf("Missing argument.\n"); + return 1; + } + + ObjectPath p = manager.get_unit(args[2]); + + Unit u = bus.get_object( + "org.freedesktop.systemd1", + p, + "org.freedesktop.systemd1.Unit") as Unit; + + u.start("isolate"); + } else if (args[1] == "monitor") { manager.subscribe(); |