spawn and terminate a child process