Running continuous processes or functions on a virtual machine is essential for any large development process.
Here's how to continuously run a process on Ubuntu, disconnect and then reconnect to access a process' logs.
This might be already installed, check with:
If not, install with one of these commands (OS specific)
yum install screen
apt install screen
Open a screen session:
I'm running a validator in a GCP ubuntu virtual machine so my start command looks like:
sudo mortar server --data-dir ./data-dir --chain genesis.json --libp2p 0.0.0.0:1478 --nat IP-ADDRESS --seal --price-limit 1 &
Just make sure to add
& to the end of whatever command you use. This is let the program to keep running even after you quit the shell session.
You can do this by closing the shell window
Resume screen session:
You should now see the output of the process logs in real time