1 つのシステムに 10 個の GPU が接続されており、すべてを使用してマイニングしたいと考えています。Ubuntu GUI では一度に 10 個の GPU を実行できないため、コマンド ラインを使用してそこでマイニングできるようになります。
今、私はシステムの起動時にマイナーを実行したいのですが、具体的にはこれに従っていますこれチュートリアル (ステップ 7)。チュートリアルのとおりにすべて実行しましたが、screen セッションで ./start_only_eth.bash コマンド (screen セッションが作成されていない) を開始できません。
以下のコマンドを実行すると、「screen -ls」コマンドを使用してこのセッションを見つけることができます。
screen -dmS ethm
以下は私のスクリプトです(demo.sh)
// アップデート
#!/bin/bash
DEFAULT_DELAY=0
if [ "x$1" = "x" -o "x$1" = "xnone" ]; then
DELAY=$DEFAULT_DELAY
else
DELAY=$1
fi
sleep $DELAY
su aman -c "screen -dmS ethm /home/aman/Desktop/claymore/start_only_eth.bash"
rc.localファイルにこのスクリプトのパスを追加しました。これチュートリアル(ステップ7)。
以下は私のrc.localです
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
sh '/home/aman/Desktop/demo.sh'
exit 0
再起動後、「screen -ls」コマンドを実行すると、以下のメッセージが表示されます。
No Sockets found in /var/run/screen/S-aman.
注: 問題は rc.local ではなく、demo.sh にあると思います。demo.sh を手動で実行しようとすると、スクリプトは失敗し、上記のメッセージが表示されます。
// // -------------------------- TMUX の場合 -------------------- // //
私もこれをtmuxで試してみましたが、今回はtmuxセッションでマイナーを(手動で)実行できましたが、rc.localを使用してスクリプトを実行することができませんでした。以下は私のdemo.shです。
#!/bin/bash
tmux new-session -d -n MINER
tmux send-keys -t MINER "cd /home/aman/Desktop/claymore" C-m
tmux send-keys -t MINER "./start_only_eth.bash" C-m
以下は、rc.local をテストしようとしたときに取得したもの (コンソール) です。
aman@aman-System-Product-Name:~$ sudo /etc/init.d/rc.local start
[sudo] password for aman:
[ ok ] Starting rc.local (via systemctl): rc.local.service.
答え1
cd /home/Desktop/claymore
su aman -c "screen -dmS ethm ./start_only_eth.bash"
これには複数の問題があります。まず、パスは である可能性があります/home/username/Desktop/claymore
。次に、 はcd
現在のスクリプトに影響し、su を越えて画面に引き継がれない可能性があります。
試す:
su aman -c "screen -dmS ethm /home/username/Desktop/claymore/start_only_eth.bash"
スクリプトでstart_only_eth.bash
PWDをそのディレクトリに設定する必要がある場合は、次の行を追加します。
cd /home/username/Desktop/claymore
スクリプトの 2 行目として。
実際のユーザー名に置き換えますusername
。