Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Jörg Krause" <jkrause@posteo.de>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] package/dnsmasq: let init script cleanup stale pidfile
Date: Tue, 09 Dec 2014 22:58:36 +0100	[thread overview]
Message-ID: <1418162316.880.1.camel@posteo.de> (raw)
In-Reply-To: <54876E2C.6060208@zacarias.com.ar>

On Di, 2014-12-09 at 18:48 -0300, Gustavo Zacarias wrote:
> On 12/09/2014 06:35 PM, J?rg Krause wrote:
> 
> > I want to check in a script if the dnsmasq daemon is running by testing
> > for the existence of the pid file.
> 
> Generally speaking it's bad practice to just check the pidfile to know
> if some daemon is running, because if it dies unexpectedly you'll still
> have the pidfile around.
> You should probably use a double check of pidfile and match the process,
> something like (in shell):
> 
> grep dnsmasq /proc/`cat /var/run/dnsmasq.pid`/cmdline >/dev/null 2>&1 &&
> echo "YES" || echo "NO"

I thought so. I've seen it in some other scripts... Many thanks for the
advice!

  reply	other threads:[~2014-12-09 21:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-15 16:27 [Buildroot] [PATCH 1/1] package/dnsmasq: let init script cleanup stale pidfile Jörg Krause
2014-12-09 20:04 ` Gustavo Zacarias
2014-12-09 21:35   ` Jörg Krause
2014-12-09 21:48     ` Gustavo Zacarias
2014-12-09 21:58       ` Jörg Krause [this message]
2014-12-10 20:56         ` Gustavo Zacarias

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=1418162316.880.1.camel@posteo.de \
    --to=jkrause@posteo.de \
    --cc=buildroot@busybox.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