romanz / electrs

An efficient re-implementation of Electrum Server in Rust
MIT License
1.06k stars 395 forks source link

Config: Point to a specific configuration file #962

Closed JWBurgers closed 10 months ago

JWBurgers commented 10 months ago

Is there any way to stop the service from wanting a configuration file at "/home/electrs/.electrs/config.toml."?

I am unable to point at a specific directory for reading the configuration file in my service file. Below is a copy of my service file.

[Service] ExecStart=/btc-server/electrs/bin/electrs --conf /etc/electrs/electrs.toml --log-filters INFO Type=simple

The service continuously fails to start because it wants to read a configuration file at /home/electrs/.electrs/config.toml. But there is no such file, it should just look at "/etc/electrs/electrs.toml".

JWBurgers commented 10 months ago

I spent some more time on this issue yesterday and realized it was the "ProtectHome=True" setting that affected the start of the service. Even though I had given a specific location for the configuration file, in order to start up Electrs still requires the possibility of access to the home directory, in case I suppose that someone provides that location for the configuration file.

The "ProtectHome=True" setting is fairly standard. It would be good if it had no impact as long as a configuration file location is specified upon execution.

romanz commented 10 months ago

Thanks! https://github.com/romanz/electrs/pull/686 should help with this issue.

Kixunil commented 10 months ago

That's definitely the right solution, I forgot to document it so I did in #963