I cant use the watchdog on linux, I get error mesg : permission denied, any hint how to fix this please
chmod +x watchdog
I get now error msg on line 16 17 and 18 about sysrq permission denied
Thanks
For MAGIC_SYSRQ restarts, you have to be root to write to /proc/sys/kernel/sysrq. So make sure you are launching optiminer as root. Just add 'sudo' in your startup script and make sure your user is authorized in /etc/sudoers to call it without requiring a password.
sudo ./optiminer-zcash -s mypool -u mywallet -p x --watchdog-timeout 30 --watchdog-cmd ./reboot.sh
For /etc/sudoers, you can add something like this...
yourusername ALL=(ALL) NOPASSWD: ALL
I see that you're a newbie, but I hope everyone reading your post realizes that you are suggesting a change that represents are *large* security hole. All you really need to do is create an /etc/rc.local script, which always runs as "root", that's something like this:
#!/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.
#
j="/home/joe"
echo "==========================" >> /sto/m1/miner-reboot.log
date >> /sto/m1/miner-reboot.log
if [ -f $j/.reboot ]
then
rm $j/.reboot
fi
$j/bin/watchdog.root >> /sto/m1/reboot.log &
exit 0
watchdog.root looks like this:
#!/bin/bash
while :
do
sleep 3
if [ -f /home/joe/.no-reboot ]
then
continue
fi
if [ -f /home/joe/.reboot ]
then
rm /home/joe/.reboot
echo "============================"
date
echo "Watchdog hard reset, GPU HUNG."
echo 1 > /proc/sys/kernel/sysrq
echo u > /proc/sysrq-trigger
sleep 1
echo b > /proc/sysrq-trigger
fi
if [ -f /home/joe/.restart ]
then
rm /home/joe/.restart
su joe -c /home/joe/bin/s-opt #Start miners as user "joe"
fi
done
exit 0
=============
Note: Watchdog.root can be disabled at any time simply by doing a "touch ~/.no-reboot". Doing "touch ~/.reboot", which your normal user_id can do, will cause an immediate hard reset and reboot. So, the optiminer watchdog-cmd.sh script needs no root access and can just do "touch ~/.reboot" to trigger the hard reset. Finally, if you want to just restart optiminer, without a reboot, do a "touch ~/.restart".
Anyway, I hope that's somewhat helpful.