Skip to content

Conversation

Gold872
Copy link
Member

@Gold872 Gold872 commented Jan 24, 2025

No description provided.

@Gold872 Gold872 requested a review from Levi-Lesches as a code owner January 24, 2025 19:57
@Levi-Lesches
Copy link
Member

Levi-Lesches commented Feb 5, 2025

This is tricky because I saw the Pi refuse to shut down when this was enabled, but I agree that it doesn't sound like that should happen. Here's an excerpt from the docs:

Restart=

Configures whether the service shall be restarted when the service process exits, is killed, or a timeout is reached. The service process may be the main service process, but it may also be one of the processes specified with ExecStartPre=, ExecStartPost=, ExecStop=, ExecStopPost=, or ExecReload=. When the death of the process is a result of systemd operation (e.g. service stop or restart), the service will not be restarted. Timeouts include missing the watchdog "keep-alive ping" deadline and a service start, reload, and stop operation timeouts.

Takes one of no, on-success, on-failure, on-abnormal, on-watchdog, on-abort, or always. If set to no (the default), the service will not be restarted. If set to on-success, it will be restarted only when the service process exits cleanly. In this context, a clean exit means any of the following:

  • exit code of 0;
  • for types other than Type=oneshot, one of the signals SIGHUP, SIGINT, SIGTERM, or SIGPIPE;
  • exit statuses and signals specified in SuccessExitStatus=.

(emphasis mine)

My theory is that sudo shutdown now, or the Pi's power button, is sending a SIGTERM rather than a systemd stop command. I'm also still not convinced this isn't the kind of thing that makes debugging harder. I can imagine someone would write exit(0) thinking it would actually stop the program, and be surprised that it "didn't".

@Levi-Lesches Levi-Lesches marked this pull request as draft February 5, 2025 10:50
@lregueiferos lregueiferos force-pushed the auto-restart-systemd branch from 5db0115 to 6c76e35 Compare June 18, 2025 17:48
@github-actions github-actions bot added the pi-setup Changes to the Pi Setup label Jun 18, 2025
Gold872 pushed a commit that referenced this pull request Aug 13, 2025
Went from 5 FPS to 15 FPS

---------

Co-authored-by: Binghamton Rover <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pi-setup Changes to the Pi Setup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants