Also noticed:
+ if [ -e "$pidfile" -a ! -r "$pidfile" ]; then
Should be -f, then -r, not -e. It should exist AND be a regular file (not a symlink, device node, pipe, etc)
Also noticed:
+ if [ -e "$pidfile" -a ! -r "$pidfile" ]; then
Should be -f, then -r, not -e. It should exist AND be a regular file (not a symlink, device node, pipe, etc)