}
}
- if (argc > optind && !streq(argv[optind], "now")) {
- log_error("Expected 'now' argument.");
- return -EINVAL;
- }
+ if (argc > optind && !streq(argv[optind], "now"))
+ log_warning("First argument '%s' isn't 'now'. Ignoring.", argv[optind]);
/* We ignore the time argument */
if (argc > optind + 1)
optind = argc;
return 1;
-
}
static int telinit_parse_argv(int argc, char *argv[]) {
goto finish;
}
- if ((bus = dbus_bus_get(arg_session ? DBUS_BUS_SESSION : DBUS_BUS_SYSTEM, &error)))
+ /* If we are root, then let's not go via the bus */
+ if (geteuid() == 0 && !arg_session)
+ bus = dbus_connection_open("unix:abstract=/org/freedesktop/systemd1/private", &error);
+ else
+ bus = dbus_bus_get(arg_session ? DBUS_BUS_SESSION : DBUS_BUS_SYSTEM, &error);
+
+ if (bus)
dbus_connection_set_exit_on_disconnect(bus, FALSE);
switch (arg_action) {