I don't think it's quite that simple. You're quoting of the array is pretty much correct. The problem is that the word splitting is being done here in the rc.d script:
Code:
for d in ${PVPGN_DAEMONS[@]}; do
${PVPGN_DAEMONS[@]} outputs the full array as a string of words, which are then each processed separately by the loop. Since there's a space in your array element, it's treated as two separate words by the loop.
I thought you could probably simply embed a further set of escaped quotes or an escaped space when setting the array, but that doesn't seem to be working for me.
What you really need is to modify the loop so that it handles the strings better. You could, for example, put quotes around the array like this:
Code:
for d in "${PVPGN_DAEMONS[@]}"; do
This will cause each of the array elements to be output as if quoted separately, which should preserve your string. However, I don't know how that would affect the pidof command in the next line. Can it handle the input with the extra string attached? It should probably also be modified to something like this:
Code:
PID=`pidof -o %PPID /usr/sbin/${d% *}`
...which should strip everything after the first space off the variable before processing it.