Message ID | 20200410171711.3902-3-matthias.fischer@ipfire.org |
---|---|
State | Accepted |
Commit | 5a5de3f0269983bec1d7ffc9f4019b96b1c560a0 |
Headers |
Return-Path: <development-bounces@lists.ipfire.org> Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 48zPpF3GCPz3yBt for <patchwork@web04.haj.ipfire.org>; Fri, 10 Apr 2020 17:17:25 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 48zPpB6rdLz1XQ; Fri, 10 Apr 2020 17:17:22 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 48zPpB0Zgvz2xgV; Fri, 10 Apr 2020 17:17:22 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 48zPp70Ygcz2xq9 for <development@lists.ipfire.org>; Fri, 10 Apr 2020 17:17:19 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 48zPp669y9z2jl for <development@lists.ipfire.org>; Fri, 10 Apr 2020 17:17:18 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1586539038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:in-reply-to:in-reply-to:references:references; bh=24FBiBVMzMfYXDS1LrzbQnW/RxFo2VBMhsd6OvtQNns=; b=I23praGKiZsFOzTC+n0D5Yh5S2sLZn9DxBjzWEfhqVqZNpXfDHaSWCZGVSK3l78Jg6KF4Z RFe/mfhE/dBROXDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1586539038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:in-reply-to:in-reply-to:references:references; bh=24FBiBVMzMfYXDS1LrzbQnW/RxFo2VBMhsd6OvtQNns=; b=c/OWdDaydbyCOWW7b/8J/a+YO1bBiJcUNtNHP68OKXv/zKFyhTU3z33e1SX61g3jZGVGnO iU56vGMi6crAzt38Z/azpdPe9oEnPYeZSMVoSPMFAYcQO9UI2NQb0VMOPMPtxiE5NubgT6 pFmzPccFdjvuvhyaEafWLWJjghsMLzsPx5e3X5rkrLWALnPkbKdbCAvVTOhvi2QcfitksM sacI35UooxNZmzjdB1qvctCRCjzDtOmDSt3peDj/ycLNg4yJw+AXdAoqNNSXwat+K28z/Y 6yImmZ6ya4HikItMYmGOde5H7Qy7T2tLl2MwSmR/zzAV6pXEDHdePJowp8DlAw== From: Matthias Fischer <matthias.fischer@ipfire.org> To: development@lists.ipfire.org Subject: [PATCH 3/4] vnstat 2.6: New initscript Date: Fri, 10 Apr 2020 19:17:10 +0200 Message-Id: <20200410171711.3902-3-matthias.fischer@ipfire.org> In-Reply-To: <20200410171711.3902-1-matthias.fischer@ipfire.org> References: <20200410171711.3902-1-matthias.fischer@ipfire.org> Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=matthias.fischer@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk <development.lists.ipfire.org> List-Unsubscribe: <https://lists.ipfire.org/mailman/options/development>, <mailto:development-request@lists.ipfire.org?subject=unsubscribe> List-Archive: <http://lists.ipfire.org/pipermail/development/> List-Post: <mailto:development@lists.ipfire.org> List-Help: <mailto:development-request@lists.ipfire.org?subject=help> List-Subscribe: <https://lists.ipfire.org/mailman/listinfo/development>, <mailto:development-request@lists.ipfire.org?subject=subscribe> Errors-To: development-bounces@lists.ipfire.org Sender: "Development" <development-bounces@lists.ipfire.org> |
Series | [1/4] vnstat: Update to 2.6 | |
Commit Message
Matthias Fischer
April 10, 2020, 5:17 p.m. UTC
Added the new 'vnstatd' daemon to 'start' and 'stop' section.
Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
---
src/initscripts/system/vnstat | 13 +++++++++++++
1 file changed, 13 insertions(+)
Comments
Hey, > On 10 Apr 2020, at 18:17, Matthias Fischer <matthias.fischer@ipfire.org> wrote: > > Added the new 'vnstatd' daemon to 'start' and 'stop' section. > > Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org> > --- > src/initscripts/system/vnstat | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > 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 “sleep” which is probably not what we want here. We want to see when launching vnstatd fails. Also, loadproc will already take care of printing “OK” or “ERROR”. > ;; > + > 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 > -- > 2.18.0 >
Hi, On 11.04.2020 10:56, Michael Tremer wrote: > Hey, > >> On 10 Apr 2020, at 18:17, Matthias Fischer <matthias.fischer@ipfire.org> wrote: >> >> Added the new 'vnstatd' daemon to 'start' and 'stop' section. >> >> Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org> >> --- >> src/initscripts/system/vnstat | 13 +++++++++++++ >> 1 file changed, 13 insertions(+) >> >> 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? 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 “sleep” which is probably not what we want here. We want to see when launching vnstatd fails. I see. Ok. > Also, loadproc will already take care of printing “OK” or “ERROR”. Changed => deleted 'sleep 2' => https://patchwork.ipfire.org/patch/2935/ Best, Matthias > >> ;; >> + >> 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 >> -- >> 2.18.0 >> >
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 ;; + stop) + boot_mesg "Stopping vnstatd..." + killproc /usr/sbin/vnstatd + sleep 2 + evaluate_retval + umount_ramdisk "${VNSTATLOG}" ;; + restart) ${0} stop sleep 1 ${0} start ;; + backup) # Backup all data if ramdisk is used if mountpoint "${RRDLOG}" &>/dev/null; then