init.d script: fallback in case $USER is not set.
init.d script: 'ps -0'  to test for a running process with a given pid is not supported on all systems (e.g. Solaris, illumos). Replace with 'ps -p', which works on more systems.

Tested on SmartOS (illumos), Mac OS X Maverick (10.9.1), and Ubuntu 12.04.4 LTS
Some systems, e.g. Illumos, have an alias for 'stop' in /bin/sh that prevents the call to the stop function in the script. Fixed by calling '\stop' instead of 'stop'.
init.d: use corrct equals operator for POSIX shell (=)