I've been trying to simplify the process of restarting my Ether mining rigs so I don't have to set up the terminal and manually clock each GPU.
I wrote a script to run in systemd. The text of the .sh and the .service files will be below.
The .sh consists of two parts. The first clocks each of the nine cards then the second runs the mining application.
On startup, the first part of the script doesn't run, but the second part to initialize mining does.
When I run the .sh directly both parts do run correctly; the power is set and mining is started. When I run a start command on the .service directly in Terminal it runs into the same incomplete execution as when it runs at boot.
The service has been enabled. The file pathways are correct. The permissions to run the sudo lines have been given.
I've read through just about every source I could find, and I and my partner are stumped as to where the disconnect is.
What in the script needs to be changed to get this to execute?
Below are the .sh and the .service:
start.sh
#!/bin/sh
sudo nvidia-smi -i 0 -pl 70
sudo nvidia-smi -i 1 -pl 70
sudo nvidia-smi -i 2 -pl 70
sudo nvidia-smi -i 3 -pl 70
sudo nvidia-smi -i 4 -pl 70
sudo nvidia-smi -i 5 -pl 70
sudo nvidia-smi -i 6 -pl 70
sudo nvidia-smi -i 7 -pl 70
sudo nvidia-smi -i 8 -pl 70
#!/bin/sh
/home/rigf/Desktop/mine/t-rex-0.22.1-linux/t-rex -a ethash -o stratum+tcp://stratum-eth.antpool.com:8008 -u 0xE19e9BC0d9D9C178E51BC8C04F788cDF6a123a36 -p x -w RigF
rigstart.service
[Unit]
Description=Rig boot protocol
[Service]
Type=simple
ExecStart=/home/rigf/Desktop/mine/t-rex-0.22.1-linux/start.sh
[Install]
WantedBy=multi-user.target
This is being done on Ubuntu 20.04.3.