Post
Topic
Board Beginners & Help
Re: Whitelist Requests (Want out of here?)
by
btcmonkey
on 21/06/2011, 14:43:56 UTC
Hiya,

I would like to respond to this post:

http://forum.bitcoin.org/index.php?topic=965.msg200374#msg200374

Quote from: MPW
Quote from: BioMike
Stopping bitcoind is done by sending a signal to the daemon. I don't know how good bitcoind tries to close its databases, but I've had once a database corruption when killing the daemon. On the bitcoin chat people advised me to to send the rpc stop command to stop it (and call start-stop-daemon later again to clean it up), checking the debug log can give some information if it is closing right (flushing the database files). Best would be that bitcoind closes itself properly after receiving a kill signal.

How can I implement this to the skript?


By saying:

Change:
Code:
#
# Function that stops the daemon/service
#
do_stop()
{
   # Return
   #   0 if daemon has been stopped
   #   1 if daemon was already stopped
   #   2 if daemon could not be stopped
   #   other if a failure occurred
   start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME

to this:

Code:
#
# Function that stops the daemon/service
#
do_stop()
{
   # Return
   #   0 if daemon has been stopped
   #   1 if daemon was already stopped
   #   2 if daemon could not be stopped
   #   other if a failure occurred
   $DAEMON stop
   start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME


to implement BioMike's suggestion. See the '$DAEMON stop' line. This will tell bitcoin (via rpc) to stop running.


I also ended up changing this:

Code:
NAME=/usr/local/bin/bitcoind
DAEMON=$NAME

to:

Code:
NAME=bitcoind
DAEMON=/usr/local/sbin/bitcoind
DAEMON_ARGS="-daemon"

To get things working better for me.  My install of ubuntu wouldn't support long NAMEs.  Also when I issued a 'start' command the process would keep running in the foreground, so I added the '-daemon' argument to stop that from happening.





Would you mine giving me access to do this?

  Thanks much.