Add systemd service conf. Update setup script
This commit is contained in:
parent
85994d4eb6
commit
1e72f2ade0
|
@ -112,3 +112,6 @@ if ! shopt -oq posix; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/go/bin:/home/user/go/bin
|
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/go/bin:/home/user/go/bin
|
||||||
|
|
||||||
|
export SIA_DATA_DIR=/home/user/siad
|
||||||
|
export SIA_API_PASSWORD=$(cat /home/user/.sia/apipassword)
|
||||||
|
|
|
@ -46,7 +46,7 @@ sudo ufw allow 'Nginx HTTP'
|
||||||
# Install Go 1.13.7.
|
# Install Go 1.13.7.
|
||||||
wget -c https://dl.google.com/go/go1.13.7.linux-amd64.tar.gz
|
wget -c https://dl.google.com/go/go1.13.7.linux-amd64.tar.gz
|
||||||
sudo tar -C /usr/local -xzf go1.13.7.linux-amd64.tar.gz
|
sudo tar -C /usr/local -xzf go1.13.7.linux-amd64.tar.gz
|
||||||
source ~/.bashrc
|
export PATH=$PATH:$HOME/go/bin
|
||||||
rm go1.13.7.linux-amd64.tar.gz
|
rm go1.13.7.linux-amd64.tar.gz
|
||||||
|
|
||||||
# Sanity check that will pass if go was installed correctly.
|
# Sanity check that will pass if go was installed correctly.
|
||||||
|
@ -57,10 +57,17 @@ cwd=$(pwd)
|
||||||
# Install Sia
|
# Install Sia
|
||||||
cd ~/
|
cd ~/
|
||||||
git clone https://gitlab.com/NebulousLabs/Sia
|
git clone https://gitlab.com/NebulousLabs/Sia
|
||||||
cd Sia && git checkout viewnode && make
|
cd Sia && git checkout v1.4.3 && make
|
||||||
|
|
||||||
# Setup skynet frontend.
|
# Setup skynet frontend.
|
||||||
cd $cwd
|
cd $cwd
|
||||||
cd ../
|
cd ../
|
||||||
yarn
|
yarn
|
||||||
yarn build
|
yarn build
|
||||||
|
|
||||||
|
# Enable the systemd service
|
||||||
|
cd $cwd
|
||||||
|
mkdir -p $HOME/.config/systemd/user
|
||||||
|
cp siad.service $HOME/.config/systemd/user/siad.service
|
||||||
|
|
||||||
|
systemctl --user enable siad.service
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
[Unit]
|
||||||
|
Description=siad
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
WorkingDirectory=/home/user/siad
|
||||||
|
Environment="SIA_DATA_DIR=/home/user/siad"
|
||||||
|
Environment="SIA_API_PASSWORD=$(cat /home/user/.sia/apipassword)"
|
||||||
|
Environment="SIA_WALLET_PASSWORD=$(cat /home/user/.sia/walletpassword)"
|
||||||
|
ExecStart=/home/user/go/bin/siad
|
||||||
|
ExecStop=/home/user/go/bin/siac stop
|
||||||
|
Restart=on-failure
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=default.target
|
Reference in New Issue