mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-17 16:09:14 +00:00
fix: wrong systemd unit used
This commit is contained in:
parent
94456af7d4
commit
b98c020f23
|
@ -12,11 +12,9 @@ import time
|
|||
@huey.task()
|
||||
def rebuild_system_task(job: Job, upgrade: bool = False):
|
||||
"""Rebuild the system"""
|
||||
unit_name = "sp-nixos-upgrade.service" if upgrade else "sp-nixos-rebuild.service"
|
||||
try:
|
||||
if upgrade:
|
||||
command = ["systemctl", "start", "sp-nixos-upgrade.service"]
|
||||
else:
|
||||
command = ["systemctl", "start", "sp-nixos-rebuild.service"]
|
||||
command = ["systemctl", "start", unit_name]
|
||||
subprocess.run(
|
||||
command,
|
||||
check=True,
|
||||
|
@ -34,7 +32,7 @@ def rebuild_system_task(job: Job, upgrade: bool = False):
|
|||
while True:
|
||||
try:
|
||||
status = subprocess.run(
|
||||
["systemctl", "is-active", "selfprivacy-upgrade"],
|
||||
["systemctl", "is-active", unit_name],
|
||||
check=True,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
|
@ -63,7 +61,7 @@ def rebuild_system_task(job: Job, upgrade: bool = False):
|
|||
while True:
|
||||
try:
|
||||
status = subprocess.run(
|
||||
["systemctl", "is-active", "selfprivacy-upgrade"],
|
||||
["systemctl", "is-active", unit_name],
|
||||
check=True,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
|
|
Loading…
Reference in a new issue