Changed users - every coin has its own
This commit is contained in:
parent
b763f16361
commit
c8386cee9f
@ -4,16 +4,16 @@ set -e
|
||||
case "$1" in
|
||||
|
||||
configure)
|
||||
if ! id -u blockbook &> /dev/null
|
||||
if ! id -u blockbook-bch &> /dev/null
|
||||
then
|
||||
useradd --system -M -U blockbook
|
||||
useradd --system -M -U blockbook-bch
|
||||
fi
|
||||
|
||||
for dir in /opt/coins/data/bch-testnet/blockbook /opt/coins/blockbook/bch-testnet/logs
|
||||
do
|
||||
if [ "$(stat -c '%U' $dir)" != "blockbook" ]
|
||||
if [ "$(stat -c '%U' $dir)" != "blockbook-bch" ]
|
||||
then
|
||||
chown -R blockbook:blockbook $dir
|
||||
chown -R blockbook-bch:blockbook-bch $dir
|
||||
fi
|
||||
done
|
||||
;;
|
||||
|
||||
@ -10,7 +10,7 @@ After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/coins/blockbook/bch-testnet/bin/blockbook -coin=bch-testnet -blockchaincfg=/opt/coins/blockbook/bch-testnet/config/blockchaincfg.json -datadir=/opt/coins/data/bch-testnet/blockbook/db -sync -httpserver=:18435 -socketio=:18436 -certfile=/opt/coins/blockbook/bch-testnet/cert/blockbook -explorer=https://bitcoincash.blockexplorer.com/ -log_dir=/opt/coins/blockbook/bch-testnet/logs
|
||||
User=blockbook
|
||||
User=blockbook-bch
|
||||
Type=simple
|
||||
Restart=on-failure
|
||||
WorkingDirectory=/opt/coins/blockbook/bch-testnet
|
||||
|
||||
@ -4,16 +4,16 @@ set -e
|
||||
case "$1" in
|
||||
|
||||
configure)
|
||||
if ! id -u blockbook &> /dev/null
|
||||
if ! id -u blockbook-bch &> /dev/null
|
||||
then
|
||||
useradd --system -M -U blockbook
|
||||
useradd --system -M -U blockbook-bch
|
||||
fi
|
||||
|
||||
for dir in /opt/coins/data/bch/blockbook /opt/coins/blockbook/bch/logs
|
||||
do
|
||||
if [ "$(stat -c '%U' $dir)" != "blockbook" ]
|
||||
if [ "$(stat -c '%U' $dir)" != "blockbook-bch" ]
|
||||
then
|
||||
chown -R blockbook:blockbook $dir
|
||||
chown -R blockbook-bch:blockbook-bch $dir
|
||||
fi
|
||||
done
|
||||
;;
|
||||
|
||||
@ -10,7 +10,7 @@ After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/coins/blockbook/bch/bin/blockbook -coin=bch -blockchaincfg=/opt/coins/blockbook/bch/config/blockchaincfg.json -datadir=/opt/coins/data/bch/blockbook/db -sync -httpserver=:8435 -socketio=:8436 -certfile=/opt/coins/blockbook/bch/cert/blockbook -explorer=https://bitcoincash.blockexplorer.com/ -log_dir=/opt/coins/blockbook/bch/logs
|
||||
User=blockbook
|
||||
User=blockbook-bch
|
||||
Type=simple
|
||||
Restart=on-failure
|
||||
WorkingDirectory=/opt/coins/blockbook/bch
|
||||
|
||||
@ -4,16 +4,16 @@ set -e
|
||||
case "$1" in
|
||||
|
||||
configure)
|
||||
if ! id -u blockbook &> /dev/null
|
||||
if ! id -u blockbook-btc &> /dev/null
|
||||
then
|
||||
useradd --system -M -U blockbook
|
||||
useradd --system -M -U blockbook-btc
|
||||
fi
|
||||
|
||||
for dir in /opt/coins/data/btc-testnet/blockbook /opt/coins/blockbook/btc-testnet/logs
|
||||
do
|
||||
if [ "$(stat -c '%U' $dir)" != "blockbook" ]
|
||||
if [ "$(stat -c '%U' $dir)" != "blockbook-btc" ]
|
||||
then
|
||||
chown -R blockbook:blockbook $dir
|
||||
chown -R blockbook-btc:blockbook-btc $dir
|
||||
fi
|
||||
done
|
||||
;;
|
||||
|
||||
@ -10,7 +10,7 @@ After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/coins/blockbook/btc-testnet/bin/blockbook -coin=btc-testnet -blockchaincfg=/opt/coins/blockbook/btc-testnet/config/blockchaincfg.json -datadir=/opt/coins/data/btc-testnet/blockbook/db -sync -httpserver=:18335 -socketio=:18336 -certfile=/opt/coins/blockbook/btc-testnet/cert/blockbook -explorer=https://bitcore1.trezor.io/ -log_dir=/opt/coins/blockbook/btc-testnet/logs
|
||||
User=blockbook
|
||||
User=blockbook-btc
|
||||
Type=simple
|
||||
Restart=on-failure
|
||||
WorkingDirectory=/opt/coins/blockbook/btc-testnet
|
||||
|
||||
@ -4,16 +4,16 @@ set -e
|
||||
case "$1" in
|
||||
|
||||
configure)
|
||||
if ! id -u blockbook &> /dev/null
|
||||
if ! id -u blockbook-btc &> /dev/null
|
||||
then
|
||||
useradd --system -M -U blockbook
|
||||
useradd --system -M -U blockbook-btc
|
||||
fi
|
||||
|
||||
for dir in /opt/coins/data/btc/blockbook /opt/coins/blockbook/btc/logs
|
||||
do
|
||||
if [ "$(stat -c '%U' $dir)" != "blockbook" ]
|
||||
if [ "$(stat -c '%U' $dir)" != "blockbook-btc" ]
|
||||
then
|
||||
chown -R blockbook:blockbook $dir
|
||||
chown -R blockbook-btc:blockbook-btc $dir
|
||||
fi
|
||||
done
|
||||
;;
|
||||
|
||||
@ -10,7 +10,7 @@ After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/coins/blockbook/btc/bin/blockbook -coin=btc -blockchaincfg=/opt/coins/blockbook/btc/config/blockchaincfg.json -datadir=/opt/coins/data/btc/blockbook/db -sync -httpserver=:8335 -socketio=:8336 -certfile=/opt/coins/blockbook/btc/cert/blockbook -explorer=https://bitcore1.trezor.io/ -log_dir=/opt/coins/blockbook/btc/logs
|
||||
User=blockbook
|
||||
User=blockbook-btc
|
||||
Type=simple
|
||||
Restart=on-failure
|
||||
WorkingDirectory=/opt/coins/blockbook/btc
|
||||
|
||||
@ -4,16 +4,16 @@ set -e
|
||||
case "$1" in
|
||||
|
||||
configure)
|
||||
if ! id -u blockbook &> /dev/null
|
||||
if ! id -u blockbook-zec &> /dev/null
|
||||
then
|
||||
useradd --system -M -U blockbook
|
||||
useradd --system -M -U blockbook-zec
|
||||
fi
|
||||
|
||||
for dir in /opt/coins/data/zec/blockbook /opt/coins/blockbook/zec/logs
|
||||
do
|
||||
if [ "$(stat -c '%U' $dir)" != "blockbook" ]
|
||||
if [ "$(stat -c '%U' $dir)" != "blockbook-zec" ]
|
||||
then
|
||||
chown -R blockbook:blockbook $dir
|
||||
chown -R blockbook-zec:blockbook-zec $dir
|
||||
fi
|
||||
done
|
||||
;;
|
||||
|
||||
@ -10,7 +10,7 @@ After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/coins/blockbook/zec/bin/blockbook -coin=zec -blockchaincfg=/opt/coins/blockbook/zec/config/blockchaincfg.json -datadir=/opt/coins/data/zec/blockbook/db -sync -httpserver=:8235 -socketio=:8236 -certfile=/opt/coins/blockbook/zec/cert/blockbook -explorer=https://zec-bitcore1.trezor.io/ -log_dir=/opt/coins/blockbook/zec/logs
|
||||
User=blockbook
|
||||
User=blockbook-zec
|
||||
Type=simple
|
||||
Restart=on-failure
|
||||
WorkingDirectory=/opt/coins/blockbook/zec
|
||||
|
||||
@ -4,14 +4,14 @@ set -e
|
||||
case "$1" in
|
||||
|
||||
configure)
|
||||
if ! id -u bitcoin &> /dev/null
|
||||
if ! id -u bcash &> /dev/null
|
||||
then
|
||||
useradd --system -M -U bitcoin
|
||||
useradd --system -M -U bcash
|
||||
fi
|
||||
|
||||
if [ "$(stat -c '%U' /opt/coins/data/bch/bitcoin)" != "bitcoin" ]
|
||||
if [ "$(stat -c '%U' /opt/coins/data/bch/bitcoin)" != "bcash" ]
|
||||
then
|
||||
chown bitcoin:bitcoin /opt/coins/data/bch/bitcoin
|
||||
chown bcash:bcash /opt/coins/data/bch/bitcoin
|
||||
fi
|
||||
;;
|
||||
|
||||
|
||||
@ -12,12 +12,12 @@ Description=Bitcoin Cash daemon (mainnet)
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/coins/nodes/bitcoin-abc/bch/bin/bitcoind -datadir=/opt/coins/data/bch/bitcoin -conf=/opt/coins/nodes/bitcoin-abc/bch/bch.conf -pid=/run/bitcoind/bch.pid
|
||||
# Creates /run/bitcoind owned by bitcoin
|
||||
RuntimeDirectory=bitcoind
|
||||
User=bitcoin
|
||||
ExecStart=/opt/coins/nodes/bitcoin-abc/bch/bin/bitcoind -datadir=/opt/coins/data/bch/bitcoin -conf=/opt/coins/nodes/bitcoin-abc/bch/bch.conf -pid=/run/bitcoin-abc/bch.pid
|
||||
# Creates /run/bitcoin-abc owned by bcash
|
||||
RuntimeDirectory=bitcoin-abc
|
||||
User=bcash
|
||||
Type=forking
|
||||
PIDFile=/run/bitcoind/bch.pid
|
||||
PIDFile=/run/bitcoin-abc/bch.pid
|
||||
Restart=on-failure
|
||||
|
||||
# Hardening measures
|
||||
|
||||
@ -4,14 +4,14 @@ set -e
|
||||
case "$1" in
|
||||
|
||||
configure)
|
||||
if ! id -u bitcoin &> /dev/null
|
||||
if ! id -u bcash &> /dev/null
|
||||
then
|
||||
useradd --system -M -U bitcoin
|
||||
useradd --system -M -U bcash
|
||||
fi
|
||||
|
||||
if [ "$(stat -c '%U' /opt/coins/data/bch-testnet/bitcoin)" != "bitcoin" ]
|
||||
if [ "$(stat -c '%U' /opt/coins/data/bch-testnet/bitcoin)" != "bcash" ]
|
||||
then
|
||||
chown bitcoin:bitcoin /opt/coins/data/bch-testnet/bitcoin
|
||||
chown bcash:bcash /opt/coins/data/bch-testnet/bitcoin
|
||||
fi
|
||||
;;
|
||||
|
||||
|
||||
@ -12,12 +12,12 @@ Description=Bitcoin Cash daemon (testnet)
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/coins/nodes/bitcoin-abc/bch-testnet/bin/bitcoind -datadir=/opt/coins/data/bch-testnet/bitcoin -conf=/opt/coins/nodes/bitcoin-abc/bch-testnet/bch-testnet.conf -pid=/run/bitcoind/bch-testnet.pid
|
||||
# Creates /run/bitcoind owned by bitcoin
|
||||
RuntimeDirectory=bitcoind
|
||||
User=bitcoin
|
||||
ExecStart=/opt/coins/nodes/bitcoin-abc/bch-testnet/bin/bitcoind -datadir=/opt/coins/data/bch-testnet/bitcoin -conf=/opt/coins/nodes/bitcoin-abc/bch-testnet/bch-testnet.conf -pid=/run/bitcoin-abc/bch-testnet.pid
|
||||
# Creates /run/bitcoin-abc owned by bcash
|
||||
RuntimeDirectory=bitcoin-abc
|
||||
User=bcash
|
||||
Type=forking
|
||||
PIDFile=/run/bitcoind/bch-testnet.pid
|
||||
PIDFile=/run/bitcoin-abc/bch-testnet.pid
|
||||
Restart=on-failure
|
||||
|
||||
# Hardening measures
|
||||
|
||||
Loading…
Reference in New Issue
Block a user