[LE 10.2] [RPi4] Shutdown.sh script not working

  • Description:

    During some testing with some of my scripts that i'm running on shutdown and reboot, i noticed that the shutdown.sh script does not work.

    shutdown.sh script used for testing:

    The command used in the scrip is only used for testing purposes and it's working correctly with the autostop.sh .

    Test results:

    After several shutdown and reboots, both from Kodi UI and with SSH commands, the shutdown.log it's empty (the file was previously created by autostop.sh).

    It seems that it was also discussed here but without any conclusion.

  • Unfortunately the sample in the wiki is wrong. shutdown.sh is ever called with one parameter of [halt|poweroff|reboot] and the default condition is never tested.

    To have a command executed in any case move it out of the case ... esac statement.

  • mglae i tried with "poweroff" paramater,same result,shutdown.sh doesn't seem to be triggered.

    I also added a sleep 20,hoping that will help me catch some journal logs.

    shutdown.sh script

    journalctrl -f

  • Hmm, there was something wrong with the /storage/shutdown.log file, deleted it and now the shutdown.sh works with both reboot and shutdown parameters.

    Edited once, last by Pretoriano (April 5, 2022 at 5:04 AM).