Hi Matthias,

 Thanks for your response. I got the syntax sorted out now:

service my_sh /system/etc/my_sh.sh
    class main
#    user root
#    group root
    oneshot

With this, I do see the service kicking in. The next challenge is how do I
get the script to work. Say if I want to cd /mnt/sdcard & this should show
up in the shell prompt. Is that doable? In other words, it should work
exactly as though I'm manually running the script

Thanks
HV

On Wed, Apr 25, 2012 at 11:23 AM, Matthias Kaehlcke <
matthias.l...@kaehlcke.net> wrote:

> El Tue, Apr 24, 2012 at 05:46:39PM -0700 HV ha dit:
>
> >    Hi All,
> >     I'm trying to initiate a script as a service from init.rc (running
> ICS),
> >    but it doesn't seem to work. Here is what I have:
> >    ************
> >    service my_sh /system/bin/sh ./system/etc/my.sh
> >        user root
> >        group root
> >    #    oneshot
> >    And my.sh is very simple:
> >    #!/system/bin/sh
> >    echo "Executing my.sh"
> >    lsmod
> >    ************
> >    Any ideas what could be missing?
>
> by default Androids init redirects stdout and stderr to /dev/null,
> therefore you won't see the output of this script. to see if the
> service is executed you could make it create a file. also remove the
> dot before the script name, it will probably work but you shouldn't
> rely on init having / as working directory. and uncomment the oneshot
> attribute, otherwise your script will be executed continuously
>
> regards
>
> --
> Matthias Kaehlcke
> Embedded Linux Developer
> Amsterdam
>
>              La posibilidad de realizar un suenyo es lo
>                 que hace que la vida sea interesante
>                                                                 .''`.
>    using free software / Debian GNU/Linux | http://debian.org  : :'  :
>                                                                `. `'`
> gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-
>

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

Reply via email to