PiSugar / pisugar-power-manager-rs

PiSugar Power Manger in rust language
https://www.pisugar.com/
GNU General Public License v3.0
130 stars 15 forks source link

[BUG] Soft Shutdown custom shell script retries too quickly #105

Open withoutgettingwet opened 9 months ago

withoutgettingwet commented 9 months ago

Environment

To Reproduce

  1. Go to the webui > settings > soft shutdown
  2. Select custom shell
  3. Run a service that takes a few seconds to load, or run any series of commands with a "sleep 10" in there (In my screenshot, longwait.sh is simply "sleep 10 && sudo shutdown now")
  4. Press the power button and watch from journalctl as it retries the command about every 0.5 seconds, locking up the device it is running on. (In my screenshot, it never actually reaches the shutdown command, so I believe it is killing the previous attempt every time)

Expected behavior The command runs, waiting more than a second or two before killing the running process and retrying it. Ideally, a configurable wait so that the default can be a sane value, but allowing for longer grace periods

Screenshots image

withoutgettingwet commented 8 months ago

@fengyc I see that there has been a recent commit, but nothing was changed except for the readme.

Is this something that is/will be worked on?

mighty-sparrow commented 6 months ago

I'm having a similar issue wherein I'm trying to clear an ePaper display prior to shutdown. I'm using a python script to manage the ePaper and the command loops over and over, just like was reported by @seelenamt . Is there a GOOD example of how we should be leveraging the soft shutdown script?