I have a script which starts a number of background processes and if works fine when called from the cmdline.
However the same script is also called during my xsession startup and additionally on some udev events. In both cases the background processes disappear.
I had put a sleep 10 into the script and I could see, that the bg processes are indeed started, but once the script exists it takes the bg processes with it. I tried to solve with by invoking the bg processes with
start_stop_deamon --background, but this does not make a difference. Hoever, I can invoke the script from a console and exit the session and the bg processes are still running.
Other than fixing my immediate problem (though any help would be much appreciated), I am keen to understand the logic behind it all. I suspect something related to the absence of a terminal.