svn commit: r522632 - in branches/2020Q1/net-p2p/c-lightning: . files
Mark Linimon
linimon at FreeBSD.org
Sat Jan 11 08:00:17 UTC 2020
Author: linimon
Date: Sat Jan 11 08:00:17 2020
New Revision: 522632
URL: https://svnweb.freebsd.org/changeset/ports/522632
Log:
MFH: r522323
net-p2p/c-lightning: fix bitcoin-cli exec setup
lightningd does execute bitcoin-cli internally during runtime.
Fix two problems with that:
* The bitcoin-cli executable is usually located in
/usr/local/bin/bitcoin-cli but service(8) would remove /usr/local/bin
from PATH before executing our rc script /usr/local/etc/rc.d/lightningd
and so the lightningd daemon would inherit a PATH that does not contain
bitcoin-cli. To fix this give the full path to bitcoin-cli to lightningd.
* bitcoin-cli(1) tries to create its datadir when it starts if it does not
exist. By default that is ${HOME}/.bitcoin. service(8) would set HOME=/
and if / is mounted read-only, then this creation would fail. Because we
don't want this directory created (it is not necessary and remains empty)
tell lightningd to execute
bitcoin-cli --datadir=/some/directory/that/already/exists.
Also, append ${lightningd_extra_args} to the lightingd arguments. This was
forgotten in the initial commit and setting lightningd_extra_args would have
had no effect.
Reported by: https://github.com/bitcoin-software
Approved by: portmgr ("fix broken ports")
Modified:
branches/2020Q1/net-p2p/c-lightning/Makefile
branches/2020Q1/net-p2p/c-lightning/files/lightningd.in
Directory Properties:
branches/2020Q1/ (props changed)
Modified: branches/2020Q1/net-p2p/c-lightning/Makefile
==============================================================================
--- branches/2020Q1/net-p2p/c-lightning/Makefile Sat Jan 11 07:33:38 2020 (r522631)
+++ branches/2020Q1/net-p2p/c-lightning/Makefile Sat Jan 11 08:00:17 2020 (r522632)
@@ -4,6 +4,7 @@
PORTNAME= c-lightning
# To build from an arbitrary git commit comment PORTVERSION and PORTREVISION (if present)
PORTVERSION= 0.8.0
+PORTREVISION= 1
DISTVERSIONPREFIX= v
# and uncomment the following two lines (use for example -git-HEAD or -git-f8d8348c)
#PORTVERSION= 0
Modified: branches/2020Q1/net-p2p/c-lightning/files/lightningd.in
==============================================================================
--- branches/2020Q1/net-p2p/c-lightning/files/lightningd.in Sat Jan 11 07:33:38 2020 (r522631)
+++ branches/2020Q1/net-p2p/c-lightning/files/lightningd.in Sat Jan 11 08:00:17 2020 (r522632)
@@ -36,9 +36,18 @@ command_args=""
command_args="${command_args} --lightning-dir=${lightningd_base_dir}"
command_args="${command_args} --network=${lightningd_network}"
command_args="${command_args} --daemon"
+# service(8) would execute us with LOCALBASE stripped out from PATH,
+# thus specify the full path to bitcoin-cli.
+command_args="${command_args} --bitcoin-cli=%%LOCALBASE%%/bin/bitcoin-cli"
+# bitcoin-cli(1) tries to create its "datadir" (by default ${HOME}/.bitcoin)
+# if it does not exist. Provide something that already exists to avoid the
+# creation of unnecessary empty directories.
+command_args="${command_args} --bitcoin-datadir=${lightningd_base_dir}"
if [ -e "${lightningd_conf}" ] ; then
command_args="${command_args} --conf=${lightningd_conf}"
fi
+
+command_args="${command_args} ${lightningd_extra_args}"
run_rc_command "$1"
More information about the svn-ports-all
mailing list