tried some things, made daemonization happen first. still not working... even changed umask to 0. same issues arise. waitpid causes children to be independant of main daemon, file is not being written too. on the other hand it does seem to recognize home irectory now, as in it does not exit due to error nor does it cause seg fault