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.
Monero Stack Exchange is a question and answer site for developers and users of the secure, private and untraceable cryptocurrency Monero. It only takes a minute to sign up.
Sign up to join this communityHow 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.
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)
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.