More unix socket copypasta, needs refactoring