0

I was referring to this post to create startup script in BeagleBone Yocto, I have 3 scenario required to run in startup. I am not really sure what is best way to do it, should I create 3 services and have them pointing 3 different script or is it possible to launch multiple script in one service. What I mean is something shown below in my service file:

[Unit]
Description=RUNNING BUILD IN TESTING SCRIPT

[Service]
Type=simple
ExecStart=/bin/sh -c 'sleep 5 ; /usr/sbin/check_emmc.sh'
ExecStart=/bin/sh -c 'sleep 5 ; /usr/sbin/blinkled.sh'

[Install]
WantedBy=multi-user.target

However, this method only work one script, is it possible to make one service to run multiple shell script?

0andriy
  • 4,183
  • 1
  • 24
  • 37
KJ L
  • 115
  • 2
  • 14
  • 1
    What the problem to put them in one `ExecStart` line as a shell script itself? Something like `sh -c ' scriptA &; scriptB &; ...'`. – 0andriy Sep 02 '20 at 08:22
  • 1
    Is there a strong relationship between these services ? If no, in my opinion it's better to separate them. – Mali Sep 02 '20 at 15:03
  • @0andriy ya, nothing wrong with that, just that i really new on the linux thingy, thanks for your input – KJ L Sep 03 '20 at 02:53
  • 2
    I would suggest using separate services per script - this will allow you to filter logs in future, also you can delay startup as described here: https://stackoverflow.com/a/44737570 – d21d3q Sep 04 '20 at 07:01

0 Answers0