Search Unity

Windows standalone player not starting in batchmode

Discussion in 'Editor & General Support' started by Toadwolf, Sep 22, 2017.

  1. Toadwolf

    Toadwolf

    Joined:
    Sep 4, 2014
    Posts:
    10
    I am trying to run our Unity application (windows standalone) on a Jenkins slave which is a virtual machine on a server without graphics device. The command issued by the Jenkins job is the following:

    cmd /c Start Game.exe -batchmode -nographics -logFile ..\logfiles\log.log

    The application starts but stops almost immediately with the following entries in the log file (please click on it and have a look at the end):
    If I am logging in to the Jenkins slave via remotedesktop and start the application directly with the same command line arguments it runs fine. The log begins identically but continues with the following entries:
    Does anyone have an idea what might happen here, or a hint where I could start looking? Is there a way to get a more verbose output from Unity?

    BTW, I built the application without the "debug" flag. If I do that it tries to connect with any Unity Editor for debugging and stops almost immediately with the message

    Waiting for connection from host on [0.0.0.0:55218]...
     
  2. Toadwolf

    Toadwolf

    Joined:
    Sep 4, 2014
    Posts:
    10
    After some more hours of searching I found out what the problem was. It was not connected to Unity but a Jenkins problem. It is simply that Jenkins, by default, kills all processes and their children once a job is finished. There are some workarounds for Spawning processes from build, but they are not very convenient.

    The best workaround is the one described for Running a background process in Pipeline job, which is to specify an environment variable JENKINS_NODE_COOKIE and set it to "dontkill" before calling your script.
     
    fffMalzbier likes this.