Add startup event
(Caddy 1 had an on startup directive that was very convenient to start php-fpm. The new process would get marked as a child process and when I clicked the close button it the child process would get killed.)
Caddy 2 has { events { on ... exec ... } } but unfortunately there is no startup event.
It should be relatively easy to add such an event to Caddy itself? I tried implementing it as a plugin, but it is surprisingly difficult to make a plugin that has no config but still gets caddy.Context, which is needed to get the events app and fire the event.
What's the use case? Normally it's not useful to know when the process started because you are typically the one who starts it.
I would bind an exec handler to it, which would then start php-fpm.
That way I just need to double-click Caddy to start both Caddy and PHP and, more importantly, php-fpm will be a child process of Caddy, so when I click the X to close the Caddy window, it will kill the PHP process as well.