From c1e3de49463c7aea8e5f6dbbe6c72aa59d58362f Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 26 Apr 2020 13:48:34 +0200 Subject: powerctl: T2010: fix "wall" complaining about inapproriate ioctl wall: cannot get tty name: Inappropriate ioctl for device - script is run in the background where there is normally no tty available - silently discard this warning. --- src/op_mode/powerctrl.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/op_mode/powerctrl.py b/src/op_mode/powerctrl.py index d33f8633d..b2fb5fe5a 100755 --- a/src/op_mode/powerctrl.py +++ b/src/op_mode/powerctrl.py @@ -86,12 +86,12 @@ def cancel_shutdown(): if output and 'MODE' in output: timenow = datetime.now().strftime('%Y-%m-%d %H:%M:%S') try: - cmd('/sbin/shutdown -c --no-wall') + run('/sbin/shutdown -c --no-wall') except OSError as e: exit("Could not cancel a reboot or poweroff: %s" % e) - message = "Scheduled %s has been cancelled %s" % ( - output['MODE'], timenow) - run(f'wall {message}') + + message = 'Scheduled {} has been cancelled {}'.format(output['MODE'], timenow) + run(f'wall {message} > /dev/null 2>&1') else: print("Reboot or poweroff is not scheduled") -- cgit v1.2.3