Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Oct 2016 10:39:47 +0100
From:      Mathieu Arnold <mat@FreeBSD.org>
To:        "Jason E. Hale" <jhale@FreeBSD.org>, ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   Re: svn commit: r424939 - in head/sysutils/cbsd: . files
Message-ID:  <36d194e7-63e4-e608-c0fa-0362728be8e8@FreeBSD.org>
In-Reply-To: <201610300922.u9U9MFZO060895@repo.freebsd.org>
References:  <201610300922.u9U9MFZO060895@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--qtku9cbqWcdCwA4xFAIVbOWQUrP7470xA
Content-Type: multipart/mixed; boundary="HlESu8Tusa0nq3DhgKwWhPasGVO0PQkjg";
 protected-headers="v1"
From: Mathieu Arnold <mat@FreeBSD.org>
To: "Jason E. Hale" <jhale@FreeBSD.org>, 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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?36d194e7-63e4-e608-c0fa-0362728be8e8>