Effectively, you should just be able to replace startup with on startup, and shutdown with on shutdown.
Caddy doesn’t process scripts on its own; it needs a program to execute them, then feed the result back to Caddy to pass on to the connecting client.
I’m not familiar with spawn-fcgi specifically, but based on its command flags, I’m guessing it starts such a program in the background and instructs it to listen on /tmp/smokeping_cgi.sock.
The fastcgi directive later on in the Caddyfile tells Caddy that all requests should be proxied to that program so that it can run the script, /srv/http/smokeping/smokeping.fcgi.dist, and return its results to the client.
The shutdown command just stops that program running in the background when Caddy shuts down, so it’s not running forever.
Now, neither the guide nor the gist mention spawn-fcgi, so I’m not sure if you have that installed or not. If not, you could look at doing things the nginx way and use fcgiwrap. That would entail ensuring that the fcgiwrap service is running, removing the startup and shutdown commands entirely, and changing the socket to unix:/var/run/fcgiwrap.sock.
Hmm. Looking deeper, I think I was wrong to advise keeping ext, split, and index in; We really just want all requests to go to Smokeping via FastCGI regardless of URI, and we don’t want to depend on the URI for the script filename. I’m thinking we’ll want to move along the lines of this: