static const char *arg_kill_who = NULL;
static int arg_signal = SIGTERM;
static BusTransport arg_transport = BUS_TRANSPORT_LOCAL;
-static bool arg_ask_password = true;
static char *arg_host = NULL;
+static bool arg_ask_password = true;
static unsigned arg_lines = 10;
static OutputMode arg_output = OUTPUT_SHORT;
assert(args);
+ polkit_agent_open_if_enabled();
+
for (i = 1; i < n; i++) {
r = sd_bus_call_method (
assert(args);
+ polkit_agent_open_if_enabled();
+
if (!arg_kill_who)
arg_kill_who = "all";
assert(args);
+ polkit_agent_open_if_enabled();
+
for (i = 1; i < n; i++) {
uid_t uid;
assert(args);
+ polkit_agent_open_if_enabled();
+
if (!arg_kill_who)
arg_kill_who = "all";
assert(args);
+ polkit_agent_open_if_enabled();
+
r = sd_bus_call_method (
bus,
"org.freedesktop.login1",
assert(args);
+ polkit_agent_open_if_enabled();
+
for (i = 1; i < n; i++) {
r = sd_bus_call_method (
}
static void help(void) {
+
printf("%s [OPTIONS...] {COMMAND} ...\n\n"
"Send control commands to or query the login manager.\n\n"
" -h --help Show this help\n"
ask_password_agent_open();
}
-#ifdef HAVE_LOGIND
static void polkit_agent_open_if_enabled(void) {
/* Open the polkit agent as a child process if necessary */
polkit_agent_open();
}
-#endif
static OutputFlags get_output_flags(void) {
return
assert(bus);
ask_password_agent_open_if_enabled();
+ polkit_agent_open_if_enabled();
if (arg_action == ACTION_SYSTEMCTL) {
enum action action;
assert(bus);
assert(args);
+ polkit_agent_open_if_enabled();
+
if (!arg_kill_who)
arg_kill_who = "all";
char **i;
int r;
+ polkit_agent_open_if_enabled();
+
r = sd_bus_message_new_method_call(
bus,
&m,
const char *path;
int r;
+ polkit_agent_open_if_enabled();
+
if (strv_length(args) > 1)
n = unit_name_mangle_with_suffix(args[1], MANGLE_NOGLOB, ".snapshot");
else
assert(args);
+ polkit_agent_open_if_enabled();
+
r = expand_names(bus, args + 1, ".snapshot", &names);
if (r < 0)
log_error_errno(r, "Failed to expand names: %m");
const char *method;
int r;
+ polkit_agent_open_if_enabled();
+
if (arg_action == ACTION_RELOAD)
method = "Reload";
else if (arg_action == ACTION_REEXEC)
if (strv_length(args) <= 1)
return daemon_reload(bus, args);
+ polkit_agent_open_if_enabled();
+
r = expand_names(bus, args + 1, NULL, &names);
if (r < 0)
log_error_errno(r, "Failed to expand names: %m");
bool send_force = true, send_preset_mode = false;
const char *method;
+ polkit_agent_open_if_enabled();
+
if (streq(verb, "enable")) {
method = "EnableUnitFiles";
expect_carries_install_info = true;
_cleanup_bus_message_unref_ sd_bus_message *reply = NULL, *m = NULL;
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
+ polkit_agent_open_if_enabled();
+
r = sd_bus_message_new_method_call(
bus,
&m,
_cleanup_bus_message_unref_ sd_bus_message *m = NULL, *reply = NULL;
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
+ polkit_agent_open_if_enabled();
+
r = sd_bus_message_new_method_call(
bus,
&m,