You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Robert Heumüller <ma...@heum.de> on 2012/04/28 10:52:31 UTC

[Exec/Daemon/?] Discover if daemon is active

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