From owner-svn-ports-head@freebsd.org Sun Oct 30 10:03:29 2016 Return-Path: Delivered-To: svn-ports-head@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 C72B7C25EAA; Sun, 30 Oct 2016 10:03:29 +0000 (UTC) (envelope-from bsdkaffee@gmail.com) Received: from mail-lf0-x232.google.com (mail-lf0-x232.google.com [IPv6:2a00:1450:4010:c07::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5EA19C80; Sun, 30 Oct 2016 10:03:29 +0000 (UTC) (envelope-from bsdkaffee@gmail.com) Received: by mail-lf0-x232.google.com with SMTP id b75so84635732lfg.3; Sun, 30 Oct 2016 03:03:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=QMDfEYlM/XwUL/ScqT239hXatPay48nWiTFdBKqzKXw=; b=HeNZoebb9VbTZvE7Emhri3oi7O9YRGbzDAHbgkJMfxBzhA8B5+7omgjltoqU5MR/7x LUskEPXfQtcYOH3jAzajBB7zakwvA9Kud51zV66CDJ4D+kkW9HByfoLsOeiQiLC4QmEk LBccH58NaZU4S5oXKX3YW5qTOSOL+6zpMzG2PN2txq20t3+7KC8zoM7zsdemssVRF4n1 vboiN+2E+oEB8zYSmwxaBCGZDztnzeROs29PJEFim5NdpjFDuphE91oNC2F+NcVm0oJ7 knoeL3chf1DfYzUKT5tblSCnTPJzSrofL6Ck07SJpqCbxNldkpLnL8uomfKZLQmxiz0Y 5lRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=QMDfEYlM/XwUL/ScqT239hXatPay48nWiTFdBKqzKXw=; b=nAguHs9sBtH75rwOFShtOuULZzq+RNOGbIOyFu5xicFnCEjzuzcke0+u90YNYWDnwn l6ouAUEROVizIGIO1ZBalJ/UILYgeJOsJFLjR1uK1t08AzJau+4XFASymdw4r8mLz/K5 OhSY0SHQFFHZFXHVYNLlPmxRDHbO6tZAWnBL2lI1guzCsMWW0TWsLPyBT2Zd59xRseyF wW9hzyt5LSfhS7TirwFCoUDmOd/AjK992aSbTHUTwpIT/ZUhv+/57UNrcamc16BoQCrg oeGCZd5SbMhtsFQ8BPrn5LOGt1HU0B1oIINPlDgT+TDiKNzkX/9FV+OoRa1XGhQKD9bT 3iEA== X-Gm-Message-State: ABUngvfExAo9oR/IfjqVctynQ/uCt614cMecr9MyIvO/7Zs+CwdIQbLrFiDqRJKFPrjoIAOJZ97eCar6MadxoA== X-Received: by 10.25.134.139 with SMTP id i133mr14258267lfd.27.1477821807120; Sun, 30 Oct 2016 03:03:27 -0700 (PDT) MIME-Version: 1.0 Sender: bsdkaffee@gmail.com Received: by 10.25.201.215 with HTTP; Sun, 30 Oct 2016 03:03:26 -0700 (PDT) In-Reply-To: <36d194e7-63e4-e608-c0fa-0362728be8e8@FreeBSD.org> References: <201610300922.u9U9MFZO060895@repo.freebsd.org> <36d194e7-63e4-e608-c0fa-0362728be8e8@FreeBSD.org> From: "Jason E. Hale" Date: Sun, 30 Oct 2016 06:03:26 -0400 X-Google-Sender-Auth: 2J_tX0p-vv3Eqp1uxqEvn30yrkw Message-ID: Subject: Re: svn commit: r424939 - in head/sysutils/cbsd: . files To: Mathieu Arnold Cc: ports-committers , "svn-ports-all@freebsd.org" , "svn-ports-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2016 10:03:29 -0000 On Sun, Oct 30, 2016 at 5:39 AM, Mathieu Arnold 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