All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2] initscripts: add newline to network stop message
@ 2016-08-02 21:38 Vivien Didelot
  2016-08-02 21:55 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Vivien Didelot @ 2016-08-02 21:38 UTC (permalink / raw)
  To: buildroot

The output of "/etc/init.d/S40network stop" was lacking a newline due to
the usage of printf. Fix it by echoing the status.

v1 -> v2: echo OK/FAIL instead of s/printf/echo/.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
 package/initscripts/init.d/S40network | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/package/initscripts/init.d/S40network b/package/initscripts/init.d/S40network
index 7b11d8b..642c501 100755
--- a/package/initscripts/init.d/S40network
+++ b/package/initscripts/init.d/S40network
@@ -8,12 +8,14 @@ mkdir -p /run/network
 
 case "$1" in
   start)
- 	echo "Starting network..."
+	printf "Starting network: "
 	/sbin/ifup -a
+	[ $? = 0 ] && echo "OK" || echo "FAIL"
 	;;
   stop)
-	printf "Stopping network..."
+	printf "Stopping network: "
 	/sbin/ifdown -a
+	[ $? = 0 ] && echo "OK" || echo "FAIL"
 	;;
   restart|reload)
 	"$0" stop
-- 
2.9.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Buildroot] [PATCH v2] initscripts: add newline to network stop message
  2016-08-02 21:38 [Buildroot] [PATCH v2] initscripts: add newline to network stop message Vivien Didelot
@ 2016-08-02 21:55 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2016-08-02 21:55 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue,  2 Aug 2016 17:38:03 -0400, Vivien Didelot wrote:
> The output of "/etc/init.d/S40network stop" was lacking a newline due to
> the usage of printf. Fix it by echoing the status.

The commit title was not really correct anymore, since you're not only
changing the stop message, but also the start message.

> 
> v1 -> v2: echo OK/FAIL instead of s/printf/echo/.

The change log does not go inside the commit log, but rather...

> 
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
> ---

... here.

I fixed these issues and applied your patch. It's worth mentioning
however that, unrelated to your patch, I get an error message when
starting and stopping. I'm booting an ARM system under Qemu, with the
root filesystem mounted over NFS (so eth0 is already configured by the
kernel, but my /etc/network/interfaces only contains a description for
the lo interface). Here is what I have:

Starting network: ip: RTNETLINK answers: File exists
FAIL

Welcome to Buildroot
buildroot login: root
# ifconfig 
eth0      Link encap:Ethernet  HWaddr 52:54:00:12:34:56  
          inet addr:172.20.0.2  Bcast:172.20.255.255  Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1110 errors:0 dropped:0 overruns:0 frame:0
          TX packets:575 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1198556 (1.1 MiB)  TX bytes:89410 (87.3 KiB)
          Interrupt:31 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

# cat /etc/network/interfaces 
# interface file auto-generated by buildroot

auto lo
iface lo inet loopback
# /etc/init.d/S40network stop
Stopping network: ifdown: interface lo not configured
OK
# 
# 
# /etc/init.d/S40network start
Starting network: ip: RTNETLINK answers: File exists
FAIL

Best regards

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-08-02 21:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-02 21:38 [Buildroot] [PATCH v2] initscripts: add newline to network stop message Vivien Didelot
2016-08-02 21:55 ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.