From owner-svn-ports-all@freebsd.org Sun Oct 30 09:39:53 2016 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0783CC25703; Sun, 30 Oct 2016 09:39:53 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from prod2.absolight.net (mx3.absolight.net [IPv6:2a01:678:2:100::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "plouf.absolight.net", Issuer "CAcert Class 3 Root" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E9B7D40; Sun, 30 Oct 2016 09:39:52 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from prod2.absolight.net (localhost [127.0.0.1]) by prod2.absolight.net (Postfix) with ESMTP id CC7B4BDD09; Sun, 30 Oct 2016 10:39:49 +0100 (CET) Received: from atuin.in.mat.cc (atuin.in.mat.cc [79.143.241.205]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by prod2.absolight.net (Postfix) with ESMTPSA id A3CDABDD03; Sun, 30 Oct 2016 10:39:49 +0100 (CET) Subject: Re: svn commit: r424939 - in head/sysutils/cbsd: . files To: "Jason E. Hale" , ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org References: <201610300922.u9U9MFZO060895@repo.freebsd.org> From: Mathieu Arnold Organization: Absolight / The FreeBSD Foundation Message-ID: <36d194e7-63e4-e608-c0fa-0362728be8e8@FreeBSD.org> Date: Sun, 30 Oct 2016 10:39:47 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <201610300922.u9U9MFZO060895@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qtku9cbqWcdCwA4xFAIVbOWQUrP7470xA" X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2016 09:39:53 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --qtku9cbqWcdCwA4xFAIVbOWQUrP7470xA Content-Type: multipart/mixed; boundary="HlESu8Tusa0nq3DhgKwWhPasGVO0PQkjg"; protected-headers="v1" From: Mathieu Arnold To: "Jason E. Hale" , ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Message-ID: <36d194e7-63e4-e608-c0fa-0362728be8e8@FreeBSD.org> Subject: Re: svn commit: r424939 - in head/sysutils/cbsd: . files References: <201610300922.u9U9MFZO060895@repo.freebsd.org> In-Reply-To: <201610300922.u9U9MFZO060895@repo.freebsd.org> --HlESu8Tusa0nq3DhgKwWhPasGVO0PQkjg Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Le 30/10/2016 =C3=A0 10:22, Jason E. Hale a =C3=A9crit : > =20 > cbsdd_stop() > { > - [ -f "${pidfile}" ] && kill -9 $( /bin/cat ${pidfile} ) > + if [ -f "${pidfile}" ]; then > + kill -9 $( /bin/cat ${pidfile} ) This should be pkill -9 -f ${pidfile} > + /bin/rm -f ${pidfile} > + fi > } > =20 > cbsdd_reload() > { > - [ -f "${pidfile}" ] && kill -9 $( /bin/cat ${pidfile} ) > /dev/null 2= >&1 > + if [ -f "${pidfile}" ]; then > + kill -9 $( /bin/cat ${pidfile} ) > /dev/null 2>&1 > + /bin/rm -f ${pidfile} > + fi > run_rc_command "start" I think this should simply be run_rc_command "restart" but then, it is semantically wrong, reload means tell the process "hey, reload your config" or something, not stop/start, that is restart :-) > exit 0 > } > =20 > +cbsdd_status() > +{ > + if [ -f "${pidfile}" ]; then > + pids=3D$( /bin/cat ${pidfile} ) > + echo "${name} is running as pid ${pids}." > + else > + echo "${name} is not running." > + return 1 > + fi > +} This is somewhat wrong, it checks that the pid file exists, but this file existing does not mean the process is there, it should at least be something like: if [ -f "${pidfile}" ] && pgrep -F ${pidfile} -q; > run_rc_command "$1" > > --=20 Mathieu Arnold --HlESu8Tusa0nq3DhgKwWhPasGVO0PQkjg-- --qtku9cbqWcdCwA4xFAIVbOWQUrP7470xA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJYFb/kXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQzQUI2OTc4OUQyRUQxMjEwNjQ0MEJBNUIz QTQ1MTZGMzUxODNDRTQ4AAoJEDpFFvNRg85IpmMQALFpcHg+Tlh3AepB4JXiFjTq VcF8NKOtG8Ilu+7YOehmU3WKhUV2ZjbhXvl/dK9a7NL/nSLbruA/a9bo7a2Zouq3 Wn8D2Mk9Cf//sj+DB+/Kte5Hsv+KVBLE6/qSVs0iVhrx57p6wiT8e9zq8ptFhNvI ZGAwgYYx4zs+JufQyRGr9njJoqgRQzBNngGOCJx/Vv0jM++Lw5nGQBqw5sCRxpYJ jAXnNBgfPMia4LYXvhho4SgWLlxsdoG9AvfynVPZaPXe8ZJBGx7/QEo251eDXZPt gA3P3I9dq7aPdO7qlLjcERXk5/TIuXwh7dqNlZPgyemqcLZXetIfgdjO/n2Vrckr vIkTplC3y56oBIOMv1NuJufiP2oyq/FH0ifs3/x594VQcEhtnMdrrUe4a6MqQxPx 9pZ4ASkdoMCyRWcvPfW5H7C0fKWABY++tBmeK1qYXhNSQOEiZzUdaOtdkspxZod1 rXMgGnaka1ElbszJRE0tYdUl3V1LMot687hKUMyrgU5/9OAxZLDeI4a7X5bFPLla NyavlX2YG03PArT1hbD8q5rPfK0win3HqxAKMIaKE6Reo6NIJBTCmAt8LwCtOkrB brq2HVbv7MmTgIkD64jnlZpcQEamylhXQo21iH7RxvqyVMxkp2Ccq+Mu9AZgnViY UduR4MaywraID5i/UHKO =VgpZ -----END PGP SIGNATURE----- --qtku9cbqWcdCwA4xFAIVbOWQUrP7470xA--