I am writting a bash script first.sh in which I am required to run another scrip second.sh as a daemon.
In order to do so it must be launched from a new bash instance using nohup, so when the bash instance ends second.sh will be adopted by systemd.
How can it be implemented? Is there a way that the next bash instances launched from first.sh will have a different pgid than the one of second.sh?
bash -c 'nohup second.sh &'>/dev/null When new bash instances are launched, the first one shares the pgid of second.sh, is there a way to avoid it?