On 01/08/2013 11:31 PM, Etienne Champetier wrote:
> Hi

Hey,

> +define Package/zabbix-extra-mac80211/postinst
> +[ -n "$${IPKG_INSTROOT}" ] || /etc/init.d/zabbix_extra_mac80211 enable
> +exit 0
> +endef
> +
> +define Package/zabbix-extra-network/postinst
> +[ -n "$${IPKG_INSTROOT}" ] || /etc/init.d/zabbix_extra_network enable
> +exit 0
> +endef
> +
> +define Package/zabbix-extra-wifi/postinst
> +[ -n "$${IPKG_INSTROOT}" ] || /etc/init.d/zabbix_extra_wifi enable
> +exit 0
> +endef
> +

There's a reason for package init scripts not being enabled by default.
Although its intention is indeed worth a discussion, workarounding this
within the package makefiles however doesn't make it any better and is
definitely not the right place to do so.

> Index: files/zabbix_extra_network.init
> ===================================================================
> --- files/zabbix_extra_network.init   (révision 0)
> +++ files/zabbix_extra_network.init   (révision 0)
> @@ -0,0 +1,9 @@
> +#!/bin/sh /etc/rc.common
> +# Copyright (C) 2008-2011 OpenWrt.org
> +
> +START=59
> +
> +start() {
> +     chmod a+r /var/state/network
> +}
> +

Sorry, this is a no-go. You can't just change the permissions of files
related to another package, the core-system or kernel exposed files from
a package-Makefile for obvious reasons. This needs to be solved some
other way.

> ===================================================================
> --- files/zabbix_extra_mac80211.init  (révision 0)
> +++ files/zabbix_extra_mac80211.init  (révision 0)
> @@ -0,0 +1,9 @@
> +#!/bin/sh /etc/rc.common
> +# Copyright (C) 2008-2011 OpenWrt.org
> +
> +START=59
> +
> +start() {
> +     chmod -R a+r /sys/kernel/debug/ieee80211/*/statistics/
> +}
> 

See above.

> Index: files/zabbix_extra_wifi.init
> ===================================================================
> --- files/zabbix_extra_wifi.init      (révision 0)
> +++ files/zabbix_extra_wifi.init      (révision 0)
> @@ -0,0 +1,9 @@
> +#!/bin/sh /etc/rc.common
> +# Copyright (C) 2008-2011 OpenWrt.org
> +
> +START=59
> +
> +start() {
> +     chmod a+r /var/state/wireless
> +}
> +

See above.
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to