I'm using Azure DevOps (formerly known VSTS) to run a script in a Linux Machine (specifically CentOS machine).
I have an inline script task that runs the process on background, but after the deployment group phase has ended. The process that was created is also terminated.
Below is the sample script I've written
Using screen:
screen -dm ping localhost
Result:
- Release is successful
- Process id can't be found in target server
- Shows that the screen is
dead
Using nohup + redirection + ampersand
nohup ping localhost 2>&1 &
Result:
- The task didn't finished, it's stuck.
Is this the default behavior of VSTS Deployment Agents?
screen
andnohup
are both meant to keep a process running on a machine which keeps running after the user has logged out again or lost connection. They cannot survive a shutdown of the machine. Are you sure in your case that the machine (vm probably) really keeps running after your disconnect? – Alfe