Sorry - I am wrong about the mythshutdown -s - it does return 255 if setup is running!
If I use the mythwelcome shutdown now option everything freezes - needs a power off at the main switch and power on again.
The /usr/sbin/poweroff works from a terminal- no sudo needed, and that is set in the shutdown field on welcome/F11 page.
That logging 'mythbackend --setverbose idle,system' shows this as it is starting up. Don't know if it is relevant:
2021-04-14 14:38:49.845839 N Reading locale defaults from /usr/share/mythtv//locales/en_gb.xml
2021-04-14 14:38:49.894110 I PowerDBus: Failed to delay sleep,shutdown: Permission denied
2021-04-14 14:38:49.998280 I Power: On AC power
If I invoke extra logging by replacing the shutdown string with:
mythshutdown --shutdown --logpath /home/phil/logging
then I learn that the setwakeup.sh script fails:
2021-04-14 12:48:01.222569 E [2102/2102] CoreContext main.cpp:546 (shutdown) - Error: no daily wakeup times are set
2021-04-14 12:48:01.225316 E [2102/2102] CoreContext main.cpp:565 (shutdown) - Recording scheduled at: 11:28
2021-04-14 12:48:01.225695 E [2102/2102] CoreContext main.cpp:606 (shutdown) - Will wake up at next scheduled program
2021-04-14 12:48:01.231939 E [2102/2102] CoreContext main.cpp:688 (shutdown) - Sending command to set time in BIOS /usr/bin/setwakeup.sh 1618482480
2021-04-14 12:48:01.283144 E [2102/2102] CoreContext main.cpp:695 (shutdown) - Program /usr/bin/setwakeup.sh 1618482480 exited with code 2
2021-04-14 12:48:01.283862 E [2102/2102] CoreContext main.cpp:701 (shutdown) - Error: nvram-wakeup failed to set time in BIOS
Extra tracing in setwakeup.sh pointed to lack of permissions for /sys/class/rtc/rtc0/wakealarm.
If I sudo it then the shutdown log is not produced but the backend log shows:
Apr 14 12:39:14 myth mythbackend: mythbackend[1505]: I SystemManager mythsystemunix.cpp:335 (run) Managed child (PID: 8741) has exited! command
=mythshutdown --check, status=0, result=0
Apr 14 12:39:14 myth mythbackend: mythbackend[1505]: I Scheduler scheduler.cpp:3279 (CheckShutdownServer) CheckShutdownServer returned - OK to
shutdown
Apr 14 12:39:14 myth mythbackend: mythbackend[1505]: N Scheduler scheduler.cpp:3390 (ShutdownServer) Running the command to set the next schedu
led wakeup time :-#012#011#011#011#011sudo mythshutdown --setwakeup 2021-04-15T11:28
Apr 14 12:39:14 myth mythbackend: mythbackend[1505]: I Scheduler mythsystemunix.cpp:934 (Fork) Managed child (PID: 8781) has started! * command
=sudo mythshutdown --setwakeup 2021-04-15T11:28, timeout=0
Apr 14 12:39:14 myth mythbackend: mythbackend[1505]: I SystemManager mythsystemunix.cpp:335 (run) Managed child (PID: 8781) has exited! command
=sudo mythshutdown --setwakeup 2021-04-15T11:28, status=256, result=1
Apr 14 12:39:14 myth mythbackend: mythbackend[1505]: E Scheduler scheduler.cpp:3397 (ShutdownServer) SetWakeuptimeCommand failed, shutdown abor
ted
If instead I chmod 666 /sys/class/rtc/rtc0/wakealarm then it gives a shutdown log and gets further:
2021-04-14 12:48:51.466168 E [2175/2175] CoreContext main.cpp:546 (shutdown) - Error: no daily wakeup times are set
2021-04-14 12:48:51.469094 E [2175/2175] CoreContext main.cpp:565 (shutdown) - Recording scheduled at: 11:28
2021-04-14 12:48:51.469497 E [2175/2175] CoreContext main.cpp:606 (shutdown) - Will wake up at next scheduled program
2021-04-14 12:48:51.476522 E [2175/2175] CoreContext main.cpp:688 (shutdown) - Sending command to set time in BIOS /usr/bin/setwakeup.sh 1618482480
2021-04-14 12:48:51.529920 E [2175/2175] CoreContext main.cpp:695 (shutdown) - Program /usr/bin/setwakeup.sh 1618482480 exited with code 0
2021-04-14 12:48:51.530669 E [2175/2175] CoreContext main.cpp:745 (shutdown) - Everything looks fine, but reboot is needed
2021-04-14 12:48:51.530883 E [2175/2175] CoreContext main.cpp:748 (shutdown) - Sending command to bootloader ...
2021-04-14 12:48:51.531019 E [2175/2175] CoreContext main.cpp:751 (shutdown) - #nvramrestart
2021-04-14 12:48:51.580128 E [2175/2175] CoreContext main.cps:755 (shutdown) - ..
.
rebooting ...
Unfortunately, those permissions reset to 644 on next boot up.
That #nvramrestart is not the expected shutdown command; it's the content of the 'nvram -wakeup restart command' in F11 of Mythwelcome.
I don't know why it is trying to reboot rather than doing an ACP powering off (and I don't understand why both are there) but if I change it to /usr/sbin/poweroff
then it still won't shut off. The shutdown log shows:
2021-04-14 14:46:21.692016 E [3324/3324] CoreContext main.cpp:546 (shutdown) - Error: no daily wakeup times are set
2021-04-14 14:46:21.695078 E [3324/3324] CoreContext main.cpp:565 (shutdown) - Recording scheduled at: 11:28
2021-04-14 14:46:21.695329 E [3324/3324] CoreContext main.cpp:606 (shutdown) - Will wake up at next scheduled program
2021-04-14 14:46:21.702097 E [3324/3324] CoreContext main.cpp:688 (shutdown) - Sending command to set time in BIOS /usr/bin/setwakeup.sh 1618482480
2021-04-14 14:46:21.753462 E [3324/3324] CoreContext main.cpp:695 (shutdown) - Program /usr/bin/setwakeup.sh 1618482480 exited with code 0
2021-04-14 14:46:21.753924 E [3324/3324] CoreContext main.cpp:745 (shutdown) - Everything looks fine, but reboot is needed
2021-04-14 14:46:21.754155 E [3324/3324] CoreContext main.cpp:748 (shutdown) - Sending command to bootloader ...
2021-04-14 14:46:21.754712 E [3324/3324] CoreContext main.cpp:751 (shutdown) - /usr/sbin/poweroff
2021-04-14 14:46:21.853602 E [3324/3324] CoreContext main.cpp:755 (shutdown) - ..
.
rebooting ...
The backend log shows this:
Apr 14 14:46:19 myth mythbackend: mythbackend[1504]: I Scheduler scheduler.cpp:3279 (CheckShutdownServer) CheckShutdownServer returned - OK to shutdown
Apr 14 14:46:19 myth mythbackend: mythbackend[1504]: N Scheduler scheduler.cpp:3390 (ShutdownServer) Running the command to set the next scheduled wakeup time :-#012#011#011#011#011mythshutdown --setwakeup 2021-04-15T11:28
Apr 14 14:46:19 myth mythbackend: mythbackend[1504]: I Scheduler mythsystemunix.cpp:934 (Fork) Managed child (PID: 3299) has started! * command=mythshutdown --setwakeup 2021-04-15T11:28, timeout=0
Apr 14 14:46:20 myth mythbackend: mythbackend[1504]: I SystemManager mythsystemunix.cpp:335 (run) Managed child (PID: 3299) has exited! command=mythshutdown --setwakeup 2021-04-15T11:28, status=0, result=0
Apr 14 14:46:20 myth mythbackend: mythbackend[1504]: N Scheduler scheduler.cpp:3421 (ShutdownServer) Running the command to shutdown this computer :-#012#011#011#011#011mythshutdown --shutdown --logpath /home/phil/logging
Apr 14 14:46:20 myth mythbackend: mythbackend[1504]: I Scheduler mythsystemunix.cpp:934 (Fork) Managed child (PID: 3323) has started! * command=mythshutdown --shutdown --logpath /home/phil/logging, timeout=0
Apr 14 14:46:22 myth mythbackend: mythbackend[1504]: I SystemManager mythsystemunix.cpp:335 (run) Managed child (PID: 3323) has exited! command=mythshutdown --shutdown --logpath /home/phil/logging, status=0, result=0
Apr 14 14:46:37 myth mythbackend: mythbackend[1504]: I Scheduler mythsystemunix.cpp:934 (Fork) Managed child (PID: 3389) has started! * command=mythshutdown --check, timeout=0
Apr 14 14:46:38 myth mythbackend: mythbackend[1504]: I ProcessRequest mainserver.cpp:1768 (HandleAnnounce) MainServer: MainServer::ANN Monitor
Apr 14 14:46:38 myth mythbackend: mythbackend[1504]: I ProcessRequest mainserver.cpp:1770 (HandleAnnounce) MainServer: adding: myth(5588e6eae590) as a client (events: 0)
Apr 14 14:46:38 myth mythbackend: mythbackend[1504]: I ProcessRequest mainserver.cpp:1768 (HandleAnnounce) MainServer: MainServer::ANN Monitor
Apr 14 14:46:38 myth mythbackend: mythbackend[1504]: I ProcessRequest mainserver.cpp:1770 (HandleAnnounce) MainServer: adding: myth(5588e6e1dfe0) as a client (events: 1)
So, I think I have two problems:
1. Fix permissions on wakealarm.
2. Understanding why it is trying to reboot/restart rather than shutdown and why that does not work anyway.
I also seem to have lost my mouse cursor once welcome starts - I recall ticking an option somewhere to hide it during playback but I can't remember where!
Phil