Can't run program from boot (beaglebone black)

Asked by remy Donken

Followed the following steps from http://mybeagleboneblackfindings.blogspot.nl/2013/10/running-script-on-beaglebone-black-boot.html

startup.sh file
#!/bin/bash
/home/root/Modbus

startup.service file
[Unit]
 Description=<description of code>
 After=syslog.target network.target

[Service]
 Type=simple
 ExecStart=/usr/bin/startup.sh

[Install]
 WantedBy=multi-user.target

after the following command i get

root@beaglebone:~# systemctl status startup.service
startup.service - <description of code>
   Loaded: loaded (/lib/systemd/system/startup.service; enabled)
   Active: failed (Result: exit-code) since Thu, 12 Nov 2015 20:46:45 +0000; 1h 9min ago
  Process: 528 ExecStart=/usr/bin/startup.sh (code=exited, status=127)
   CGroup: name=systemd:/system/startup.service

Hope you can help me

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu build-essential Edit question
Assignee:
No assignee Edit question
Solved by:
remy Donken
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

Exit code 127 usually is caused by some kind of "command not found" situation.

What is the output of
ls -ld /usr/bin/start*
ls -ld /home/root/Mod*

Revision history for this message
remy Donken (raym828) said :
#2

root@beaglebone:~# ls -ld /usr/bin/start*
-rwxr-xr-x 1 root root 1623 May 18 2012 /usr/bin/startlxde
-rwxr--r-- 1 root root 30 Nov 12 21:53 /usr/bin/startup.sh
root@beaglebone:~# ls -ld /home/root/Mod*
ls: cannot access /home/root/Mod*: No such file or directory
root@beaglebone:~# ls -ld /root/Mod*
-rwxr-xr-x 1 root root 844944 Apr 18 2017 /root/Modbus
root@beaglebone:~#

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

In startup.sh you wrote /home/root/Modbus but the file in reality is /root/Modbus

You have to correct the contents of startup.sh, isn't that obvious?

Revision history for this message
remy Donken (raym828) said :
#4

Forget to mention it was solved now.