Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 410477

Summary: net-p2p/bitcoind-0.5* - init.d script's stop action fails to stop daemon
Product: Gentoo Linux Reporter: Juraj Variny <rini17>
Component: Current packagesAssignee: Anthony Basile <blueness>
Status: RESOLVED OBSOLETE    
Severity: normal CC: alexander, flow, luke-jr+gentoobugs, proxy-maint
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Juraj Variny 2012-04-01 21:15:39 UTC
Running bitcoind process should be stopped through its RPC interface, by running

bitcoind -conf=/etc/bitcoin/bitcoin.conf stop

Existing initscript does not do it, and it fails to stop bitcoind process.

Reproducible: Always

Steps to Reproduce:
1. Start properly configured bitcoind by /etc/init.d/bitcoind start
2. Try to stop it /etc/init.d/bitcoind stop (it will time out)

Actual Results:  
Bitcoind process keeps normally running and must be killed or stopped manually via RPC.

Expected Results:  
Bitcoind process shiould cleanly finish.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2012-04-02 02:40:50 UTC
CC: 	luke_gentoo_bitcoin@dashjr.org did not match anything

Please fix metadata.xml.
Comment 2 Anthony Basile gentoo-dev 2012-04-02 16:53:26 UTC
(In reply to comment #1)
> CC: 	luke_gentoo_bitcoin@dashjr.org did not match anything
> 
> Please fix metadata.xml.

@jer metadata fixed in all packages that should cc luke-jr

@luke-jr.  This looks like an easy fix.  However, looking at the init script, I think you can safely remove the backwards compat functions start_baselayout() and stop_baselayout(), and then collapse back start_openrc() and stop_openrc() into start() and stop() respectively.
Comment 3 Florian Schmaus gentoo-dev 2012-05-09 13:24:52 UTC
I am not sure if the bitcoin rpc command should be used to stop bitcoind since it only queues the stop action and returns immediately. This is definitely not what you want on system shutdown as it could cause the bitcoind process to be terminated while it's in the process of shutdown.

I have increased the wait argument given start-stop-daemon to 120 seconds for bitcoind shutdown. But it seems that start-stop-daemon does not respect this setting sometimes:

+ stop_openrc
+ start-stop-daemon --stop --user bitcoin --name bitcoind --pidfile /var/run/bitcoind.pid --wait 120000 --progress
.....
 * start-stop-daemon: 1 process refused to stop
+ eend 1                                                                                         [ !! ]
+ exit 1
 * ERROR: bitcoind failed to stop

Every . (dot) in the start-stop-daemon progress bar is equal to 1 second, this means that start-stop-daemon did only wait for about 6 seconds. Not sure if this is a bug or a feature within start-stop-daemon.
Comment 4 Luke-Jr 2012-05-09 14:01:05 UTC
  -w, --wait <arg>                  Milliseconds to wait for daemon start

I don't see a way to wait longer for stop...
Comment 5 Florian Schmaus gentoo-dev 2012-05-09 14:18:37 UTC
Either openrc's start-stop-daemon implements -w also in when called with --stop OR we could copy the behavior if squids initd script shutdown.
Comment 6 Juraj Variny 2013-09-07 20:54:22 UTC
I guess this can be closed without fix, newer bitcoind versions usually respond much faster to termination request.
Comment 7 Sergey Popov gentoo-dev 2013-09-09 08:07:32 UTC
(In reply to Juraj Variny from comment #6)
> I guess this can be closed without fix, newer bitcoind versions usually
> respond much faster to termination request.

Closing as OBSOLETE, reopen if issue still happens