|
@@ -795,23 +795,23 @@ static void control_socket_ready() noexcept {
|
|
|
if (socket_ready_fd > 2) {
|
|
|
close(socket_ready_fd);
|
|
|
}
|
|
|
- // Ensure this can only be called once
|
|
|
+ // Ensure that we don't try to issue readiness again:
|
|
|
socket_ready_fd = -1;
|
|
|
}
|
|
|
|
|
|
// Callback when the root filesystem is read/write:
|
|
|
void rootfs_is_rw() noexcept
|
|
|
{
|
|
|
- open_control_socket(true);
|
|
|
- if (! did_log_boot) {
|
|
|
+ if (!control_socket_open) {
|
|
|
+ open_control_socket(true);
|
|
|
+ control_socket_ready();
|
|
|
+ }
|
|
|
+ if (!did_log_boot) {
|
|
|
did_log_boot = log_boot();
|
|
|
}
|
|
|
- // If the control socket failed to open early on, there was no readiness
|
|
|
- // notification, so do it here for a second time, just in case
|
|
|
- control_socket_ready();
|
|
|
}
|
|
|
|
|
|
-// Open/create the control socket, normally /dev/dinitctl, used to allow client programs to connect
|
|
|
+// Open/create the control socket, normally /run/dinitctl, used to allow client programs to connect
|
|
|
// and issue service orders and shutdown commands etc. This can safely be called multiple times;
|
|
|
// once the socket has been successfully opened, further calls will check the socket file is still
|
|
|
// present and re-create it if not.
|