I recall a similar discussion from one of my PRs ;)

Presumably, multiple 'minerd' processes are started? `su - ${USER} -c "${CPUMINER} -c ${CFG_FILE} -t 1 2> ${LOG_FILE}" & echo $! > ${PID_FILE}` won't work then?

`start-stop-daemon` might have issues with spawning multiple processes, I had to resort to `su -c` for a similar reason in another PR, but then you're stuck with getting the PID another way.

About `pidof`, @Diaoul, I thought the same. It is available on DSM4.1 though, but I haven't got anything older lying around. Might be nicer than `ps | grep` though...