Date: Sun, 30 Oct 2016 06:03:26 -0400 From: "Jason E. Hale" <jhale@freebsd.org> To: Mathieu Arnold <mat@freebsd.org> Cc: ports-committers <ports-committers@freebsd.org>, "svn-ports-all@freebsd.org" <svn-ports-all@freebsd.org>, "svn-ports-head@freebsd.org" <svn-ports-head@freebsd.org> Subject: Re: svn commit: r424939 - in head/sysutils/cbsd: . files Message-ID: <CAJE75NHE1G2ZyDpEFyK2TQ6WVWriqzZ5TwzXGDUVvR2xcuxGsA@mail.gmail.com> In-Reply-To: <36d194e7-63e4-e608-c0fa-0362728be8e8@FreeBSD.org> References: <201610300922.u9U9MFZO060895@repo.freebsd.org> <36d194e7-63e4-e608-c0fa-0362728be8e8@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Oct 30, 2016 at 5:39 AM, Mathieu Arnold <mat@freebsd.org> wrote: > Le 30/10/2016 =C3=A0 10:22, Jason E. Hale a =C3=A9crit : >> >> 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 >> } >> >> cbsdd_reload() >> { >> - [ -f "${pidfile}" ] && kill -9 $( /bin/cat ${pidfile} ) > /dev/nul= l 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 >> } >> >> +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" >> I've forwarded your message to the maintainer, and I'll see what he has to say about it since he made these changes upstream as well. -Jason
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJE75NHE1G2ZyDpEFyK2TQ6WVWriqzZ5TwzXGDUVvR2xcuxGsA>