The Installation Instructions for Ubuntu suggest running geth
from the command line, how can I run it as daemon process / service on Ubuntu?
Go-Ethereum – Running as a Daemon Process on Ubuntu
daemongo-ethereumUbuntu
daemongo-ethereumUbuntu
The Installation Instructions for Ubuntu suggest running geth
from the command line, how can I run it as daemon process / service on Ubuntu?
Best Answer
Run as a systemd service
Create a file
geth.service
:Enable service:
Source.
Alternatively you could use screen:
Then you can make a bash similar to this (
~/geth.sh
):now let's make it executable:
You can now run the bash
~/geth.sh
If you want to attach to the geth console after the process runs in the background (or in screen), you can use:
Source.
Or simply fork it in background:
When starting geht, put a
&
at the end of the command in a terminal:Before closing the terminal you should disown the process:
You could also pipe the logs to a file like that:
But don't forget to disown it before you close the terminal.
Source.