Unreal dedicated linux server 30 seconds delay before log open

For some reason after I launch my linux game server, it hangs for about half a minute before starting to print anything or opening and writing into the log.

This is because I launched server like this:

./LinuxServer/ECRServer.sh ....

but it should be launched like this:

./LinuxServer/ECR/Binaries/Linux/ECRServer ECR ...

then it didn’t hangs 30 second on the line in .sh script where it does chmod +x on the above executable. I traced it with strace to find the freezing point:

20    17:24:07.070744 fchmodat(AT_FDCWD, "/ecr-server/LinuxServer/ECR/Binaries/Linux/ECRServer", 0755) = 0
20    17:24:34.121378 close(1)          = 0

It happens even though I did chmod +x in my Dockerfile while building this image, but I guess it can be resolved with chmod 0755 since the freeze only happened when server was launched in container first time, next times it didn’t freeze. However, I just went through .sh script straight to launching real executable.