mdnsd icon indicating copy to clipboard operation
mdnsd copied to clipboard

Write pidfile on startup

Open nxg opened this issue 7 years ago • 3 comments

It would be nice if mdnsd wrote its PID to a /var/run file, so that the daemon can be conveniently killed within an rc script.

It would appear that calling pidfile(3) somewhere near the beginning of main would be sufficient to set this up rather nicely.

nxg avatar Nov 08 '17 19:11 nxg

pidfile(3) is not POSIX, actually non of my systems have it.

But yes, writing a pidfile would be nice, I'll get to it once I find sometime.

haesbaert avatar Nov 24 '17 10:11 haesbaert

It's not in POSIX, no, but it appears to be in OpenBSD.

That would of course create a problem for the downstream port to FreeBSD, which is the one I'd be interested in; but my impression (not sure where from, now!) was that you were targeting OpenBSD, so guessed you might be OK with a distro-specific solution.

nxg avatar Nov 24 '17 10:11 nxg

ha ! you're right.

Well I don't maintain the freebsd port, so that's their issue.

haesbaert avatar Nov 24 '17 11:11 haesbaert