Fixing daemon startup script to work correctly for normal case.