fix systemd test

This commit is contained in:
2024-06-16 14:24:23 +02:00
parent 5e5b77ed5e
commit 6305fd053b
2 changed files with 3 additions and 3 deletions

View File

@ -48,7 +48,7 @@ def fork_and_reboot():
log = logging.getLogger(sau.LOGNAME)
if os.path.exist('/proc/1/comm'):
with open('/proc/1/comm', 'r') as f:
if f.readline() == 'systemd':
if f.readline().strip() == 'systemd':
os.execl('/usr/bin/systemctl', 'reboot')
log.error("Failed to execl?")
sys.exit(1)