A FreezeUnit operation can hang due to the presence of kernel threads
(see last 2 commits). Keeping the default configuration will mean the
system will hang for 25 seconds in suspend waiting for the response. 1.5
seconds should be sufficient for most cases.
if (r < 0)
return log_debug_errno(r, "Failed to open connection to systemd: %m");
+ /* Wait for 1.5 seconds at maximum for freeze operation */
+ (void) sd_bus_set_method_call_timeout(bus, 1500 * USEC_PER_MSEC);
+
r = bus_call_method(bus, bus_systemd_mgr, *method, &error, NULL, "s", SPECIAL_USER_SLICE);
if (r < 0)
return log_debug_errno(r, "Failed to execute operation: %s", bus_error_message(&error, r));