I have no idea what I'm talking about, but I seem to have a vague recollection of services running under (an) account(s) with certain restrictions. Maybe that poses a problem? Is the script in the first scenario trying to pipe data to the child script, or reading output from it back in (that would obviously lead us back to the second scenario)? Can you pinpoint
where your scripts hang during I/O? (On
open, as your second point seems to imply, or don't you know more precisely?)
Makeshifts last the longest.