Start at boot in Raspberry pi 4

Asked by styleruk

I'm having trouble getting onboard to start at boot with my raspberry pi4 using Buster. I have tried;
Adding @reboot /usr/bin/onboard to crontab
Adding line at end of (just before exit 0) of /etc/rc.local. I added /usr/bin/onboard

Is there a way to configure it to run at boot.

Adding...
nohup /usr/bin/onboard >/dev/null 2>&1 &
at end of /etc/profile
...Fixed it for me.

cheers

Question information

Language:
English Edit question
Status:
Solved
For:
Onboard Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
styleruk (simon-tyleruk) said :
#1

Just tried this approach too....nothing.
https://raspberrypi.stackexchange.com/a/44926

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

Have you tried putting it into .bashrc or /etc/profile ?

Revision history for this message
styleruk (simon-tyleruk) said :
#3

I am unsure of how to do that. Looks more complicated than just adding a path. do you know of a simply howto for editing this and adding onboard

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

That's not different from editing /etc/rc.local
gedit ~/.bashrc
or
nano ~/.bashrc
(or any other plain text editor, I do not know which ones you have available)
For /etc/profile you probably have to add sudo in front

Revision history for this message
styleruk (simon-tyleruk) said :
#5

Editing the file is not my issue, but when i look at my /etc/profile document it looks like python. Can I simply add /usr/bin/onboard to the end of the file (save for back up first of course)

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

/etc/profile should be a shell script and not python.

What is the contents of the first line of /etc/profile ?

What about trying .bashrc first?

Revision history for this message
styleruk (simon-tyleruk) said :
#7

 /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "$(id -u)" -eq 0 ]; then
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games"
fi
export PATH

if [ "${PS1-}" ]; then
  if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then
    # The file bash.bashrc already sets the default PS1.
    # PS1='\h:\w\$ '
    if [ -f /etc/bash.bashrc ]; then
      . /etc/bash.bashrc
    fi
  else
    if [ "$(id -u)" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi

if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi

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

That's not python, but a shell script.

Try adding
/usr/bin/onboard
at the end of the script

If that causes the script to hang forever, maybe something like
nohup /usr/bin/onboard >/dev/null 2>&1 &
is what you need.

Revision history for this message
styleruk (simon-tyleruk) said :
#9

it certainly did cause it to hang forever. Just installing ubuntu on my windows machine so I can open the ext3 file system and restore my old file then I'll try your next suggestion.

Revision history for this message
styleruk (simon-tyleruk) said :
#10

YES...YES. That's the one. holy smoke, I genuinely didn't think I'd ever get there with this. Thank you kind sir for your patience on such a noob as me.

Revision history for this message
styleruk (simon-tyleruk) said :
#11

Thanks Manfred Hampl, that solved my question.