You btw do not need to use sudo inside this script, it runs as root user anyway during boot. If the second program does not start, then the first does not stop. Indeed running those from console should help to investigate the issue, also you could run the whole script:
Looks like a syntax error.
Can you post your script?
And which editor did you use? Maybe there are some invisible characers in it, which break the script.
You could try cat -v script.sh to show weird characters.
Yes with this way working thank you. With one program the sleep command working, it is a bit strange to be on different line from the main program command but it works.
Trying with second program to start but still no success. Both program must be staying running to work. I am thinking if there is a way to start automatic 2 scripts to boot is there a way to make this happen?
My concern is the ouput to the terminal, but I don’t know how this behaves when the process is started inside a script.
The last link also provides a solution for this:
Let the output post to /dev/null instead to STDOUT or STDERR (standard output and standard error output, which should be terminal, if you run headless?!)
the solution would be:
sudo nice -n 19 Program 1 &>/dev/null &
What I am seeing inside the script when running both programs are working normal i do not print information on terminal or anything like this. I am seeing also that the script closing successfully after starting the programs. The &>/dev/null & I think is for programs that print on terminal and to avoid the conflict on bash it can be useful.
As for systemd to be working with my apps I have to configure every service to have the correct order so to be ok. The start up script is helping me because it start on the last or almost on the last runlevel and avoid all this. Of course if something goes wrong I have to do with the “hard way”. For now the information was very helpful.