Skip to content

👾 Linux systemd service, optionally with tmux

SiemdeNijs edited this page May 16, 2022 · 3 revisions

How to automatically start the miner on Linux with systemd (optionally with tmux)

If you wish to run the PKT miner (whether original, self-compiled, or SNcomp) on Linux, you can use these systemd services and pre-filled scripts run run the miner on boot one the network is active. If you wish, you can use tmux to run the miner and attach it to a screen (option 2). This would allow you to 'attach' to the screen, as if you were running the miner in your current terminal.


ℹ️🔧 to get started, make sure you have "wget", if you don't: install it with the following command

apt install wget

Tip: it might vary based on your distro, apt-get , apt, pacman, etc. DYOR if it doesn't work or result to curl

🐧 Linux native, option one: systemd (option 1)

wget -O /etc/systemd/system/pkt.service https://github.com/SiemdeNijs/packetcrypt_rs_SNcomp/releases/download/release/pkt.service
wget -O ~/packetcrypt https://github.com/SiemdeNijs/packetcrypt_rs_SNcomp/releases/download/release/packetcrypt_x8664_linux && sudo chmod +x ~/packetcrypt
wget -O ~/minepkt.sh https://github.com/SiemdeNijs/packetcrypt_rs_SNcomp/releases/download/release/minepkt.sh && sudo chmod +x ~/minepkt.sh

sudo nano ~/minepkt.sh ⚠️ edit to your personal pkt address ! ⚠️ Optionally add "-t number" to limit the threads used.

Hit CTRL + X To exit, "Y" to save when prompted.

Use the following command on Debian/Ubuntu, etc, to get the full path

readlink -e ~/minepkt.sh

sudo nano /etc/systemd/system/pkt.service ⚠️ edit ~/minepkt.sh path to your path ! For example /root/minepkt.sh ! ⚠️.

Hit CTRL + X To exit, "Y" to save when prompted.

sudo systemctl enable pkt

Done. See commands below.

Enable/Disable service

systemctl enable pkt

ℹ️ otherwise: 'systemctl disable pkt'

Stop the miner

systemctl stop pkt

Start the miner

systemctl start pkt

Status of the miner

systemctl status pkt

🐧 Linux native, option two: systemd with tmux (option 2)

wget -O /etc/systemd/system/pkt.service https://github.com/SiemdeNijs/packetcrypt_rs_SNcomp/releases/download/release/pkttmux.service
wget -O ~/packetcrypt https://github.com/SiemdeNijs/packetcrypt_rs_SNcomp/releases/download/release/packetcrypt_x8664_linux && sudo chmod +x ~/packetcrypt
wget -O ~/minepkt.sh https://github.com/SiemdeNijs/packetcrypt_rs_SNcomp/releases/download/release/minepkt.sh && sudo chmod +x ~/minepkt.sh
wget -O ~/pkttmuxmine.sh https://github.com/SiemdeNijs/packetcrypt_rs_SNcomp/releases/download/release/pkttmuxmine.sh && sudo chmod +x ~/pkttmuxmine.sh

sudo nano ~/minepkt.sh ⚠️ edit to your personal pkt address ! ⚠️ Optionally add "-t number" to limit the threads used

Hit CTRL + X To exit, "Y" to save when prompted.

Use the following command on Debian/Ubuntu, etc, to get the full path

readlink -e ~/minepkt.sh

sudo nano /etc/systemd/system/pkt.service ⚠️ edit ~/pkttmuxmine.sh path to your path ! For example /root/pkttmuxmine.sh ! ⚠️.

Hit CTRL + X To exit, "Y" to save when prompted.

sudo systemctl enable pkt

Done. See commands below.

Enable/Disable service

systemctl enable pkt

ℹ️ otherwise: 'systemctl disable pkt'

Stop the miner

systemctl stop pkt

Start the miner

systemctl start pkt

Status of the miner

systemctl status pkt

Tmux session is called "miner"

Show miner session:

tmux attach-session -t miner

Detatch from session with ctrl + shift + b, then release and hit "d" to detatch.

[or find the corresponding tmux commands for your system]

Clone this wiki locally