A command line argument or environment variable to disable automatic restarts (treat all non-error returns as exit
). This would allow for other tooling to react to failures, as well as better manage the lifecycle of klippy. Cases where klippy is exiting, expecting to be restarted, would be indicated by a special exit code (e.g. 100).
What do you mean by automatic restarts? As far as I know, Klipper doesn’t restart automatically; I’ve never seen it do that.
Are you by any chance using OctoPrint? If I recall correctly, OctoPrint sends an M112 whenever it sees an error, and after an M112, you need to restart the firmware. Even those errors that you can recover from, like unaccepted movement requests outside the printer limits. If that’s the case, you could disable that “M112” error, but you should read up on it and do it at your own risk.
I guess I should clarify my the background for this. I was toying around with making a daemon that manages the lifecycle of klipper and associated MCUs, and running tasks on a printer restart (such as gathering additional diagnostic info) would be nice, as well as other maintenance operations (such as automatic updates when the printer is idle, if configured)