Shouldn't be executable?

We have something in SE Android that uses something similair in out init.rc 
we have:

service netlabels /system/bin/selinux-network.sh
    class core
    oneshot

And our Android.mk for the project has this:
include $(CLEAR_VARS)

LOCAL_MODULE := selinux-network.sh
LOCAL_SRC_FILES := $(LOCAL_MODULE)
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES)

include $(BUILD_PREBUILT)

It is important to note that the shell file is executable in the project 
directory, this way when it gets added to the image it is executable as 
well.

Hope this helps...

On Wednesday, August 1, 2012 12:12:13 AM UTC-7, Pieter wrote:
>
> Hi all,
>
> I am trying to call a script at boot time.  The script is available inside 
> /system/sbin, but it seems it is not executed.
>
> Here are the details.
> In my init.<target>.rc:
>
> service sampleservice /system/bin/sh /system/sbin/samplescript.sh
>      user root
>      oneshot
>
> The script itself:
> #!/system/bin/sh
> echo The sample script works!
> echo "The sample script works!" > /data/misc/samplescript
>
> The permissions of /system/sbin/samplescript.sh are as follows: -rw-r--r-- 
>    
>
> Doing from command line "sh /system/sbin/samplescript.sh" works perfectly, 
> but it seems the script is not executed at boot time. There are no entries 
> in /data/misc/samplescript
>
> * How can I resolve this issue? Where should I see the output of the 
> "echo" command? Is there another/better way to have it printed in logcat or 
> dmesg?
> * The script itself is not executable. Does this matter and if yes, how do 
> I have to make it executable? In my original directory it is executable, 
> but somehow during the copy process (with PRODUCT_LOCAL_COPY) the 
> executable rights disappear.
> * Another option I see is that I did not "register" a service as such 
> (e.b. by specifiying "LOCAL_MODULE" in your Android.mk and mention it in 
> core.mk) and perhaps this is just not the right way to call a sh script 
> at boot time?
>
> Any help is more than welcome!
> Best regards,
> Pieter
>

-- 
unsubscribe: android-kernel+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-kernel

Reply via email to