setwake.sh does not post on poweroff

No sure if this is kodi or PVR related, but here goes;

The system is xubuntu 16.04.2 with updates, mythtv 0.28 backend (from the ppa), kodi 17.1

Using /usr/bin/setwakeup.sh $ time as the set wake up time command in Kodi > System > PVR & LiveTV > Power Saving > Wakeup command.

If I close Kodi from the “Exit” option, the wake up time is written correctly, if the log written by setwakeup.sh is to be believed.

However, it is not written at all, i.e. the script doesn’t seem to be called, when the “Power off system” option is chosen.

The kodi, mythbackend and sys logs are not telling me anything, but the lack of output to the setwakeup.sh log seems to confirm the script is not executing on power off.

Any ideas?