erlexec: HOME must be set

I ran into this error message for the first time when I was attempting to start CouchDB, which uses Erlang, from a Solaris SMF service.

erlexec: HOME must be set

This is a rare case where a seemingly cryptic error message says exactly what it means. For some reason SMF was not setting the HOME environment variable and for some even more confusing reason Erlang requires it to be set to start up.

I solved the problem quite simply by setting a value for HOME. Since I didn’t plan to use whatever feature of Erlang requires this, I just set it it to /tmp. CouchDb now starts up as expected.