From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32957) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eslTb-0008Nr-CK for guix-patches@gnu.org; Mon, 05 Mar 2018 03:28:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eslTX-00086w-BA for guix-patches@gnu.org; Mon, 05 Mar 2018 03:28:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:37137) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eslTX-00086g-6C for guix-patches@gnu.org; Mon, 05 Mar 2018 03:28:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eslTW-0006lx-Ls for guix-patches@gnu.org; Mon, 05 Mar 2018 03:28:02 -0500 Subject: [bug#30701] [PATCH 2/4] services: Use a external pid file for PostgreSQL. Resent-Message-ID: References: <20180304191633.20262-1-mail@cbaines.net> <20180304191633.20262-2-mail@cbaines.net> <87k1urz7jh.fsf@lassieur.org> <87k1uroru8.fsf@cbaines.net> From: Christopher Baines In-reply-to: <87k1uroru8.fsf@cbaines.net> Date: Mon, 05 Mar 2018 08:27:55 +0000 Message-ID: <87inaborjo.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Cc: 30701@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Christopher Baines writes: > Cl=C3=A9ment Lassieur writes: > >> Plus, there is no reason to use make-forkexec-constructor on pg_ctl >> because pg_ctl returns after it has checked that the daemon is running. >> For the same reason, Shepherd doesn't need to know about Postgres' PID. >> All the hard work is done by pg_ctl. > > As the comment I made at the top, I did this when I was writing the > system test. If you remove this patch, when you call (start-service > 'postgres), it will return #f if the service starts successfully. If you > tweak the service to make it fail to start (e.g. by changing the "start" > action to something else), you get the same observable behaviour, > start-service returns #f. > > The way this works for other services, normally through > make-forkexec-constructor is that calling start-service will return the > PID. > > While the system test does still add some value even without checking if > the service has started, doing so would be really good. Even if it's not > using the PID file approach, maybe the exit code of pg_ctl could be > used? I'm not really sure why it isn't working like that already, as > invoke usually returns either #t or #f... Ah, I've just realised why this is the case, I was misreading the system test results, it does actually return #t/#f, but as the system test was expecting a number, it just returns #f to indicate failure. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlqc/4tfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9Xf4hQ//aiNn3T2pacYGLKmT0rHiiIC3WJvaChs3H2p9D1eSg4FowDV26IsJfmT/ stjmgGcqIQ3cv6tyycfXcYQSxOhJsw5NXN+rHDXOXfpHwb/RqxBjgXk79OWwZ3Tr BbJ+0vzzx8cY+bePbtNenhHNiLDs9b+oPoqEiCvOq/We8zz3/9EmJqx3CvztGhc6 7ps9iFZ9lsWLrf5tk/2q2ff+ogXKVfTVF72wZdnFLGPshA60WduT4kDZEZp7qVPN Mzo4ersRaF8rlOH3nUMdqzK1kFVMt65T5NQx23pbv3mSFxz5zmk5NP/OjkNsmnM8 DRKSeT3BkpTYFHt9fZCQjnZ4n/R2Pdb25t3FVlF2Hls/9PdHCK6ar62oRANAeHwd tuG5c2ZQO7QGV7o8gaF5nuW2ZtlP+ijljCmZ6wEQxymAP7ojeRYlsFojCqv6uYMw P7nc2OedYRaUHfP6/BBkRn0FktOrh8DuVjHvAzbzGXx6Y+V6nN3m2qzhk7+gDFqg SuMfMSoXVlOMpSTFLYt30vTN+2VmnQq/ByKThqPYYMMWcAB1p0Y/QIcDgwHOmtab OKPrdlHhI3d7iE31JXyJk5hWfwxvXN5jD4Vri8W75EkTXaujNoK7JMoW5hqKYj5W Xv/kafDaMY6En/e7jqFULYtWxKa/S/jcRCUOvoEiF49NxogWqH0= =50nr -----END PGP SIGNATURE----- --=-=-=--