/dev/null 2>&1; then systemd-run --on-active=5 --timer-property=AccuracySec=1s systemctl reboot >/dev/null 2>&1; else nohup sh -c "sleep 5; reboot" >/dev/null 2>&1 assertNotTransferredAway(); if (! $server->isFunctional()) { throw new \RuntimeException('Server is not reachable or not ready.'); } $output = instant_remote_process([self::COMMAND], $server); if (! str_contains((string) $output, 'REBOOT_SCHEDULED')) { throw new \RuntimeException('The reboot could not be started.'); } // Check again when the server is back, so the "Reboot required" state is cleared. ServerPatchCheckJob::dispatch($server, true)->delay(now()->addMinutes(5)); } }