Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom commands to start / stop / restart mining process #22

Closed
im-evo opened this issue Mar 3, 2014 · 8 comments
Closed

Add custom commands to start / stop / restart mining process #22

im-evo opened this issue Mar 3, 2014 · 8 comments

Comments

@im-evo
Copy link

im-evo commented Mar 3, 2014

Motivation: better integration with BAMT, which uses /etc/init.d/ for mining initiation:
mine start
mine stop
mine restart

@prdatur
Copy link
Owner

prdatur commented Mar 3, 2014

restart will not be used but the custom command for start/stop is a nice idea. So you have to configure it at all rpc client's, per default normal kill will be used, if something does not work as it should the user can remove the config and use kill again.
I just encounterd a user where mine stop always breaks the hole system and he needed to reboot the rig. So users which know that "mine stop/start" always works could use it.

@im-evo
Copy link
Author

im-evo commented Mar 3, 2014

Yes, I suppose, putting it in rpc client's config is a nice idea.

Also, there's strange behavior of cgminer both with "mine stop" and phpminer's "stop rig" button. When I connect to the screen that runs cgminer, press "q", fan settings (and probably memory/engine clock come back to normal).
However, using "stop rig" would leave fans on the speed that was set in cgminer config. Is it an expected behavior or is it BAMT issue?

@prdatur
Copy link
Owner

prdatur commented Mar 3, 2014

The phpminer stop button does nothing else as "kill -9 process_id_of_miner_software" so the software is just killed. Normally the software should handle such kill commands, developer can catch those events and do things on that. for example reset the clock speed. I think mine stop also kills it, but a bit nicer than phpminer. By pressing Q button within the interface the miner software first reset all the values and then quits. That's the difference.
There is an api command "quit" and i will also add the option to eather run the given custom command or use the api quit command or if nothing else is configured as a fallback use the current kill command.

@im-evo
Copy link
Author

im-evo commented Mar 3, 2014

Just tried SIGTERM instead of SIGKILL (15 instad of 9) and it worked just if I shut cgminer manually, it's just it might not work when cgminer is hung.

@JBrace1990
Copy link

This would also help with a problem I have - either command available just hangs my rigs. The only restart I've ever had work is:

Coldreboot -f

And there's usually a few syncs before it too.

prdatur added a commit that referenced this issue Mar 10, 2014
@prdatur
Copy link
Owner

prdatur commented Mar 10, 2014

Please verify if it works for you.

@neurocis
Copy link

Confirmed working here, the following works very well for me for reboot on hard hung miner processes:

$config['commands'] = array(
    'stop' => 'kill -15 %pid%',
    'start' => null,
    'reboot' => 'sync; sleep 5; coldreboot -f',
);

@prdatur
Copy link
Owner

prdatur commented Mar 13, 2014

ok so closed

@prdatur prdatur closed this as completed Mar 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants