I launch an ssh connection with the execution of commands (go to a folder, export variables for the go environment, invoke the bash script to kill the go process and compile the program with running in the background. It looks like this:
ssh login@myip -p myport 'cd /path/ && export GOROOT=/usr/local/go && export GOPATH=/path/ && export PATH=$GOPATH/bin:$GOROOT/bin:$PATH && ./compile.sh' further the script compile.sh
pkill goserver go build -o goserver main.go ./goserver & As a result, the program starts to compile, but there is no care in the background, but it hangs as if it started a go run and when you press ctrl + c, the process naturally dies.
And if you go to the server separately and run the same compile.sh, everything works fine. what is the problem ? Tell me please.
screen,tmux,nohupin the end ... - 0andriy