Is there a way to have a bash script know it should always run with a unique pgid? Put another way, I want the bash script to set within itself a new pgid, and pass the 'new' pgid to all it's children.
Now, sure, I could could just write a wrapper script;
Code:
cat /bin/myscript.newpgid
#!/bin/bash
setsid /bin/myscript
But if something non-interactive ran /bin/script, it wouldn't get a new pgid.
From the manpages, I would have thought "#!/bin/bash -m" would have done this, but in my testing it did not (RedHat 6.4). Plus, running a non-interactive script with "-m" is just gross....
-- Peace.