Skip to content
This repository has been archived by the owner on Feb 25, 2023. It is now read-only.

Commit

Permalink
bbbmiddleware: add hsmserialport to config (#288)
Browse files Browse the repository at this point in the history
Because:
* The HSM serial port (default: /dev/ttyS2) needs to be passed by
  command line to the bbbmiddleware.
* This is what the /etc/bbbmiddleware/bbbmiddleware.conf is for, so
  the configuration is stored in Redis and loaded as environment
  variable into systemd unit.

This commit:
* adds Redis keys bbbmiddleware:datadir and bbbmiddleware:hsmserialport
* adds these to the config template bbbmiddleware.conf.template
* loads them as env variables and passes them to the binary as cli
  arguments in the systemd unit
  • Loading branch information
Stadicus authored Nov 27, 2019
1 parent c4c8258 commit a37de81
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions armbian/base/config/redis/factorysettings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ SET base:updating 0
SET base:setup 0

SET middleware:passwordSetup 0
SET middleware:datadir /data/bbbmiddleware
SET middleware:hsmserialport /dev/ttyS2

SET tor:base:enabled 1
SET tor:ssh:enabled 0
Expand Down
2 changes: 2 additions & 0 deletions armbian/base/config/templates/bbbmiddleware.conf.template
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{{ #output: /etc/bbbmiddleware/bbbmiddleware.conf }}
DATADIR={{ middleware:datadir #default: /data/bbbmiddleware }}
HSMSERIALPORT={{ middleware:hsmserialport #default: /dev/ttyS2 }}
3 changes: 2 additions & 1 deletion armbian/base/rootfs/etc/systemd/system/bbbmiddleware.service
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ After=multi-user.target bitcoind.service
EnvironmentFile=/etc/bbbmiddleware/bbbmiddleware.conf
ExecStartPre=/opt/shift/scripts/systemd-bbbmiddleware-startpre.sh
ExecStart=/usr/local/sbin/bbbmiddleware \
-datadir=/data/bbbmiddleware
-datadir=${DATADIR} \
-hsmserialport=${HSMSERIALPORT}

# Process management
####################
Expand Down

0 comments on commit a37de81

Please sign in to comment.