How to make a service that starts on boot in CentOS?

Since you are using CentOS 7.x, create a Unit. vim /usr/lib/systemd/system/miner.service as root and put the following contents:

[Unit]
Description=miner

[Service]
ExecStart=/path/to/miner

[Install]
WantedBy=multi-user.target

You could add ExecStop= and ExecReload= options if there are specific arguments used to close or reload services.

After that, you just need to systemctl enable miner.service to make it start on each boot.

Related Stuff:

  • Writing basic systemd service files
  • man: systemd.service — Service unit configuration