Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] rpcbind : add startup script
@ 2014-06-15 11:38 Sagaert Johan
  2014-06-15 12:43 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Sagaert Johan @ 2014-06-15 11:38 UTC (permalink / raw)
  To: buildroot

rpcbind must be started at boot time.
Without this any nfs mount will fail.

Signed-off-by: Sagaert Johan <sagaert.johan@skynet.be>
---
 package/rpcbind/S30rpcbind | 38 ++++++++++++++++++++++++++++++++++++++
 package/rpcbind/rpcbind.mk |  8 ++++++++
 2 files changed, 46 insertions(+)
 create mode 100644 package/rpcbind/S30rpcbind

diff --git a/package/rpcbind/S30rpcbind b/package/rpcbind/S30rpcbind
new file mode 100644
index 0000000..85ebd6f
--- /dev/null
+++ b/package/rpcbind/S30rpcbind
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# Starts rpcbind.
+#
+
+start() {
+	echo -n "Starting rpcbind: "
+	umask 077
+	start-stop-daemon -S -q -p /var/run/rpcbind.pid --exec /usr/bin/rpcbind
+	echo "OK"
+}
+stop() {
+	echo -n "Stopping rpcbind daemon: "
+	start-stop-daemon -K -q -p /var/run/rpcbind.pid
+	echo "OK"
+}
+restart() {
+	stop
+	start
+}
+
+case "$1" in
+  start)
+	start
+	;;
+  stop)
+	stop
+	;;
+  restart|reload)
+	restart
+	;;
+  *)
+	echo "Usage: $0 {start|stop|restart}"
+	exit 1
+esac
+
+exit $?
+
diff --git a/package/rpcbind/rpcbind.mk b/package/rpcbind/rpcbind.mk
index 19bdace..6a946f9 100644
--- a/package/rpcbind/rpcbind.mk
+++ b/package/rpcbind/rpcbind.mk
@@ -15,4 +15,12 @@ RPCBIND_CONF_ENV += \
 	CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/tirpc/"
 RPCBIND_DEPENDENCIES += libtirpc
 
+define RPCBIND_INSTALL_STARTUP_SCRIPT
+	[ -f $(TARGET_DIR)/etc/init.d/S30rpcbind ] || \
+		$(INSTALL) -m 0755 -D package/rpcbind/S30rpcbind \
+			$(TARGET_DIR)/etc/init.d/S30rpcbind
+endef
+
+RPCBIND_POST_INSTALL_TARGET_HOOKS += RPCBIND_INSTALL_STARTUP_SCRIPT
+
 $(eval $(autotools-package))
-- 
2.0.0

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

* [Buildroot] [PATCH 1/1] rpcbind : add startup script
  2014-06-15 11:38 [Buildroot] [PATCH 1/1] rpcbind : add startup script Sagaert Johan
@ 2014-06-15 12:43 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2014-06-15 12:43 UTC (permalink / raw)
  To: buildroot

Dear Sagaert Johan,

On Sun, 15 Jun 2014 13:38:20 +0200, Sagaert Johan wrote:
> rpcbind must be started at boot time.
> Without this any nfs mount will fail.
> 
> Signed-off-by: Sagaert Johan <sagaert.johan@skynet.be>

Thanks!

> diff --git a/package/rpcbind/rpcbind.mk b/package/rpcbind/rpcbind.mk
> index 19bdace..6a946f9 100644
> --- a/package/rpcbind/rpcbind.mk
> +++ b/package/rpcbind/rpcbind.mk
> @@ -15,4 +15,12 @@ RPCBIND_CONF_ENV += \
>  	CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/tirpc/"
>  RPCBIND_DEPENDENCIES += libtirpc
>  
> +define RPCBIND_INSTALL_STARTUP_SCRIPT
> +	[ -f $(TARGET_DIR)/etc/init.d/S30rpcbind ] || \
> +		$(INSTALL) -m 0755 -D package/rpcbind/S30rpcbind \
> +			$(TARGET_DIR)/etc/init.d/S30rpcbind
> +endef
> +
> +RPCBIND_POST_INSTALL_TARGET_HOOKS += RPCBIND_INSTALL_STARTUP_SCRIPT

This should instead be using the <pkg>_INIT_SYSV mechanism, see the
Buildroot manual.

Also, since you said portmap and rpcbind cannot be used simultaneously,
I think it would be good to reflect this in the dependencies. So, in a
separate patch, adding a "depends on !BR2_PACKAGE_RPCBIND" in portmap
would probably be good to have.

Thanks!

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:[~2014-06-15 12:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-15 11:38 [Buildroot] [PATCH 1/1] rpcbind : add startup script Sagaert Johan
2014-06-15 12:43 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox