Deleted 'vnstat' calls in initscripts - those options were removed and we're using 'vnstatd', not 'vnstat'.

Message ID 20220407154318.1803-1-matthias.fischer@ipfire.org
State Superseded
Headers
Series Deleted 'vnstat' calls in initscripts - those options were removed and we're using 'vnstatd', not 'vnstat'. |

Commit Message

Matthias Fischer April 7, 2022, 3:43 p.m. UTC
  Fixes: #12831

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
---
 src/initscripts/networking/any |  5 -----
 src/initscripts/networking/red | 14 +-------------
 2 files changed, 1 insertion(+), 18 deletions(-)
  

Comments

Michael Tremer April 7, 2022, 3:53 p.m. UTC | #1
Hello Matthias,

Thanks for this patch.

Could you please elaborate a little bit more about why those commands are not needed any more?

-Michael

> On 7 Apr 2022, at 16:43, Matthias Fischer <matthias.fischer@ipfire.org> wrote:
> 
> Fixes: #12831
> 
> Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
> ---
> src/initscripts/networking/any |  5 -----
> src/initscripts/networking/red | 14 +-------------
> 2 files changed, 1 insertion(+), 18 deletions(-)
> 
> diff --git a/src/initscripts/networking/any b/src/initscripts/networking/any
> index 0facf23d8..15197badb 100644
> --- a/src/initscripts/networking/any
> +++ b/src/initscripts/networking/any
> @@ -83,9 +83,6 @@ case "${1}" in
> 			fi
> 		fi
> 
> -		# Create & Enable vnstat data collection
> -		/usr/bin/vnstat -u -i ${DEVICE} -r --enable --force > /dev/null 2>&1
> -
> 		if [ ! "${ADDRESS}" == "1.1.1.1" ]; then
> 			boot_mesg "Adding IPv4 address ${ADDRESS} to the ${DEVICE} interface..."
> 			ip addr add ${args} dev ${DEVICE}
> @@ -100,8 +97,6 @@ case "${1}" in
> 			evaluate_retval
> 		fi
> 
> -		# Disable vnstat collection
> -		/usr/bin/vnstat -u -i ${DEVICE}	-r --disable > /dev/null 2>&1
> 		exit 0;
> 		;;
> esac
> diff --git a/src/initscripts/networking/red b/src/initscripts/networking/red
> index 38129deeb..fc10e077a 100644
> --- a/src/initscripts/networking/red
> +++ b/src/initscripts/networking/red
> @@ -103,9 +103,6 @@ case "${1}" in
> 			fi
> 		fi
> 
> -		## Create & Enable vnstat
> -		/usr/bin/vnstat -u -i ${DEVICE} -r --enable --force > /dev/null 2>&1
> -
> 		if [ "${TYPE}" == "STATIC" ]; then
> 			# Set the MTU
> 			if [ -n "${MTU}" ]; then
> @@ -176,9 +173,6 @@ case "${1}" in
> 				dhcpcd_start "${DEVICE}"
> 			fi
> 
> -			## Create & Enable vnstat
> -			/usr/bin/vnstat -u -i ${DEVICE} -r --enable --force > /dev/null 2>&1
> -
> 		elif [ "$TYPE" == "PPPOE" ]; then
> 
> 			if ( ps ax | grep -q [p]ppd ); then 
> @@ -459,8 +453,7 @@ case "${1}" in
> 				evaluate_retval
> 				# echo PPP: /usr/sbin/pppd pty "$PPPOE_CMD" $PPP_STD_OPTIONS $DEBUG $DEMAND $PPPD_SYNC
> 			fi
> -			## Create & Enable vnstat
> -			/usr/bin/vnstat -u -i ppp0 -r --enable --force > /dev/null 2>&1
> +
> 			/etc/rc.d/init.d/connectd start
> 			# Add a NaN value to ppp0 rrd to supress spikes at reconnect
> 			rrdtool update $RRDLOG/collectd/localhost/interface/if_octets-ppp0.rrd \
> @@ -485,8 +478,6 @@ case "${1}" in
> 
> 		elif [ "$TYPE" == "PPPOE" ]; then
> 			boot_mesg "Bringing down the PPP interface ..."
> -			## Disable vnstat collection
> -			/usr/bin/vnstat -u -i ppp0 -r --disable > /dev/null 2>&1
> 			rm -f /var/ipfire/red/keepconnected
> 			killall -w -s TERM /usr/sbin/pppd 2>/dev/null
> 			evaluate_retval
> @@ -533,9 +524,6 @@ case "${1}" in
> 		killall -w -s KILL pptp >/dev/null 2>&1
> 		killall -w -s KILL br2684ctl >/dev/null 2>&1
> 
> -		## Disable vnstat collection
> -		/usr/bin/vnstat -u -i ${DEVICE} -r --disable > /dev/null 2>&1
> -
> 		exit 0;
> 		;;
> esac
> -- 
> 2.25.1
>
  
Matthias Fischer April 7, 2022, 4:50 p.m. UTC | #2
On 07.04.2022 17:53, Michael Tremer wrote:
> Hello Matthias,

Hi,

> Thanks for this patch.
> 
> Could you please elaborate a little bit more about why those commands are not needed any more?

Done. ;-)

> -Michael
> 
>> On 7 Apr 2022, at 16:43, Matthias Fischer <matthias.fischer@ipfire.org> wrote:
>> 
>> Fixes: #12831
>> 
>> Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
>> ---
>> src/initscripts/networking/any |  5 -----
>> src/initscripts/networking/red | 14 +-------------
>> 2 files changed, 1 insertion(+), 18 deletions(-)
>> 
>> diff --git a/src/initscripts/networking/any b/src/initscripts/networking/any
>> index 0facf23d8..15197badb 100644
>> --- a/src/initscripts/networking/any
>> +++ b/src/initscripts/networking/any
>> @@ -83,9 +83,6 @@ case "${1}" in
>> 			fi
>> 		fi
>> 
>> -		# Create & Enable vnstat data collection
>> -		/usr/bin/vnstat -u -i ${DEVICE} -r --enable --force > /dev/null 2>&1
>> -
>> 		if [ ! "${ADDRESS}" == "1.1.1.1" ]; then
>> 			boot_mesg "Adding IPv4 address ${ADDRESS} to the ${DEVICE} interface..."
>> 			ip addr add ${args} dev ${DEVICE}
>> @@ -100,8 +97,6 @@ case "${1}" in
>> 			evaluate_retval
>> 		fi
>> 
>> -		# Disable vnstat collection
>> -		/usr/bin/vnstat -u -i ${DEVICE}	-r --disable > /dev/null 2>&1
>> 		exit 0;
>> 		;;
>> esac
>> diff --git a/src/initscripts/networking/red b/src/initscripts/networking/red
>> index 38129deeb..fc10e077a 100644
>> --- a/src/initscripts/networking/red
>> +++ b/src/initscripts/networking/red
>> @@ -103,9 +103,6 @@ case "${1}" in
>> 			fi
>> 		fi
>> 
>> -		## Create & Enable vnstat
>> -		/usr/bin/vnstat -u -i ${DEVICE} -r --enable --force > /dev/null 2>&1
>> -
>> 		if [ "${TYPE}" == "STATIC" ]; then
>> 			# Set the MTU
>> 			if [ -n "${MTU}" ]; then
>> @@ -176,9 +173,6 @@ case "${1}" in
>> 				dhcpcd_start "${DEVICE}"
>> 			fi
>> 
>> -			## Create & Enable vnstat
>> -			/usr/bin/vnstat -u -i ${DEVICE} -r --enable --force > /dev/null 2>&1
>> -
>> 		elif [ "$TYPE" == "PPPOE" ]; then
>> 
>> 			if ( ps ax | grep -q [p]ppd ); then 
>> @@ -459,8 +453,7 @@ case "${1}" in
>> 				evaluate_retval
>> 				# echo PPP: /usr/sbin/pppd pty "$PPPOE_CMD" $PPP_STD_OPTIONS $DEBUG $DEMAND $PPPD_SYNC
>> 			fi
>> -			## Create & Enable vnstat
>> -			/usr/bin/vnstat -u -i ppp0 -r --enable --force > /dev/null 2>&1
>> +
>> 			/etc/rc.d/init.d/connectd start
>> 			# Add a NaN value to ppp0 rrd to supress spikes at reconnect
>> 			rrdtool update $RRDLOG/collectd/localhost/interface/if_octets-ppp0.rrd \
>> @@ -485,8 +478,6 @@ case "${1}" in
>> 
>> 		elif [ "$TYPE" == "PPPOE" ]; then
>> 			boot_mesg "Bringing down the PPP interface ..."
>> -			## Disable vnstat collection
>> -			/usr/bin/vnstat -u -i ppp0 -r --disable > /dev/null 2>&1
>> 			rm -f /var/ipfire/red/keepconnected
>> 			killall -w -s TERM /usr/sbin/pppd 2>/dev/null
>> 			evaluate_retval
>> @@ -533,9 +524,6 @@ case "${1}" in
>> 		killall -w -s KILL pptp >/dev/null 2>&1
>> 		killall -w -s KILL br2684ctl >/dev/null 2>&1
>> 
>> -		## Disable vnstat collection
>> -		/usr/bin/vnstat -u -i ${DEVICE} -r --disable > /dev/null 2>&1
>> -
>> 		exit 0;
>> 		;;
>> esac
>> -- 
>> 2.25.1
>> 
>
  

Patch

diff --git a/src/initscripts/networking/any b/src/initscripts/networking/any
index 0facf23d8..15197badb 100644
--- a/src/initscripts/networking/any
+++ b/src/initscripts/networking/any
@@ -83,9 +83,6 @@  case "${1}" in
 			fi
 		fi
 
-		# Create & Enable vnstat data collection
-		/usr/bin/vnstat -u -i ${DEVICE} -r --enable --force > /dev/null 2>&1
-
 		if [ ! "${ADDRESS}" == "1.1.1.1" ]; then
 			boot_mesg "Adding IPv4 address ${ADDRESS} to the ${DEVICE} interface..."
 			ip addr add ${args} dev ${DEVICE}
@@ -100,8 +97,6 @@  case "${1}" in
 			evaluate_retval
 		fi
 
-		# Disable vnstat collection
-		/usr/bin/vnstat -u -i ${DEVICE}	-r --disable > /dev/null 2>&1
 		exit 0;
 		;;
 esac
diff --git a/src/initscripts/networking/red b/src/initscripts/networking/red
index 38129deeb..fc10e077a 100644
--- a/src/initscripts/networking/red
+++ b/src/initscripts/networking/red
@@ -103,9 +103,6 @@  case "${1}" in
 			fi
 		fi
 
-		## Create & Enable vnstat
-		/usr/bin/vnstat -u -i ${DEVICE} -r --enable --force > /dev/null 2>&1
-
 		if [ "${TYPE}" == "STATIC" ]; then
 			# Set the MTU
 			if [ -n "${MTU}" ]; then
@@ -176,9 +173,6 @@  case "${1}" in
 				dhcpcd_start "${DEVICE}"
 			fi
 
-			## Create & Enable vnstat
-			/usr/bin/vnstat -u -i ${DEVICE} -r --enable --force > /dev/null 2>&1
-
 		elif [ "$TYPE" == "PPPOE" ]; then
 
 			if ( ps ax | grep -q [p]ppd ); then 
@@ -459,8 +453,7 @@  case "${1}" in
 				evaluate_retval
 				# echo PPP: /usr/sbin/pppd pty "$PPPOE_CMD" $PPP_STD_OPTIONS $DEBUG $DEMAND $PPPD_SYNC
 			fi
-			## Create & Enable vnstat
-			/usr/bin/vnstat -u -i ppp0 -r --enable --force > /dev/null 2>&1
+
 			/etc/rc.d/init.d/connectd start
 			# Add a NaN value to ppp0 rrd to supress spikes at reconnect
 			rrdtool update $RRDLOG/collectd/localhost/interface/if_octets-ppp0.rrd \
@@ -485,8 +478,6 @@  case "${1}" in
 
 		elif [ "$TYPE" == "PPPOE" ]; then
 			boot_mesg "Bringing down the PPP interface ..."
-			## Disable vnstat collection
-			/usr/bin/vnstat -u -i ppp0 -r --disable > /dev/null 2>&1
 			rm -f /var/ipfire/red/keepconnected
 			killall -w -s TERM /usr/sbin/pppd 2>/dev/null
 			evaluate_retval
@@ -533,9 +524,6 @@  case "${1}" in
 		killall -w -s KILL pptp >/dev/null 2>&1
 		killall -w -s KILL br2684ctl >/dev/null 2>&1
 
-		## Disable vnstat collection
-		/usr/bin/vnstat -u -i ${DEVICE} -r --disable > /dev/null 2>&1
-
 		exit 0;
 		;;
 esac