from the postgresql code so we use that instead of issuing system calls with rm -rf .... I also eliminated the rm -rf for pg_xlog. Will later do the same with the other system call to remove files in pg_replslot/