Ticket #249 (new enhancement)

Opened 3 years ago

Last modified 3 years ago

avahi-publish should die when stdin/stdout/stderr are closed

Reported by: DamjanGeorgievski Owned by: lennart
Milestone: Component: avahi-utils
Keywords: Cc:

Description

avahi-publish should die when stdin/stdout/stderr are closed.

Why? It's common to spawn avahi-publish from other apps or scripts, so that the app publishes itself on the network without the need to implement Zeroconf itself.

In most cases, when the parent app dies (ends normally or is killed) avahi-publish will be killed too.

Unless, it's killed by SIGKILL (or perhaps other non-catchable signals). Then avahi-publish continues to run, anounceing a service that doesn't exist.

Now, most apps could spawn avahi-publish so that it's stdin/stdout/stderr are pipes. When the parent is killed those pipes get closed, I think avahi-publish could check this and die.

Change History

Changed 3 years ago by DamjanGeorgievski

  • type changed from defect to enhancement
  • component changed from avahi-core to avahi-utils

poll-ing stdin for POLLHUP should do it.. I can send a patch probably

Note: See TracTickets for help on using tickets.