fixed subprocess.popen issue. Added logging for syslog

fixed subprocess.popen issue. Added logging for syslog