Set path for config.cfg when starting server.py
See original GitHub issueWhen starting server.py
on startup with a systemd unit, the execution is handled by root and the command needs to specify the full path of both python and eps, e.g.
[Unit]
Description=Electrum Personal Server
After=bitcoind.service
[Service]
Type=simple
ExecStart=/usr/bin/python3 /home/bitcoin/electrum-personal-server/server.py
[Install]
WantedBy=multi-user.target
This gives the error message Non-existant configuration file 'config.cfg'
, as the script assumes that it is started from within the installation directory.
$ sudo systemctl start eps.service
$ sudo systemctl status eps.service
● eps.service - Electrum Personal Server
Loaded: loaded (/etc/systemd/system/eps.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Mar 30 01:21:02 RaspiBolt systemd[1]: Started Electrum Personal Server.
Mar 30 01:21:02 RaspiBolt python3[13963]: 01:21:02,712804 [ LOG] Non-existant configuration file 'config.cfg'
Is it possible to set the full path for the config.cfg
on startup, or do you know of a better way to handle the automatic start with systemd on boot?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Where to put a configuration file in Python? - Stack Overflow
I use ConfigParser to parse the myproject.conf file. In my code, it's easy to load the file with a good path : my_project/conf/myproject.conf....
Read more >Config file and command line options - The Jupyter Notebook
Config file and command line options . The notebook server can be run with a variety of command line arguments. A list...
Read more >Configuration Handling — Flask Documentation (2.2.x)
Configuring from Python Files¶ · $ export YOURAPPLICATION_SETTINGS=/path/to/settings.cfg $ flask run * Running on http://127.0.0.1:5000/ · $ set -x ...
Read more >The CFG API for Python - Documentation sets
The path to the file from which the configuration has been read. You won't usually need to set this, unless you want to...
Read more >Django settings - Django documentation
A settings file is just a Python module with module-level variables. ... If you set DEBUG to False , you also need to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah sorry that was silly of me. The file
config.cfg
isn’t the only one which is accessed.I recoded it so the user configures the current working directory https://github.com/chris-belcher/electrum-personal-server/commit/f33934059b084bc80ad1f2e39a0997114104a604, then every file like debug.log and the SSL certs should be correctly located. It should work, I tested this time much more.
Thanks for the issue. I think the best way to solve this is to allow setting the full path to the config file