mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-09-11 18:58:59 +03:00
Add systemd init files to CLI-only Linux packages (#16866)
This commit is contained in:
parent
d80b751850
commit
dcea5363c6
0
build_scripts/assets/systemd/__init__.py
Normal file
0
build_scripts/assets/systemd/__init__.py
Normal file
16
build_scripts/assets/systemd/chia-crawler@.service
Normal file
16
build_scripts/assets/systemd/chia-crawler@.service
Normal file
@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=Chia Crawler Service for %i
|
||||
Requires=chia-daemon@%i.service
|
||||
After=chia-daemon@%i.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment=CHIA_ROOT=/home/%i/.chia/mainnet
|
||||
ExecStart=/opt/chia/start_crawler
|
||||
User=%i
|
||||
Group=%i
|
||||
LimitNOFILE=1048576
|
||||
LimitNPROC=1048576
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
16
build_scripts/assets/systemd/chia-daemon@.service
Normal file
16
build_scripts/assets/systemd/chia-daemon@.service
Normal file
@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=Chia Daemon Service for %i
|
||||
StopWhenUnneeded=true
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment=CHIA_ROOT=/home/%i/.chia/mainnet
|
||||
ExecStart=/opt/chia/daemon
|
||||
ExecStartPost=/bin/bash -c '(while ! nc -z -v -w1 localhost 55400 2>/dev/null; do echo "Waiting for the daemon to listen on port 55400..."; sleep 1; done); sleep 1'
|
||||
User=%i
|
||||
Group=%i
|
||||
LimitNOFILE=1048576
|
||||
LimitNPROC=1048576
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
17
build_scripts/assets/systemd/chia-data-layer-http@.service
Normal file
17
build_scripts/assets/systemd/chia-data-layer-http@.service
Normal file
@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=Chia Data Layer HTTP Service for %i
|
||||
Requires=chia-daemon@%i.service
|
||||
After=chia-daemon@%i.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment=CHIA_ROOT=/home/%i/.chia/mainnet
|
||||
ExecStart=/opt/chia/start_data_layer_http
|
||||
User=%i
|
||||
Group=%i
|
||||
LimitNOFILE=1048576
|
||||
LimitNPROC=1048576
|
||||
TimeoutStopSec=15
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
17
build_scripts/assets/systemd/chia-data-layer@.service
Normal file
17
build_scripts/assets/systemd/chia-data-layer@.service
Normal file
@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=Chia Data Layer Service for %i
|
||||
Requires=chia-daemon@%i.service
|
||||
After=chia-daemon@%i.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment=CHIA_ROOT=/home/%i/.chia/mainnet
|
||||
ExecStart=/opt/chia/start_data_layer
|
||||
User=%i
|
||||
Group=%i
|
||||
LimitNOFILE=1048576
|
||||
LimitNPROC=1048576
|
||||
TimeoutStopSec=15
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
16
build_scripts/assets/systemd/chia-farmer@.service
Normal file
16
build_scripts/assets/systemd/chia-farmer@.service
Normal file
@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=Chia Farmer Service for %i
|
||||
Requires=chia-daemon@%i.service
|
||||
After=chia-daemon@%i.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment=CHIA_ROOT=/home/%i/.chia/mainnet
|
||||
ExecStart=/opt/chia/start_farmer
|
||||
User=%i
|
||||
Group=%i
|
||||
LimitNOFILE=1048576
|
||||
LimitNPROC=1048576
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
16
build_scripts/assets/systemd/chia-full-node@.service
Normal file
16
build_scripts/assets/systemd/chia-full-node@.service
Normal file
@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=Chia Full Node Service for %i
|
||||
Requires=chia-daemon@%i.service
|
||||
After=chia-daemon@%i.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment=CHIA_ROOT=/home/%i/.chia/mainnet
|
||||
ExecStart=/opt/chia/start_full_node
|
||||
User=%i
|
||||
Group=%i
|
||||
LimitNOFILE=1048576
|
||||
LimitNPROC=1048576
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
16
build_scripts/assets/systemd/chia-harvester@.service
Normal file
16
build_scripts/assets/systemd/chia-harvester@.service
Normal file
@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=Chia Harvester Service for %i
|
||||
Requires=chia-daemon@%i.service
|
||||
After=chia-daemon@%i.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment=CHIA_ROOT=/home/%i/.chia/mainnet
|
||||
ExecStart=/opt/chia/start_harvester
|
||||
User=%i
|
||||
Group=%i
|
||||
LimitNOFILE=1048576
|
||||
LimitNPROC=1048576
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
16
build_scripts/assets/systemd/chia-introducer@.service
Normal file
16
build_scripts/assets/systemd/chia-introducer@.service
Normal file
@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=Chia Introducer Service for %i
|
||||
Requires=chia-daemon@%i.service
|
||||
After=chia-daemon@%i.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment=CHIA_ROOT=/home/%i/.chia/mainnet
|
||||
ExecStart=/opt/chia/start_introducer
|
||||
User=%i
|
||||
Group=%i
|
||||
LimitNOFILE=1048576
|
||||
LimitNPROC=1048576
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
16
build_scripts/assets/systemd/chia-seeder@.service
Normal file
16
build_scripts/assets/systemd/chia-seeder@.service
Normal file
@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=Chia Seeder Service for %i
|
||||
Requires=chia-daemon@%i.service
|
||||
After=chia-daemon@%i.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment=CHIA_ROOT=/home/%i/.chia/mainnet
|
||||
ExecStart=/opt/chia/start_seeder
|
||||
User=%i
|
||||
Group=%i
|
||||
LimitNOFILE=1048576
|
||||
LimitNPROC=1048576
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
16
build_scripts/assets/systemd/chia-timelord@.service
Normal file
16
build_scripts/assets/systemd/chia-timelord@.service
Normal file
@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=Chia Timelord Service for %i
|
||||
Requires=chia-daemon@%i.service
|
||||
After=chia-daemon@%i.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment=CHIA_ROOT=/home/%i/.chia/mainnet
|
||||
ExecStart=/opt/chia/start_timelord
|
||||
User=%i
|
||||
Group=%i
|
||||
LimitNOFILE=1048576
|
||||
LimitNPROC=1048576
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
17
build_scripts/assets/systemd/chia-wallet@.service
Normal file
17
build_scripts/assets/systemd/chia-wallet@.service
Normal file
@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=Chia Wallet Service for %i
|
||||
Requires=chia-daemon@%i.service
|
||||
After=chia-daemon@%i.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment=CHIA_ROOT=/home/%i/.chia/mainnet
|
||||
ExecStart=/opt/chia/start_wallet
|
||||
ExecStartPost=/bin/bash -c '(while ! nc -z -v -w1 localhost 9256 2>/dev/null; do echo "Waiting for the wallet to listen on port 9256..."; sleep 1; done); sleep 1'
|
||||
User=%i
|
||||
Group=%i
|
||||
LimitNOFILE=1048576
|
||||
LimitNPROC=1048576
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -56,7 +56,9 @@ CLI_DEB_BASE="chia-blockchain-cli_$CHIA_INSTALLER_VERSION-1_$PLATFORM"
|
||||
mkdir -p "dist/$CLI_DEB_BASE/opt/chia"
|
||||
mkdir -p "dist/$CLI_DEB_BASE/usr/bin"
|
||||
mkdir -p "dist/$CLI_DEB_BASE/DEBIAN"
|
||||
mkdir -p "dist/$CLI_DEB_BASE/etc/systemd/system"
|
||||
j2 -o "dist/$CLI_DEB_BASE/DEBIAN/control" assets/deb/control.j2
|
||||
cp assets/systemd/*.service "dist/$CLI_DEB_BASE/etc/systemd/system/"
|
||||
cp -r dist/daemon/* "dist/$CLI_DEB_BASE/opt/chia/"
|
||||
|
||||
ln -s ../../opt/chia/chia "dist/$CLI_DEB_BASE/usr/bin/chia"
|
||||
|
@ -50,7 +50,9 @@ bash ./build_license_directory.sh
|
||||
CLI_RPM_BASE="chia-blockchain-cli-$CHIA_INSTALLER_VERSION-1.$REDHAT_PLATFORM"
|
||||
mkdir -p "dist/$CLI_RPM_BASE/opt/chia"
|
||||
mkdir -p "dist/$CLI_RPM_BASE/usr/bin"
|
||||
mkdir -p "dist/$CLI_RPM_BASE/etc/systemd/system"
|
||||
cp -r dist/daemon/* "dist/$CLI_RPM_BASE/opt/chia/"
|
||||
cp assets/systemd/*.service "dist/$CLI_RPM_BASE/etc/systemd/system/"
|
||||
|
||||
ln -s ../../opt/chia/chia "dist/$CLI_RPM_BASE/usr/bin/chia"
|
||||
# This is built into the base build image
|
||||
|
Loading…
Reference in New Issue
Block a user