I created a bash script to run some processes on my system. It simply invokes the process and its associated configuration file. Same as command line.
#!/bin/bash
So, to start someprocess , I would call from the command line:
root@supercomputer :~
It works like a charm. Every process, every time. But when I make a system call from another running C ++ process, someprocess never starts.
system( "start someprocess" )
This approach is for 90% of my processes, with the exception of one. The only difference between working and non-working processes is that the non-working one uses its own library routines. I recently added the setsid parameter to the bash script in the hope that starting a new session will help, but that doesn't make any difference. I also tried popen and execv . Without changes.
So my question is what is the difference between calling something with system() and just making the same call from the command line?
All processes are written in C ++ on Linux.
source share