Running miner as invisible service
See original GitHub issueHello,
I’m trying to run this as part of a headless Debian setup. This requires to run this without any console interfaces or the like.
My “setup” is one bash script that invokes the miner:
#!/bin/bash
cd /root/coinhive/ && coin-hive <SITE_KEY> --threads 1 > miner.log
If I run the miner from command line it works fine. However, as soon as I try to start it as a service or background process, the miner terminates.
So far, I’ve tried:
nohup /root/coinhive/miner &
Resulting in
TypeError: process.stdin.setRawMode is not a function
at Object.<anonymous> (/usr/lib/node_modules/coin-hive/bin/coin-hive:182:15)
at Module._compile (module.js:624:30)
at Object.Module._extensions..js (module.js:635:10)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)
at Function.Module._load (module.js:500:3)
at Function.Module.runMain (module.js:665:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
/root/coinhive/miner &
bg
disown
Resulting in: Process starts in background, but halts/terminates as soon as I hit disown.
Crontab:
@reboot /root/coinhive/miner &
Resulting in:
Miner not starting at all.
Ctrl + Z
doesn’t respond at all.
It seems to me that for the miner to work, there has to be some sort of terminal or window active. Please advise.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Mining with invisible/hidden console on windows?
I'm trying to find a way to run a miner without a gui on windows without it being visible (other than in the...
Read more >Start your miner automatically & running in the background ...
Windows 10. IMPORTANT: This guide will go through the process of automatically starting your miner in the background.
Read more >How to run Cudo Miner in the background as a service
How to run Cudo Miner in the background as a service ; Windows: ; 1. Open the installer ; 2. Select the headless...
Read more >How to Find and Remove a Hidden Miner Virus on Your PC ...
Watch how to remove a hidden Bitcoin mining virus from your computer. If you noticed that your computer – while you're not using...
Read more >What is MEV: A beginner's guide to Ethereum's invisible tax
The miner or maximal extractable value is the highest value extracted from transactions' ordering, inclusion and exclusion during block production.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You could use the miner programatically instead of using the CLI. That
process.stdin.setRawMode
is something from the CLI code, but that shouldn’t happen if you use it like this@mariomixtegapach miner
miner.js