chiark / gitweb /
systemctl: use isolate when called as telinit for a runlevel
[elogind.git] / src / systemctl.c
index c77f831eaaafdf72b255d810517e64b30ab45e78..1f93bc974aec3c7002cc7339adc1e5e8bd2a4d4d 100644 (file)
@@ -52,6 +52,7 @@
 #include "shutdownd.h"
 #include "exit-status.h"
 #include "bus-errors.h"
+#include "build.h"
 
 static const char *arg_type = NULL;
 static char **arg_property = NULL;
@@ -1253,7 +1254,11 @@ static int start_unit(DBusConnection *bus, char **args, unsigned n) {
                 method = "StartUnit";
 
                 mode = (arg_action == ACTION_EMERGENCY ||
-                        arg_action == ACTION_RESCUE) ? "isolate" : "replace";
+                        arg_action == ACTION_RESCUE ||
+                        arg_action == ACTION_RUNLEVEL2 ||
+                        arg_action == ACTION_RUNLEVEL3 ||
+                        arg_action == ACTION_RUNLEVEL4 ||
+                        arg_action == ACTION_RUNLEVEL5) ? "isolate" : "replace";
 
                 one_name = table[arg_action];
         }
@@ -4031,6 +4036,8 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
 
                 case ARG_VERSION:
                         puts(PACKAGE_STRING);
+                        puts(DISTRIBUTION);
+                        puts(SYSTEMD_FEATURES);
                         return 0;
 
                 case 't':