Best way to run a custom script during OctoPrint startup?

What is the problem?

I'm an experienced developer but a newbie with OctoPrint, so I don't yet have a good mental model of the software architecture and signal flow. Whenever OctoPrint starts up, I'd like to be able to trigger a script to launch some of my own tools in the background, but I don't want to hack something together of my own if there's already a standard way to do this.

I've looked through the documentation and forums without seeing anything obvious, and I don't see any plug-ins that do it either. Is there some existing mechanism I haven't found yet, or a method other people are using to accomplish this?

FTR, I'm running OctoPrint 1.5.3 on OctoPi 0.18.0 under Python 3.7.3 on a 3B+.

You could use the Event System, for the Startup event.

Otherwise, you could go low-level with the systemd stuff, and create a service file that waits for OctoPrint to start.

Ah. I'd seen passing references to event triggers elsewhere and assumed it was a code-level mechanism for registering callback routines. That looks like exactly what I'm looking for. Thanks.