What is the problem?
I know this may be more of a Raspbian question than an OctoPrint question, but I figured I would ask here first. I have created a simple shutdown button script. (Untitled - Pastebin.com). I added the script to rc.local, and it starts as expected, but the Raspberry Pi shuts down after about 30 seconds. I added a debug line to the script and it shows, but again after 30 seconds or so the Pi shuts down. Unfortunately the text on the screen just before the shutdown displays to quickly.
What did you already try to solve it?
If I remove the line from the rc.local the Pi starts and remains running. If I run the script from the command line everything works fine. The only time there is an issue is if I run the script from the rc.local. This is the line added to rc.local just before the exit 0 "python3 /home/pi/myScripts/off_button.py &"
I tried journalctl --boot, but I do not have enough time to look at the file before the shutdown. I have just enough time to edit rc.local to remove running the script before the Pi shuts down.
Have you tried running in safe mode?
No
Systeminfo Bundle
You can download this in OctoPrint's System Information dialog ... no bundle, no support!)
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
octopi_version 0.18.0
OctoPrint 1.8.7
Additional information about your setup
OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible
I do not have my webcam plugged in while testing, so looking at the syslog I see the webcam try to start multiple times, then I see the immediate shutdown after the multiple webcam attempts. I will plug in the webcam and test but I find it hard to believe that would be the issue.
Info from syslog that may be helpful:
2023-04-20 11:34:56,786 - octoprint.environment - INFO - Detected environment is Python 3.7.3 under Linux (linux). Details:
Apr 20 11:34:56 octopi octoprint[426]: | hardware:
Apr 20 11:34:56 octopi octoprint[426]: | cores: 4
Apr 20 11:34:56 octopi octoprint[426]: | freq: 1200.0
Apr 20 11:34:56 octopi octoprint[426]: | ram: 914006016
Apr 20 11:34:56 octopi octoprint[426]: | os:
Apr 20 11:34:56 octopi octoprint[426]: | bits: 32
Apr 20 11:34:56 octopi octoprint[426]: | id: linux
Apr 20 11:34:56 octopi octoprint[426]: | platform: linux
Apr 20 11:34:56 octopi octoprint[426]: | plugins:
Apr 20 11:34:56 octopi octoprint[426]: | pi_support:
Apr 20 11:34:56 octopi octoprint[426]: | model: Raspberry Pi 3 Model B Rev 1.2
Apr 20 11:34:56 octopi octoprint[426]: | octopi_version: 0.18.0
Apr 20 11:34:56 octopi octoprint[426]: | octopiuptodate_build: 0.18.0-1.8.6-20221018093204
Apr 20 11:34:56 octopi octoprint[426]: | throttle_check_enabled: true
Apr 20 11:34:56 octopi octoprint[426]: | throttle_check_functional: true
Apr 20 11:34:56 octopi octoprint[426]: | throttle_state: '0x0'
Apr 20 11:34:56 octopi octoprint[426]: | python:
Apr 20 11:34:56 octopi octoprint[426]: | pip: 20.3.3
Apr 20 11:34:56 octopi octoprint[426]: | version: 3.7.3
Apr 20 11:34:56 octopi octoprint[426]: | virtualenv: /home/pi/oprint#033[0m