mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 06:06:44 +00:00
add systemd service and socket files
This commit is contained in:
parent
9e323d65b2
commit
32934f360f
3 changed files with 44 additions and 0 deletions
25
README.md
25
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.
|
||||
|
|
|
|||
12
geth.service
Normal file
12
geth.service
Normal file
|
|
@ -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
|
||||
|
||||
|
||||
7
geth.socket
Normal file
7
geth.socket
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[Unit]
|
||||
Description=geth daemon (socket activation)
|
||||
|
||||
[Socket]
|
||||
ListenStream=%t/geth.ipc
|
||||
|
||||
|
||||
Loading…
Reference in a new issue