Return-Path: X-Original-To: apmail-commons-user-archive@www.apache.org Delivered-To: apmail-commons-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0AF76C8ED for ; Sat, 28 Apr 2012 08:53:05 +0000 (UTC) Received: (qmail 78533 invoked by uid 500); 28 Apr 2012 08:53:04 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 78327 invoked by uid 500); 28 Apr 2012 08:53:01 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 78294 invoked by uid 99); 28 Apr 2012 08:52:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Apr 2012 08:52:59 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [78.46.220.69] (HELO pf0hl.de) (78.46.220.69) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Apr 2012 08:52:51 +0000 Received: from localhost.localdomain (unknown [164.40.196.242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by pf0hl.de (Postfix) with ESMTPSA id 85AC310044C for ; Sat, 28 Apr 2012 10:52:27 +0200 (CEST) Date: Sat, 28 Apr 2012 10:52:31 +0200 From: Robert =?UTF-8?Q?Heum=C3=BCller?= To: user@commons.apache.org Subject: [Exec/Daemon/?] Discover if daemon is active Message-ID: <20120428105231.011d2e31@heum.de> In-Reply-To: References: X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi there, I'm sorry about the imprecise category tag. In my current project I use commons.exec in order to launch instances of avahi-publish and avahi-browse. Thanks to the help I received here so far everything seems to be working nicely :) Obviously the avahi-* binaries depend on the avahi-daemon to be active. How do I determine if a daemon is active? I have several ideas, but I'm not sure whether they will work on any UNIX/Linux distribution. 1) Search /var/run for avahi or avahi-daemon (on archlinux it would be in /var/run/daemons) 2) Exec ps -ef | grep avahi and parse output (should work on any posix compatible system?) The second alternative seems rather failsafe to me, but maybe you can surprise me with a more elegant solution with less overhead? Thank you for your time and effort --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org