Merge pull request #250 from naturallaw777/copilot/fix-hub-reboot-functionality
Fix Hub reboot path to use forced systemd reboot unit
This commit is contained in:
@@ -49,6 +49,7 @@ UPDATE_UNIT = "sovran-hub-update.service"
|
|||||||
REBUILD_LOG = "/var/log/sovran-hub-rebuild.log"
|
REBUILD_LOG = "/var/log/sovran-hub-rebuild.log"
|
||||||
REBUILD_STATUS = "/var/log/sovran-hub-rebuild.status"
|
REBUILD_STATUS = "/var/log/sovran-hub-rebuild.status"
|
||||||
REBUILD_UNIT = "sovran-hub-rebuild.service"
|
REBUILD_UNIT = "sovran-hub-rebuild.service"
|
||||||
|
REBOOT_UNIT = "sovran-hub-reboot.service"
|
||||||
|
|
||||||
# Set to True by _startup_recover_stale_status() when it corrects a stale
|
# Set to True by _startup_recover_stale_status() when it corrects a stale
|
||||||
# RUNNING → SUCCESS/FAILED for the update unit. Consumed by the first call
|
# RUNNING → SUCCESS/FAILED for the update unit. Consumed by the first call
|
||||||
@@ -2052,7 +2053,7 @@ async def api_upgrade_to_server():
|
|||||||
# and ports first via the onboarding wizard. Reboot so onboarding runs.
|
# and ports first via the onboarding wizard. Reboot so onboarding runs.
|
||||||
try:
|
try:
|
||||||
proc = await asyncio.create_subprocess_exec(
|
proc = await asyncio.create_subprocess_exec(
|
||||||
"/run/current-system/sw/bin/reboot",
|
"/run/current-system/sw/bin/systemctl", "start", "--no-block", REBOOT_UNIT,
|
||||||
stdout=asyncio.subprocess.DEVNULL,
|
stdout=asyncio.subprocess.DEVNULL,
|
||||||
stderr=asyncio.subprocess.DEVNULL,
|
stderr=asyncio.subprocess.DEVNULL,
|
||||||
)
|
)
|
||||||
@@ -2885,7 +2886,7 @@ async def api_ping():
|
|||||||
async def api_reboot():
|
async def api_reboot():
|
||||||
try:
|
try:
|
||||||
proc = await asyncio.create_subprocess_exec(
|
proc = await asyncio.create_subprocess_exec(
|
||||||
"/run/current-system/sw/bin/reboot",
|
"/run/current-system/sw/bin/systemctl", "start", "--no-block", REBOOT_UNIT,
|
||||||
stdout=asyncio.subprocess.DEVNULL,
|
stdout=asyncio.subprocess.DEVNULL,
|
||||||
stderr=asyncio.subprocess.DEVNULL,
|
stderr=asyncio.subprocess.DEVNULL,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -380,6 +380,14 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.services.sovran-hub-reboot = {
|
||||||
|
description = "Sovran_SystemsOS System Reboot";
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
ExecStart = "/run/current-system/sw/bin/systemctl --force reboot";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
environment.systemPackages = [ sovran-hub-web ];
|
environment.systemPackages = [ sovran-hub-web ];
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ 8937 60847 ];
|
networking.firewall.allowedTCPPorts = [ 8937 60847 ];
|
||||||
|
|||||||
Reference in New Issue
Block a user