# Application auto-start at boot on WP8548(Firmware release14)

**URL:** https://mangoh.discourse.group/t/application-auto-start-at-boot-on-wp8548-firmware-release14/8303
**Category:** Uncategorized
**Created:** [April 12, 2021, 6:42am UTC](https://mangoh.discourse.group/t/application-auto-start-at-boot-on-wp8548-firmware-release14/8303 "2021-04-12T06:42:03Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![u\_6s](https://avatars.discourse-cdn.com/v4/letter/u/df705f/32.png) [@u\_6s](https://mangoh.discourse.group/u/u_6s)
#### Post date: [April 12, 2021, 6:42am UTC](https://mangoh.discourse.group/t/application-auto-start-at-boot-on-wp8548-firmware-release14/8303/1 "2021-04-12T06:42:03Z")

</div>

Hello, I want to start my application at boot by using /etc/init.d/Startlegato.sh.  
The problem is that only my application doesn’t start at boot.  
(=In the following case, test.txt is generated, but my application doesn’t start.)

・The application is called from the shell scrypt I made for the test.(test.sh)  
・I set command “/etc/init.d/test.sh” to /etc/init.d/Startlegato.sh.  
・test.sh includes other command like “touch /home/root/test.txt”

I prepared the application by the following steps:  
・ Bulid the application with VM on windows PC  
(VM:Orange - mangOH Dev using Legato 18.09.0 on Ubuntu 18.04)  
・ Copy it to /home/root on WP8548 by SSH.  
・ Grant an authority (666) to the application.

After the preparation above, I checked the application can be started by inputting the command “/home/root/[app name]” or /etc/init.d/test.sh on legato.

Please guide me in this regards.

---

<div class="post-metadata">

### Author: ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)
#### Post date: [April 12, 2021, 6:59am UTC](https://mangoh.discourse.group/t/application-auto-start-at-boot-on-wp8548-firmware-release14/8303/2 "2021-04-12T06:59:36Z")

</div>

you can see here that no problem is found on WP76 R9:

> **[Adding scripts to run at startup](https://forum.legato.io/t/adding-scripts-to-run-at-startup/2412/7)**
>
> I just tried on WP76 R9, I found that modifying mount\_early is not working. Instead I modify /etc/init.d/startlegato.sh, and I can add my command there. case “$1” in start) echo “Legato start sequence 123” echo 123 \> /tmp/123.txt You can...

---

<div class="post-metadata">

### Author: ![u\_6s](https://avatars.discourse-cdn.com/v4/letter/u/df705f/32.png) [@u\_6s](https://mangoh.discourse.group/u/u_6s)
#### Post date: [April 22, 2021, 5:16am UTC](https://mangoh.discourse.group/t/application-auto-start-at-boot-on-wp8548-firmware-release14/8303/3 "2021-04-22T05:16:32Z")

</div>

@jyijyi  
Sorry for the late reply, and Thank you for your information.  
I use startlegato.sh on WP8548 like the following.  
“touch in test.sh” works, but my application “/home/root/ctrl\_gpio” doesn’t work.

I want to start ctrl\_gpio by using startlegato.sh at boot.  
(ctrl\_gpio simply changes the value of a particular GPIO pin. )

If you have any ideas, Could you give any advice?

```
--startlegato.sh---
 LEGATO_START=/mnt/legato/start

case "$1" in
    start)
        echo "Legato start sequence"
        $LEGATO_START              
        etc/init.d/test.sh

--test.sh---
/home/root/ctrl_gpio 33 1 100 &

touch /home/root/test_.txt
```

---

<div class="post-metadata">

### Author: ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)
#### Post date: [April 22, 2021, 7:25am UTC](https://mangoh.discourse.group/t/application-auto-start-at-boot-on-wp8548-firmware-release14/8303/4 "2021-04-22T07:25:05Z")

</div>

Try to start a new shell and add a delay

–startlegato.sh—  
LEGATO\_START=/mnt/legato/start

case “$1” in  
start)  
echo “Legato start sequence”  
$LEGATO\_START  
etc/init.d/test.sh &

–test.sh—

sleep 10  
/home/root/ctrl\_gpio 33 1 100 &

touch /home/root/test\_.txt

---

<div class="post-metadata">

### Author: ![u\_6s](https://avatars.discourse-cdn.com/v4/letter/u/df705f/32.png) [@u\_6s](https://mangoh.discourse.group/u/u_6s)
#### Post date: [April 26, 2021, 8:38am UTC](https://mangoh.discourse.group/t/application-auto-start-at-boot-on-wp8548-firmware-release14/8303/5 "2021-04-26T08:38:41Z")

</div>

Thank you for your additional information.  
I understand that you mean I must consider the time for creating a path to the app.  
I tried it but only my app still doesn’t start.

Are there any point I have to check?

- Authority for the app or making symbolic link to a particular directory?  
-Otherwise, I misunderstand how to build the app?  
But, the application starts by using command after logging in to legato.  
So, I wonder why the app doesn’t start when I use startlegato.sh.

---

<div class="post-metadata">

### Author: ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)
#### Post date: [April 26, 2021, 8:53am UTC](https://mangoh.discourse.group/t/application-auto-start-at-boot-on-wp8548-firmware-release14/8303/6 "2021-04-26T08:53:51Z")

</div>

how about building an unsandboxed helloworld legato application and inside calling your application ctrl\_gpio by system("/home/root/ctrl\_gpio 33 1 100 \n"); ?

---

<div class="post-metadata">

### Author: ![u\_6s](https://avatars.discourse-cdn.com/v4/letter/u/df705f/32.png) [@u\_6s](https://mangoh.discourse.group/u/u_6s)
#### Post date: [April 28, 2021, 8:33am UTC](https://mangoh.discourse.group/t/application-auto-start-at-boot-on-wp8548-firmware-release14/8303/7 "2021-04-28T08:33:19Z")

</div>

By using startlegato.sh, only “helloworld” can starts.  
I built “helloworld” on mangoh VM.

> int main(void){  
> printf(“hello,world!\n”);  
> return 0;  
> }

However, with the following source, ctrl\_gpio doesn’t start.

> ```
> int main(void){
> printf("hello,world!\n");
> system("/home/root/ctrl_gpio 33 1 50 &");
> return 0;
> }
> 
> ```

Actually, I use shared shared object (/home/root/lib.so) built on mangoh VM.  
I also grant an authority (777) to the application and I can call ctrl\_gpio by command on legato.  
So, I think the cause of this trouble happens when I use lib.so and startlegato.sh.  
Are there any rules that I should use for using a shared object in this case?

---

<div class="post-metadata">

### Author: ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)
#### Post date: [April 28, 2021, 9:01am UTC](https://mangoh.discourse.group/t/application-auto-start-at-boot-on-wp8548-firmware-release14/8303/8 "2021-04-28T09:01:06Z")

</div>

I am saying to build this helloworld by unsandboxed legato application

---

<div class="post-metadata">

### Author: ![u\_6s](https://avatars.discourse-cdn.com/v4/letter/u/df705f/32.png) [@u\_6s](https://mangoh.discourse.group/u/u_6s)
#### Post date: [May 6, 2021, 1:54am UTC](https://mangoh.discourse.group/t/application-auto-start-at-boot-on-wp8548-firmware-release14/8303/9 "2021-05-06T01:54:05Z")

</div>

Sorry, I misunderstood your advice.  
Actually, I am not familiar with unsandboxed legato application, but I will look for how to build as unsandboxed legato application and try it!
