diff --git a/README.md b/README.md index 2d60e0564d..46940c9736 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,31 @@ Go Ethereum comes with several wrappers/executables found in `disasm` | disassembles EVM code: `echo "6001" | disasm` | `rlpdump` | prints RLP structures | +## Start geth with systemd + +Start the get daemon with systemd presents many advantages: +- service will run in the background and thus will not monopolize one shell +- service will run as user and not root +- logs will be managed by [_journalctl_](https://www.freedesktop.org/software/systemd/man/journalctl.html) +- the ```get.ipc``` socket can be created in ```/run/user/userID``` volatile directory. + +### Install + +* place the ```geth.service``` and ```get.socket``` files in ```/etc/systemd/user```. +* create and edit the ```~/.ethereum/get.conf``` file according to the desired options +* enable and start the service: +``` +$ systemctl --user enable get.service +$ systemctl --user start get.service +``` +* verify it is correctly started and running: +``` +$ systemctl --user status geth.service +``` + + + + ## Command line options `geth` can be configured via command line options, environment variables and config files. diff --git a/geth.service b/geth.service new file mode 100644 index 0000000000..0e907618f1 --- /dev/null +++ b/geth.service @@ -0,0 +1,12 @@ +[Unit] +Description=Geth Daemon +Requires=geth.socket + +[Service] +EnvironmentFile=%h/.ethereum/geth.conf +ExecStart=/usr/bin/geth $ARGS + +[Install] +WantedBy=default.target + + diff --git a/geth.socket b/geth.socket new file mode 100644 index 0000000000..0ca8fa4f5f --- /dev/null +++ b/geth.socket @@ -0,0 +1,7 @@ +[Unit] +Description=geth daemon (socket activation) + +[Socket] +ListenStream=%t/geth.ipc + +