[systemd-devel] [PATCH] dbus-manager.c: log error, why switch-root is refused

harald at redhat.com harald at redhat.com
Thu Apr 25 01:35:57 PDT 2013


From: Harald Hoyer <harald at redhat.com>

---
 src/core/dbus-manager.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
index 1f5a7d9..74b31fd 100644
--- a/src/core/dbus-manager.c
+++ b/src/core/dbus-manager.c
@@ -1503,8 +1503,10 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
                 }
 
                 /* Safety check */
-                if (isempty(switch_root_init))
+                if (isempty(switch_root_init)) {
                         good = path_is_os_tree(switch_root);
+                        log_error("Not switching root: %s does not seem to be an OS tree. /etc/os-release is missing.", switch_root);
+                }
                 else {
                         _cleanup_free_ char *p = NULL;
 
@@ -1513,6 +1515,7 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
                                 goto oom;
 
                         good = access(p, X_OK) >= 0;
+                        log_error("Not switching root: cannot execute new init %s", p);
                 }
                 if (!good)
                         return bus_send_error_reply(connection, message, NULL, -EINVAL);
-- 
1.8.2.1



More information about the systemd-devel mailing list