I have been trying for a few hours to do the following (on Centos 6):
- cron starts process A
- process A checks if process B is alive
- if process B is not alive, process A starts process B
The problem is that after process A terminates, process B is terminated as well.
Process A and Process B are both bash running a script.
I have been trying to use
bin/bash script.sh & and
exec bin/bash script.sh both without success. If I start process A from the console, process B is not terminated.
Is what I am trying to do theoretically possible (e.g. have a process be started from a process launched from cron and have it survive). In which other ways could I start process B to have it survive the termination of process A?