fix errors for memcached and add start-daemon script