From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthias Fischer To: development@lists.ipfire.org Subject: Re: [PATCH 3/4] vnstat 2.6: New initscript Date: Sat, 11 Apr 2020 16:42:52 +0200 Message-ID: <3fb42aaa-1dd4-8184-5e57-88eb039f8492@ipfire.org> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5406534687163929174==" List-Id: --===============5406534687163929174== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi, On 11.04.2020 10:56, Michael Tremer wrote: > Hey, >=20 >> 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 >=20 > What is the sleep operation necessary for? Thinking about it, I thought it could be necessary to give the script a little time to complete... > Also, evaluate_retval will now always consider the return code of =E2=80=9C= sleep=E2=80=9D which is probably not what we want here. We want to see when l= aunching vnstatd fails. I see. Ok. > Also, loadproc will already take care of printing =E2=80=9COK=E2=80=9D or = =E2=80=9CERROR=E2=80=9D. Changed =3D> deleted 'sleep 2' =3D> https://patchwork.ipfire.org/patch/2935/ Best, Matthias >=20 >> ;; >> + >> stop) >> + boot_mesg "Stopping vnstatd..." >> + killproc /usr/sbin/vnstatd >> + sleep 2 >> + evaluate_retval >=20 > Same here. It delays the shutdown operation unnecessarily. >=20 > Best, > -Michael >=20 >> + >> 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 >=20 --===============5406534687163929174==--