Hoping some linux or screen guru can help here with rebooting when a GPU is sick/dead.
I've got the options configured correctly for sgminer-gm to attempt the reboot after gpu-failure, but since I'm not running sgminer as sudo, the program spits out a permissions error.
I'm using screen to create a new session, start the miner at every boot. I only run into a problem when a GPU flunks out on me, and I'm new to linux, so still learning systemd. Does anyone know the proper way to let sgminer reboot when it attempts to?
I'm on Ubuntu 16.04 kernel 4.8.3-040803-generic amdgpu-pro-16.50
Here's the error (from within the miner)..
Thread 0 still exists, killing it off
Failed to set wall message, ignoring: Interactive authentication required.
Failed to reboot system via logind: Interactive authentication required.
Failed to start reboot.target: Interactive authentication required.
See system logs and 'systemctl status reboot.target' for details.
Failed to open /dev/initctl: Permission denied
Failed to talk to init daemon.
GPU0: Not responded for more than 10 minutes, declaring DEAD!
running shutdown -r now
Failed to set wall message, ignoring: Interactive authentication required.
Failed to reboot system via logind: Interactive authentication required.
Failed to start reboot.target: Interactive authentication required.
See system logs and 'systemctl status reboot.target' for details.
Failed to open /dev/initctl: Permission denied
Failed to talk to init daemon."systemctl status reboot.target" shows..
● reboot.target - Reboot
Loaded: loaded (/lib/systemd/system/reboot.target; enabled; vendor preset: disabled)
Active: inactive (dead)
Docs: man:systemd.special(7)
My systemd service to start up the miner (which works fine afaik) is the following:
[Unit]
Description=Monero GPU miner
After=network.target multi-user.target
[Service]
Type=forking
User=miner
Environment="DISPLAY=:0"
Environment="GPU_MAX_ALLOC_PERCENT=100"
Environment="GPU_USE_SYNC_OBJECTS=1"
WorkingDirectory=/home/kaminer/sgminer-gm/
ExecStart=/usr/bin/screen -d -m -S sgminer /usr/local/bin/sgminer
ExecStop=/usr/bin/killall -w -s 2 sgminer
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
I'm thinking I should be able to elevate priveleges for certain screen sessions or maybe make an alias for the reboot command within that session (so that I am only changing the priveleges within that single command w/in that single session) but am having a hard time figuring out how.