Skip to content

Commit

Permalink
Merge pull request #1753 from dbungert/s390x-shutdown
Browse files Browse the repository at this point in the history
shutdown: use direct run_command
  • Loading branch information
dbungert authored Aug 2, 2023
2 parents d77ac16 + 4059320 commit 9187144
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions subiquity/server/controllers/shutdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from subiquitycore.async_helpers import run_bg_task
from subiquitycore.context import with_context
from subiquitycore.file_util import open_perms, set_log_perms
from subiquitycore.utils import run_command

log = logging.getLogger("subiquity.server.controllers.shutdown")

Expand Down Expand Up @@ -133,10 +134,12 @@ async def shutdown(self, context):
if self.opts.dry_run:
self.app.exit()
else:
# On shutdown, it seems that the asynchronous command runners are not
# reliable. Best to keep using the traditional sort.
if self.app.state == ApplicationState.DONE:
if platform.machine() == "s390x":
await self.app.command_runner.run(["chreipl", "/target/boot"])
run_command(["chreipl", "/target/boot"])
if self.mode == ShutdownMode.REBOOT:
await self.app.command_runner.run(["/sbin/reboot"])
run_command(["/sbin/reboot"])
elif self.mode == ShutdownMode.POWEROFF:
await self.app.command_runner.run(["/sbin/poweroff"])
run_command(["/sbin/poweroff"])

0 comments on commit 9187144

Please sign in to comment.