unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: EuAndreh <eu@euandre.org>
To: help-guix <Help-Guix@gnu.org>
Subject: Manual: why not restart service over killing the process
Date: Sat, 28 Nov 2020 11:58:03 -0300	[thread overview]
Message-ID: <87k0u5msuc.fsf@euandre.org> (raw)

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.


             reply	other threads:[~2020-11-28 15:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-28 14:58 EuAndreh [this message]
2020-11-28 15:44 ` Manual: why not restart service over killing the process Christopher Baines
2020-11-28 21:51   ` EuAndreh
2020-11-29 14:01   ` Jason Conroy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k0u5msuc.fsf@euandre.org \
    --to=eu@euandre.org \
    --cc=Help-Guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).