supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Charlie Brady <charlieb-smarden-supervision@budge.apana.org.au>
To: Wayne Marshall <wcm@b0llix.net>
Cc: harish badrinath <harishbadrinath@gmail.com>,
	supervision@list.skarnet.org
Subject: Re: What is the process group hack
Date: Thu, 26 Apr 2012 15:02:26 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.1204261459390.11595@e-smith.charlieb.ott.istop.com> (raw)
In-Reply-To: <20120426202753.1cc24411@b0llix.net>


On Thu, 26 Apr 2012, Wayne Marshall wrote:

> fghack is djb's "anti-backgrounding" utility.  It invokes
> strangeness and mysteries to inhibit a process from forking into
> the background.

No, it doesn't change anything about the way the process operates. It just 
starts the process in a child process, and attempts to stay around until 
that process exits. 

See the description here:

http://cr.yp.to/daemontools/faq/create.html

fghack creates a pipe from the daemon and reads data until the pipe is 
closed. Normally all the daemon's descendants will inherit the open pipe 
from the daemon, so the pipe will not be closed until they all exit.

However, fghack will exit early if the daemon goes out of its way to close 
extra descriptors. A few of these daemons leave descriptor 0 open, even 
though they do not use descriptor 0; so

     #!/bin/sh
     exec fghack baddaemon <&-

might work. 


  reply	other threads:[~2012-04-26 19:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-26 15:15 harish badrinath
2012-04-26 15:52 ` Mike Buland
2012-04-26 18:27 ` Wayne Marshall
2012-04-26 19:02   ` Charlie Brady [this message]
2012-04-27  1:20   ` Laurent Bercot

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=Pine.LNX.4.64.1204261459390.11595@e-smith.charlieb.ott.istop.com \
    --to=charlieb-smarden-supervision@budge.apana.org.au \
    --cc=harishbadrinath@gmail.com \
    --cc=supervision@list.skarnet.org \
    --cc=wcm@b0llix.net \
    /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 NNTP newsgroup(s).