user = arg_scope != UNIT_FILE_SYSTEM;
- if (!user && sd_booted() <= 0) {
- /* Print a friendly message when the local system is actually not running systemd as PID 1. */
- log_error("System has not been booted with systemd as init system (PID 1). Can't operate.");
- return -EHOSTDOWN;
- }
-
if (focus == BUS_MANAGER)
r = bus_connect_transport_systemd(arg_transport, arg_host, user, &busses[focus]);
else
static int set_default(int argc, char *argv[], void *userdata) {
_cleanup_free_ char *unit = NULL;
UnitFileChange *changes = NULL;
- unsigned n_changes = 0;
+ size_t n_changes = 0;
int r;
assert(argc >= 2);
_cleanup_strv_free_ char **names = NULL;
const char *verb = argv[0];
UnitFileChange *changes = NULL;
- unsigned n_changes = 0;
+ size_t n_changes = 0;
int carries_install_info = -1;
bool ignore_carries_install_info = arg_quiet;
int r;
if (arg_now && STR_IN_SET(argv[0], "enable", "disable", "mask")) {
sd_bus *bus;
- unsigned len, i;
+ size_t len, i;
r = acquire_bus(BUS_MANAGER, &bus);
if (r < 0)
_cleanup_free_ char *target = NULL;
const char *verb = argv[0];
UnitFileChange *changes = NULL;
- unsigned n_changes = 0;
+ size_t n_changes = 0;
UnitDependency dep;
int r = 0;
static int preset_all(int argc, char *argv[], void *userdata) {
UnitFileChange *changes = NULL;
- unsigned n_changes = 0;
+ size_t n_changes = 0;
int r;
if (install_client_side()) {
static int show_installation_targets_client_side(const char *name) {
UnitFileChange *changes = NULL;
- unsigned n_changes = 0, i;
+ size_t n_changes = 0, i;
UnitFileFlags flags;
char **p;
int r;
const char **args;
char *editor, **editor_args = NULL;
char **tmp_path, **original_path, *p;
- unsigned n_editor_args = 0, i = 1;
+ size_t n_editor_args = 0, i = 1;
size_t argc;
argc = strv_length(paths)/2 + 1;
break;
case 's':
- arg_signal = signal_from_string_try_harder(optarg);
+ arg_signal = signal_from_string(optarg);
if (arg_signal < 0) {
log_error("Failed to parse signal string %s.", optarg);
return -EINVAL;
}
}
+ /* In order to minimize the difference between operation with and
+ * without logind, we explicitly enable non-blocking mode for this,
+ * as logind's shutdown operations are always non-blocking. */
+ arg_no_block = true;
+
if (!arg_dry_run && !arg_force)
return start_with_fallback();