Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Aug 2020 11:40:41 -0500
From:      "Brandon Bergren" <bdragon@FreeBSD.org>
To:        "FreeBSD Hackers" <freebsd-hackers@freebsd.org>
Subject:   Re: pidfile_open() usage in "mount"
Message-ID:  <dcf65725-af6f-4a89-bcac-b1ca46d49cae@www.fastmail.com>
In-Reply-To: <20200826144013.GV2551@kib.kiev.ua>
References:  <CABXB=RRM7YusQL1gGVGD4s9xi9AB4F5AR5-Jqbp4G1WTZWWA%2BQ@mail.gmail.com> <20200826144013.GV2551@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
> I think that a new libutil/pidfile.c function, to open only existing
> pid file, is the right approach.

The pidfile_* stuff is meant for the daemon side.

Why not just regular open(2)? If we're gonna be using the pid (as opposed to some sort of proper control socket) to figure out what to signal, it's gonna be inherently racy, and just plain opening it and reading out the pid isn't going to be better or worse than a utility call that does the same thing.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?dcf65725-af6f-4a89-bcac-b1ca46d49cae>