From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: Re: [PATCH 3/4] vnstat 2.6: New initscript Date: Sat, 11 Apr 2020 09:56:00 +0100 Message-ID: In-Reply-To: <20200410171711.3902-3-matthias.fischer@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3610740608405544137==" List-Id: --===============3610740608405544137== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hey, > On 10 Apr 2020, at 18:17, Matthias Fischer = wrote: >=20 > Added the new 'vnstatd' daemon to 'start' and 'stop' section. >=20 > Signed-off-by: Matthias Fischer > --- > src/initscripts/system/vnstat | 13 +++++++++++++ > 1 file changed, 13 insertions(+) >=20 > diff --git a/src/initscripts/system/vnstat b/src/initscripts/system/vnstat > index 363307013..bcc19c3ab 100755 > --- a/src/initscripts/system/vnstat > +++ b/src/initscripts/system/vnstat > @@ -17,15 +17,28 @@ case "$1" in > mount_ramdisk "${VNSTATLOG}" > evaluate_retval > fi > + > + boot_mesg "Starting vnstatd..." > + loadproc /usr/sbin/vnstatd -d --alwaysadd > + sleep 2 > + evaluate_retval What is the sleep operation necessary for? Also, evaluate_retval will now always consider the return code of =E2=80=9Csl= eep=E2=80=9D which is probably not what we want here. We want to see when lau= nching vnstatd fails. Also, loadproc will already take care of printing =E2=80=9COK=E2=80=9D or =E2= =80=9CERROR=E2=80=9D. > ;; > + > stop) > + boot_mesg "Stopping vnstatd..." > + killproc /usr/sbin/vnstatd > + sleep 2 > + evaluate_retval Same here. It delays the shutdown operation unnecessarily. Best, -Michael > + > umount_ramdisk "${VNSTATLOG}" > ;; > + > restart) > ${0} stop > sleep 1 > ${0} start > ;; > + > backup) > # Backup all data if ramdisk is used > if mountpoint "${RRDLOG}" &>/dev/null; then > --=20 > 2.18.0 >=20 --===============3610740608405544137==--