Patchwork [1/2] Avoid starting rpcbind daemon twice during boot

login
register
mail settings
Submitter Yue Tao
Date Nov. 15, 2013, 6:34 a.m.
Message ID <1384497286-19011-1-git-send-email-Yue.Tao@windriver.com>
Download mbox | patch
Permalink /patch/61751/
State New
Headers show

Comments

Yue Tao - Nov. 15, 2013, 6:34 a.m.
Check whether rpcbind daemon already run before starting it.

Signed-off-by: Yue Tao <Yue.Tao@windriver.com>
---
 .../initscripts/initscripts-1.0/mountnfs.sh        |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
Saul Wold - Nov. 15, 2013, 3:15 p.m.
On 11/14/2013 10:34 PM, Yue Tao wrote:
> Check whether rpcbind daemon already run before starting it.
>
Please review the commit guidelines for both of your patches and correct 
the short summary (subject) to be in the form of:

initscripts: Avoid ...

Thanks
	SaU!

> Signed-off-by: Yue Tao <Yue.Tao@windriver.com>
> ---
>   .../initscripts/initscripts-1.0/mountnfs.sh        |    9 ++++++---
>   1 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh b/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh
> index 4fffe4e..a03070d 100755
> --- a/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh
> +++ b/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh
> @@ -69,9 +69,12 @@ if test "$rpcbind" = yes
>   then
>   	if test -x /usr/sbin/rpcbind
>   	then
> -		echo -n "Starting rpcbind... "
> -		start-stop-daemon --start --quiet --exec /usr/sbin/rpcbind
> -		sleep 2
> +		service rpcbind status > /dev/null
> +		if [ $? != 0 ]; then
> +			echo -n "Starting rpcbind..."
> +			start-stop-daemon --start --quiet --exec /usr/sbin/rpcbind
> +			sleep 2
> +		fi
>   	fi
>   fi
>
>

Patch

diff --git a/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh b/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh
index 4fffe4e..a03070d 100755
--- a/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh
@@ -69,9 +69,12 @@  if test "$rpcbind" = yes
 then
 	if test -x /usr/sbin/rpcbind
 	then
-		echo -n "Starting rpcbind... "
-		start-stop-daemon --start --quiet --exec /usr/sbin/rpcbind
-		sleep 2
+		service rpcbind status > /dev/null
+		if [ $? != 0 ]; then
+			echo -n "Starting rpcbind..."
+			start-stop-daemon --start --quiet --exec /usr/sbin/rpcbind
+			sleep 2
+		fi
 	fi
 fi