4

How can I set Wolf's AMD miner (version 0.4) to start on boot with Ubuntu 16.04?

I already have the miner configured to run properly on command in my Downloads folder.

6

sudo nano /etc/systemd/system/runminer.service

In there, paste this (everything between the lines):


[Unit]
Description=Monero GPU miner After=network.target

[Service]
User=YOUR_USER_NAME_HERE
Group=YOUR_USER_NAME_HERE
WorkingDirectory=~

Type=simple
ExecStart=PUT_LAUNCH_COMMAND_HERE_USING_FULL_PATHS

[Install]
WantedBy=multi-user.target


After that, do

sudo systemctl enable runminer.service

Then, to launch right now.

sudo service runminer start

Or just reboot it. To see if its running, run

sudo service runminer status

to see the full logs, try

sudo journalctl -u runminer.service

(caveat - I think that should all work. Haven't tried it yet)

  • Somewhere in there you're going to need to set the DISPLAY environment variable. The AMD drivers require an active X server. Also I'm not sure this will work past an actual login. I.e., the X server that the display manager/login window uses may not allow the miner to share the server with the logged-in user. – hyc Oct 25 '16 at 12:42
1

I found it easier to use the app screen.

sudo apt-get install screen

Then, do as Ginger Ale advised..

sudo nano /etc/systemd/system/runminer.service

[Unit]
Description=Start Up My Miner
After=network.target

[Service]
Type=forking
User=YOUR_USER_NAME
ExecStart=/usr/bin/screen -d -m -S miner PATH_TO_MINER
ExecStop=/usr/bin/killall -w -s 2 miner
WorkingDirectory=PATH_TO_HOME_DIRECTORY

[Install]
WantedBy=multi-user.target

If you're interested, check out how to autostart a screen with systemd and this helpful stack question on how to write startup scripts.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.