![]() |
|
Shutdown and Power Off Delay - Printable Version +- OpenMarine (https://forum.openmarine.net) +-- Forum: OpenPlotter (https://forum.openmarine.net/forumdisplay.php?fid=1) +--- Forum: Feature Requests (https://forum.openmarine.net/forumdisplay.php?fid=5) +--- Thread: Shutdown and Power Off Delay (/showthread.php?tid=6101) |
Shutdown and Power Off Delay - Techstyle - 2025-03-16 I added a script to the Shut off text in /boot/firmware/config.txt per the process below. This allows a delay to quietly close OpenCPN and Chromium. Could this be automated and added to the options in "Raspberry Settings" Use the Settings app, Raspberry Settings. Set as below: After this do the following:
Code: sudo nano /usr/local/bin/custom_shutdown.sh
Code: #!/bin/bash
Code: sudo chmod +x /usr/local/bin/custom_shutdown.sh
Code: sudo nano /boot/firmware/config.txt
Code: dtoverlay=gpio-shutdown,gpio_pin=21,active_low=1,gpio_pull=down,gpio_shutdown_command=/usr/local/bin/custom_shutdown.shRE: Shutdown and Power Off Delay - Sailoog - 2025-03-21 OpenPlotter is already doing that running this service when a shutdown GPIO is defined in openplotter-settings: https://github.com/openplotter/openplotter-settings/blob/master/openplotterSettings/shutdown.py but your approach is very interesting. gpio_shutdown_command is not documented anywhere, where did you get it from? Add -15 argument to your commands to make sure the configuration files are saved before exiting: pkill -15 opencpn RE: Shutdown and Power Off Delay - Techstyle - 2025-03-21 (2025-03-21, 01:11 PM)Sailoog Wrote: OpenPlotter is already doing that running this service when a shutdown GPIO is defined in openplotter-settings: https://github.com/openplotter/openplotter-settings/blob/master/openplotterSettings/shutdown.py Thanks for the '-15' I will add it, although, it seems like Openplotter has it covered - I didn't know that, I see your solution is only shutting down OCPN, could the feature request be to add more applications? for me OCPN and Chromium is desirable, but is there a way to safely close all open applications before closing or have check boxes for common ones? as for "gpio_shutdown_command is not documented anywhere, where did you get it from?" it must be somewhere... https://www.perplexity.ai/search/my-raspberry-pi-has-a-line-add-X1CWyoxQQ2KH7nok1aA6Tg RE: Shutdown and Power Off Delay - Sailoog - 2025-03-21 We could add a loop to kill any running process, but that would be too aggressive because we might kill something that needs to run to completion. However, expanding the list of known applications to kill, in addition to OpenCPN, wouldn't hurt. It makes sense to close Chromium and Firefox, anything else? I will investigate using gpio_shutdown_command for future versions of OP. RE: Shutdown and Power Off Delay - Techstyle - 2025-03-21 not sure if these have adverse effects if shutdown abruptly but, here are a few I can think of: SKipper the Grib viewer qtVlm RE: Shutdown and Power Off Delay - DanLXIX - 2025-09-08 I really need this because I always get the Chromium restore pages message on startup, when I just want it to go to the KIPdashboard I've set as a start page. I've followed your steps but it's not running the script at shutdown. The script works perfectly when run on it's own, so it's not getting triggered for some reason. I'm not good enough on Linus to troublehoot this either! EDIT: I asked ChatGPT how to do this and it didn#t offer this workaround, so I'm unsure how else to do this. |