How to run two shell scripts at startup?
I am working with Ubuntu 16.04 and I have two shell scripts:
- run_roscore.sh : This one fires up a roscore in one terminal.
- run_detection_node.sh : This one starts an object detection node in another terminal and should start up once run_roscore.sh has initialized the roscore.
I need both the scripts to execute as soon as the system boots up.
I made both scripts executable and then added the following command to cron:
@reboot /path/to/run_roscore.sh; /path/to/run_detection_node.sh, but it is not running.
I have also tried adding both scripts to the Startup Applications using this command for roscore:
sh /path/to/run_roscore.sh and following command for detection node:
sh /path/to/run_detection_node.sh. And it still does not work.
How do I get these scripts to run?
EDIT: I used the following command to see the system log for the CRON process:
grep CRON /var/log/syslog and got the following output:
CRON: (CRON) info (No MTA installed, discarding output).
So I installed MTA and then systemlog shows:
CRON: (nvidia) CMD (/path/to/run_roscore.sh; /path/to/run_detection_node.sh)
I am still not able to see the output (which is supposed to be a camera stream with detections, as I see it when I run the scripts directly in a terminal). How should I proceed?
How to run a shell script at startup, On an Amazon S3 Linux instance, I have two scripts called start_my_app and stop_my_app which start and stop forever (which in turn runs my Running Custom Scripts at Startup. Along with running programs at log on, you can also use Task Scheduler or the Startup folder to run custom batch scripts. Batch files contain commands that would normally be run in a command-line window. For example, the following code tells Windows to map a network share located on 192.168.1.1 to drive Z:.
cmd: /path/to/script1 log: file: /var/log/script1.log wait: 1 require: - script2
cmd: /path/to/script2 log: file: /var/log/script2.log
What this will do it will try to start both scripts on boot time, the first one
script1 will wait 1 second before starting and also wait for
script2 to be up and running, see more about the
require option here: https://immortal.run/post/immortal/
Going more deep in the topic of supervisors there are more alternatives here you could find some: https://en.wikipedia.org/wiki/Process_supervision
How to Auto Execute Commands/Scripts During Reboot or Startup, If in doubt, refer to the documentation of your shell. Executing Linux Scripts During Reboot or Startup. There are two traditional methods to If you want to run the PowerShell script at a computer startup (to disable outdated protocols: NetBIOS and LLMNR, SMBv1, configure computer security settings, etc.) or before the computer shutdown, you need to go to the GPO section with the computer settings: Computer Configuration -> Policies -> Windows Settings -> Scripts (Startup / Shutdown).
If you want to make sure that "Roscore" (whatever it is) gets started when your Ubuntu starts up then you should start it as a service (not via cron). See this question/answer.
Calling multiple bash scripts and running them in parallel, not in , sh file in terminal. Currently I simply added these app names one by one below and when executing the file it open the first application only and How to run PowerShell script file on Windows 10. Open Start . Search for PowerShell , right-click the top-result and click the Run as administrator option. Type the following command to allow scripts to run and press Enter : Set-ExecutionPolicy RemoteSigned. Type A and press Enter (if applicable).
startup - Starting multiple applications using a shell script, I want to run two different processes simultaneously using shell script. If you just want to start the two scripts and sit and wait for them to complete you can start Step 1: Double-click to run. Let’s start by addressing the first problem – .PS1 file associations. You can’t double-click to run .PS1 files, but you can execute a .BAT file that way. So, we’ll write a batch file to call the PowerShell script from the command line for us.
Running multiple shell scripts simultaneously, I am assuming I need a Systemd service unit and Startup shell script (I have no idea what I'm talking about I found that on an other forum post As you automate your Windows operating system with PowerShell 2, it helps to know how to create scripts that you may be able to loop and use more than once. The steps to create a script follow: Create the script in a plain text editor such as Notepad and save with a .PS1 file extension (for example, myscript.ps1).
Complete Newbie: running two scripts on startup, There maybe various reason why you might want to execute shell script during Linux startup like for example to start a particular custom service, On an Amazon S3 Linux instance, I have two scripts called start_my_app and stop_my_app which start and stop forever (which in turn runs my Node.js application). I use these scripts to manually start and stop my Node.js application. So far so good. My problem: I also want to set it up such that start_my_app is run