changed to use daemon(3) instead of fork and setsid for unix