Hi!
The manual suggests a deploy-hook for the certbot-service-type that
looks like this:
(define %nginx-deploy-hook
(program-file
"nginx-deploy-hook"
#~(let ((pid (call-with-input-file "/var/run/nginx/pid" read)))
(kill pid SIGHUP))))
Instead of requiring the deploy-hook to know the path of the PID file,
why not restart the Shepherd service instead? Something like this:
(define %nginx-deploy-hook
(program-file
"nginx-deploy-hook"
(with-imported-modules '((gnu services herd))
#~(begin
(use-modules (gnu services herd))
(restart-service 'nginx)))))
If I understood correctly, those would result in equivalent outcomes,
and I tend to find the latter a more elegant approach. It is a bit
longer, but I like more restarting the service rather than killing the
process. Is there any downside I'm missing?
I can send a patch to the manual if this seems reasonable.