Some problems with this, easily repaired.
- You leave the partition your starting directory is on undismountable. chdir to system root, '/'.
- Svr4 systems require a second fork, to assure your daemon never gets a controlling terminal.
- With a double fork, it may be advisable to sleep (with select undef, undef, undef, .01) until the parent doesn't answer kill, so that the first child has no chance of going zombie.
- You don't close any other open file handles.