Use env var SUDO_USER when logname cannot determine username