Hello Hennin,

On Tuesday 09 October 2012 21:22:47 Henning Meyer wrote:
> From: Henning Meyer <[email protected]>
> 
> added init.d script to hiawatha
> 
> Signed-off-by: Henning Meyer <[email protected]>
> ---
> 
> diff --git a/Makefile b/Makefile
> index 943a57c..5331bc8 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -53,11 +53,31 @@ define Package/hiawatha/conffiles
>  endef
> 
>  define Package/hiawatha/install
> -     $(INSTALL_DIR) $(1)/usr/sbin
> +     $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d
> +     $(INSTALL_BIN) ./files/hiawatha.init $(1)/etc/init.d/hiawatha
>       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/hiawatha $(1)/usr/sbin/
> 
>       $(INSTALL_DIR) $(1)/etc/hiawatha
>       $(INSTALL_CONF)
> $(PKG_INSTALL_DIR)/etc/hiawatha/{hiawatha,mimetype}.conf
> $(1)/etc/hiawatha/
>  endef
> 
> +define Package/hiawatha/postinst
> +#!/bin/sh
> +[ -n "$${IPKG_INSTROOT}" ] || {
> +        /etc/init.d/hiawatha enable

I do not think this belongs to the postinst script here, clearly you are 
changing the behavior of this package compared to other packages. As the
documentation states, you are supposed to perform the enabling and starting
manually.

> +        /etc/init.d/hiawatha start
> +}
> +endef
> +
> +define Package/hiawatha/prerm
> +#!/bin/sh
> +[ -n "$${IPKG_INSTROOT}" ] || {
> +        /etc/init.d/hiawatha stop
> +        /etc/init.d/hiawatha disable
> +}
> +exit 0
> +endef
> +
> +
> +
>  $(eval $(call BuildPackage,hiawatha))
> diff --git a/files/hiawatha.init b/files/hiawatha.init
> new file mode 100644
> index 0000000..a65d223
> --- /dev/null
> +++ b/files/hiawatha.init
> @@ -0,0 +1,60 @@
> +#!/bin/sh /etc/rc.common
> +
> +START=80
> +STOP=80
> +
> +HIAWATHA="/usr/sbin/hiawatha"
> +PIDFILE="/var/run/hiawatha.pid"
> +
> +NORMAL="\033[0m"
> +RED="\033[00;31m"
> +YELLOW="\033[00;33m"
> +GREEN="\033[00;32m"

No fancy stuff, we are an embedded distribution :)
-- 
Florian
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to