Skip to content

systemd geth service file#1

Open
gabx wants to merge 2 commits intobas-vk:masterfrom
gabx:master
Open

systemd geth service file#1
gabx wants to merge 2 commits intobas-vk:masterfrom
gabx:master

Conversation

@gabx
Copy link
Copy Markdown

@gabx gabx commented May 9, 2016

Some improvements:
1- no need to specify Type=simple. It is the default
2- no need to write a log file. Just use journalctl facilities
3- put all your options in one file in your home folder. It will then be easy to modify options: edit the geth.conf, reload the daemon, restart the service.
The config file shall contain one line:

$ARGS="--myOption --mySecondOption"

I wrote a pull request to go-ethereum (#2513) as systemd is now default in many Linux distro.

------------------ OPTIONAL
move the geth.ipc unix socket from the home directory and put it in the recommended and usual /run/user/userID/ directory.
To achieve this, write a systemd socket unit file and add a require in service file.

Requires=geth.socket

## /etc/systemd/user/geth.socket

[Unit]
Description=geth daemon (socket activation)

[Socket]
ListenStream=%t/geth.ipc

@gosuto-inzasheru
Copy link
Copy Markdown

Can you elaborate on the optional geth.ipc move? Why not just define ListenStream=%h/.ethereum/geth.ipc?

@gabx
Copy link
Copy Markdown
Author

gabx commented Oct 5, 2016

@jorijnsmit defining as you suggest, ListenStream=%h/.ethereum/geth.ipc, is not an error and works well. But more generally, a best practice is to place service sockets elsewhere than the home directory, which is not volatile and in Unix philosophy not the place for sockets.
Usually, the volatile /run directory is a very good candidate. /tmp can be used too, but will not offer same speed. /run is mounted as tmpfs filesystems -- meaning it is created at boot and reside in memory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants