Running Unity3D app on Linux using a third party application

Hi all,

I have a game server built with Unity, deployed on our test server running Ubuntu 12.04 Server LTS.
The server runs fine when I directly run it over SSH using -batchmode and -nographics option.

I have installed monit on the server to better manage the server application, but whenever monit tries to start the server, it crashes with following error in the log output:

terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct NULL not valid
Stacktrace:

Native stacktrace:

        /usr/share/gogorabbit/go-go-rabbit-server_Data/Mono/x86_64/libmono.so(+0x92db2) [0x7fb319da8db2]
        /lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0) [0x7fb31c8a2cb0]
        /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35) [0x7fb31bdef425]
        /lib/x86_64-linux-gnu/libc.so.6(abort+0x17b) [0x7fb31bdf2b8b]
        /usr/share/gogorabbit/go-go-rabbit-server.x86_64(_ZN9__gnu_cxx27__verbose_terminate_handlerEv+0x11d) [0x128787d]
        /usr/share/gogorabbit/go-go-rabbit-server.x86_64() [0x1286ae6]
        /usr/share/gogorabbit/go-go-rabbit-server.x86_64() [0x1286b13]
        /usr/share/gogorabbit/go-go-rabbit-server.x86_64() [0x12863ce]
        /usr/share/gogorabbit/go-go-rabbit-server.x86_64(_ZSt19__throw_logic_errorPKc+0x5c) [0x1236bac]
        /usr/share/gogorabbit/go-go-rabbit-server.x86_64(_ZNSs12_S_constructIPKcEEPcT_S3_RKSaIcESt20forward_iterator_tag+0x9f) [0x126bd0f]
        /usr/share/gogorabbit/go-go-rabbit-server.x86_64(_ZNSsC1EPKcRKSaIcE+0x42) [0x126bd82]
        /usr/share/gogorabbit/go-go-rabbit-server.x86_64() [0xb86040]
        /usr/share/gogorabbit/go-go-rabbit-server.x86_64() [0xba8eb4]
        /usr/share/gogorabbit/go-go-rabbit-server.x86_64() [0xba96b0]
        /usr/share/gogorabbit/go-go-rabbit-server.x86_64() [0xbab0d3]
        /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7fb31bdda76d]
        /usr/share/gogorabbit/go-go-rabbit-server.x86_64() [0x44b9b9]

Debug info from gdb:

=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

Does anyone have any idea?

Thanks!

I had a very similar issue (works when starting it “manually” via SSH, but crashes if started from an other process/service).

I compared the used environment variables and tried if anything changes if I use similar environment variables. I found out that I have to use the HOME environment variable, which was not set when starting from service.