Hi, Robin-
I just remembered "afni" has an option to *find* an available/free port, so you shouldn't need to kill other ones (NB: I don't think the quiet_talkers would kill an afni_proc.py job; I am not sure if it might get one of the headless AFNI instances running in the QC imaging-generation called by it, though... I would hope not one from a different user. But I am not certain.)
OK, so to *find* an available/free port, you can use one of these opts:
-available_npb: Find the first available block of port numbers,
print it to stdout and quit
The value can be used to set the -npb option for
a new set of chatty AFNI/SUMA/etc group.
-available_npb_quiet: Just print the block number to stdout and quit.
The latter is better for scripting, e.g.:
#!/bin/tcsh
# get a portnum that is free
set portnum = `afni -available_npb_quiet`
# use portnum now
afni -niml -npb ${portnum} ....
3dGroupInCorr -npb ${portnum} ....
--pt