Modified to use syslog
Fixed return code from pipe