Why do I get an Unable to open file ego.conf error when I try to use sudo egosh ego start to start the cluster?

The operating system resets the environment so that it only contains the LOGNAME, SHELL, USER, USERNAME, and SUDO_ variables by default. As a result, EGO_CONFDIR is not set in the sudo environment. Add the following line to the beginning of the /etc/sudoers file to preserve all the user environment variables when using sudo:
Defaults !env_reset
Alternatively, you can use sudo -E <cmd> to work around this if the sudo version on the machine is newer than 1.6.9:
sudo -E egosh ego start