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.

seek adventure
  • 2,239
  • 14
  • 52
sgp
  • 8,836
  • 7
  • 43
  • 113

2 Answers2

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)

Ginger Ale
  • 5,694
  • 2
  • 19
  • 46
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.