Redhat daemon fix

I've amended the daemon to log to a file and run in the background on Redhat.

Also, I've defined the missing `lockfile` variable.

Tested on Centos 5.5.