rc.d startup script for electrum-personal-server

Bashern

Dabbler
Joined
Sep 1, 2015
Messages
26
So, I'm working on adapting this guide to FreeBSD, and I got it all working, except for a rc.d startup script.
https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_64_electrum.md

Running the following at the command line works:
/root/.local/bin/electrum-personal-server /root/eps-v0.1.6/config.cfg
Here is a basic script that *should* work.
Code:
#!/bin/sh

# REQUIRE: LOGIN

. /etc/rc.subr

name=electrumpersonalserver
rcvar=electrumpersonalserver_enable
command=root/.local/bin/electrum-personal-server
command_args=/root/eps-v0.1.6/config.cfg
command_interpreter=/usr/local/bin/python3.6
start_cmd="$command"

load_rc_config $name
run_rc_command "$1"


But I get the following error when I run service electrumpersonalserver start:
Code:
Traceback (most recent call last):
  File "root/.local/bin/electrum-personal-server", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3098, in <module>
    @_call_aside
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3082, in _call_aside
    f(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3111, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 573, in _build_master
    ws.require(__requires__)
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 891, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 777, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'electrum-personal-server==0.1.4.dev0' distribution was not found and is required by the application


Any ideas?
 
Last edited:
D

dlavigne

Guest
Shouldn't command=root/.local/bin/electrum-personal-server be /usr/local/bin/electrum-personal-server?
 

Bashern

Dabbler
Joined
Sep 1, 2015
Messages
26
I moved the binaries to /usr/local/bin/electrum-personal-server but have the same problem. It's odd, because it works in the command line, but not in a startup script...
 

Bashern

Dabbler
Joined
Sep 1, 2015
Messages
26
Yes, I did. Turns out I ran the install wrong. I ran pip3 install --user . as root. If installing as root, then user should not be specified, the following worked:
pip3 install .

It is my understanding that installing software as root in a jail does not pose a security threat... if anyone knows different, let me know!

If anyone wants a guide on installing electrum-personal-server, I wrote one here:
https://medium.com/@seth586/freenas-jail-install-electrum-personal-server-9ca9eea96046
 
Top