fix order of setgid's, openlog has three arguments.