From: John Darrington <john@darrington.wattle.id.au>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] write the daemon's pid to a file.el
Date: Sun, 8 Dec 2013 17:06:36 +0100 [thread overview]
Message-ID: <20131208160636.GA17431@intra> (raw)
In-Reply-To: <87zjobz777.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 1694 bytes --]
Debian uses a script and a program start-stop-daemon. FRom the man page:
Note: unless --pidfile is specified, start-stop-daemon behaves similar to killall(1). start-stop-daemon will scan the
process table looking for any processes which match the process name, uid, and/or gid (if specified). Any matching process
will prevent --start from starting the daemon. All matching processes will be sent the TERM signal (or the one specified via
--signal or --retry) if --stop is specified. For daemons which have long-lived children which need to live through a --stop,
you must specify a pidfile.
Of course, one can get the pid by doing
guix-daemon --blah-blah &
pid=$!
But the problem here is that the & means you never know when the daemon has actually started,
which leads to race conditions. Again, there are tricks to work around that, but having the daemon
write its own pid makes it a lot easier.
J'
On Sun, Dec 08, 2013 at 04:35:40PM +0100, Ludovic Courtès wrote:
John Darrington <john@darrington.wattle.id.au> skribis:
> I don't know what you will think of this patch. But I found that it makes
> running guix under debian a whole lot easier. I suspect the same will be
> true for many other OSes too.
How does it help exactly? On GNU, it’s started by dmd, which knows its PID.
I’d expect it to be the same with other init systems, no?
Thanks,
Ludo’.
--
PGP Public key ID: 1024D/2DE827B3
fingerprint = 8797 A26D 0854 2EAB 0285 A290 8A67 719C 2DE8 27B3
See http://sks-keyservers.net or any PGP keyserver for public key.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
prev parent reply other threads:[~2013-12-08 16:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-08 11:13 [PATCH] write the daemon's pid to a file John Darrington
2013-12-08 15:35 ` Ludovic Courtès
2013-12-08 16:06 ` John Darrington [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131208160636.GA17431@intra \
--to=john@darrington.wattle.id.au \
--cc=guix-devel@gnu.org \
--cc=ludo@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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.