log_error("Job canceled.");
else if (streq(d.result, "dependency"))
log_error("A dependency job failed. See system logs for details.");
- else if (!streq(d.result, "done"))
+ else if (!streq(d.result, "done") && !streq(d.result, "skipped"))
log_error("Job failed. See system logs and 'systemctl status' for details.");
}
r = -ETIME;
else if (streq_ptr(d.result, "canceled"))
r = -ECANCELED;
- else if (!streq_ptr(d.result, "done"))
+ else if (!streq_ptr(d.result, "done") && !streq_ptr(d.result, "skipped"))
r = -EIO;
else
r = 0;
streq(args[0], "stop") ? "StopUnit" :
streq(args[0], "reload") ? "ReloadUnit" :
streq(args[0], "restart") ? "RestartUnit" :
+
streq(args[0], "try-restart") ||
streq(args[0], "condrestart") ? "TryRestartUnit" :
+
streq(args[0], "reload-or-restart") ? "ReloadOrRestartUnit" :
+
streq(args[0], "reload-or-try-restart") ||
streq(args[0], "condreload") ||
+
streq(args[0], "force-reload") ? "ReloadOrTryRestartUnit" :
"StartUnit";
int exit_code, exit_status;
+ usec_t condition_timestamp;
+ bool condition_result;
+
/* Socket */
unsigned n_accepted;
unsigned n_connections;
else
printf("\n");
+ if (!i->condition_result && i->condition_timestamp > 0) {
+ s1 = format_timestamp_pretty(since1, sizeof(since1), i->condition_timestamp);
+ s2 = format_timestamp(since2, sizeof(since2), i->condition_timestamp);
+
+ if (s1)
+ printf("\t start condition failed at %s; %s\n", s2, s1);
+ else if (s2)
+ printf("\t start condition failed at %s\n", s2);
+ }
+
if (i->sysfs_path)
printf("\t Device: %s\n", i->sysfs_path);
if (i->where)
i->accept = b;
else if (streq(name, "NeedDaemonReload"))
i->need_daemon_reload = b;
+ else if (streq(name, "ConditionResult"))
+ i->condition_result = b;
break;
}
i->inactive_exit_timestamp = (usec_t) u;
else if (streq(name, "ActiveExitTimestamp"))
i->active_exit_timestamp = (usec_t) u;
+ else if (streq(name, "ConditionTimestamp"))
+ i->condition_timestamp = (usec_t) u;
break;
}
}
if (!f) {
-#if defined(TARGET_FEDORA) && defined (HAVE_SYSV_COMPAT)
+#if (defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA)) && defined (HAVE_SYSV_COMPAT)
if (endswith(i->name, ".service")) {
char *sysv;
argv[1] = file_name_from_path(sysv);
argv[2] =
streq(verb, "enable") ? "on" :
- streq(verb, "disable") ? "off" : NULL;
+ streq(verb, "disable") ? "off" : "--level=3";
log_info("Executing %s %s %s", argv[0], argv[1], strempty(argv[2]));
return r;
if (status.si_code == CLD_EXITED) {
- if (status.si_status == 0 && (streq(verb, "enable") || streq(verb, "disable")))
+
+ if (streq(verb, "is-enabled"))
+ return status.si_status == 0 ? 1 : 0;
+
+ if (status.si_status == 0)
n_symlinks ++;
return status.si_status == 0 ? 0 : -EINVAL;
+
} else
return -EPROTO;
}
goto finish;
}
+ r = 0;
+
while ((i = hashmap_first(will_install))) {
int q;