我有10个GPU附加到一个系统,并希望与所有的挖掘,因为ubuntu不允许运行10个GPU在一次,所以将与命令行和能够在那里挖掘。
现在,我想运行我的矿工在系统启动,特别是这是我遵循这教程(步骤-7)。我已经按照教程完成了所有的工作,但是无法在屏幕会话中启动./ start _only_eth.bash命令(没有创建屏幕会话)。
如果我正在执行下面的命令,我可以使用"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会话中运行miner(手动),但是再次无法使用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.发布于 2018-06-02 15:26:34
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作为脚本的第二行。
用实际的用户名替换username。
https://askubuntu.com/questions/1042662
复制相似问题