From: Matthias Fischer <matthias.fischer@ipfire.org>
To: development@lists.ipfire.org
Subject: Re: [PATCH 3/4] vnstat 2.6: New initscript
Date: Sat, 11 Apr 2020 16:42:52 +0200 [thread overview]
Message-ID: <3fb42aaa-1dd4-8184-5e57-88eb039f8492@ipfire.org> (raw)
In-Reply-To: <D75700AA-1009-4031-88C2-33CB61DA0B04@ipfire.org>
[-- Attachment #1: Type: text/plain, Size: 1849 bytes --]
Hi,
On 11.04.2020 10:56, Michael Tremer wrote:
> Hey,
>
>> On 10 Apr 2020, at 18:17, Matthias Fischer <matthias.fischer(a)ipfire.org> wrote:
>>
>> Added the new 'vnstatd' daemon to 'start' and 'stop' section.
>>
>> Signed-off-by: Matthias Fischer <matthias.fischer(a)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
>>
>
next prev parent reply other threads:[~2020-04-11 14:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-10 17:17 [PATCH 1/4] vnstat: Update to 2.6 Matthias Fischer
2020-04-10 17:17 ` [PATCH 2/4] traffic.cgi: Changed time interval for vnstat graphs from 5 to 1 minute Matthias Fischer
2020-04-10 17:17 ` [PATCH 3/4] vnstat 2.6: New initscript Matthias Fischer
2020-04-11 8:56 ` Michael Tremer
2020-04-11 14:42 ` Matthias Fischer [this message]
2020-04-10 17:17 ` [PATCH 4/4] makegraphs: 'vnstat -u' is no longer supported/needed Matthias Fischer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3fb42aaa-1dd4-8184-5e57-88eb039f8492@ipfire.org \
--to=matthias.fischer@ipfire.org \
--cc=development@lists.ipfire.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox