I am using Jenkins as part of my unity build. Part of my unity build script starts a command prompt process and runs a command to upload generated files to a remote server.
I am running into issues with keeping that process alive once the unity build is complete. Does anyone have experience or suggestions for this?
I’ve looks at this page, but am unsure on how to incorporate that into my unity build script.
This may seem indelicate, but the best answer I’ve seen is “Don’t try to keep processes created by the build alive after the build has finished”.
Find another way to start the process so that the build is not controlling the process. For example, use systemd to run the process on Linux or a service to run the process on Windows. Register the process to be started with something that manages services, then let that service manager control the starting and stopping of the service.
Jenkins works very hard to not leak processes from builds. A leaked process from a build is a process that continues running after the build has completed. It is possible to do it, but it means you are trying to prevent Jenkins from defending itself against leaked processes when Jenkins is trying to prevent leaked processes. The conflict is not worth the effort.