Author [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: Problems with BitSharesX daemon initscripting  (Read 404 times)

0 Members and 1 Guest are viewing this topic.

Offline FuLl

  • Full Member
  • ***
  • Posts: 96
    • View Profile
Problems with BitSharesX daemon initscripting
« on: September 22, 2014, 04:43:56 AM »

Hi,

When I try to start the client in daemon mode using:
Code: [Select]
$BitSharesX --daemonI get the following error:
Code: [Select]
QXcbConnection: Could not connect to display
Aborted

Of course it happens without the --daemon flag as well, but I expect that as XOrg isn't installed.

OS is Debian Wheezy, client is installed via Ubuntu ppa, using Debian Sid dependencies.

How do I get past this?

Please advise.

Thanks,
-F
« Last Edit: September 22, 2014, 08:51:50 AM by FuLl »

Offline svk

Re: Cannot start BitSharesX daemon
« Reply #1 on: September 22, 2014, 07:55:17 AM »
BitsharesX is the GUI, you need to start "bitshares_client --daemon".

Not sure how to launch the daemon on Windows though if that's what you're trying to do.
Worker: dev.bitsharesblocks

Offline FuLl

  • Full Member
  • ***
  • Posts: 96
    • View Profile
Re: Cannot start BitSharesX daemon
« Reply #2 on: September 22, 2014, 08:42:51 AM »
BitsharesX is the GUI, you need to start "bitshares_client --daemon".

Thanks, that did it, but now I have a new problem.

I start it from a script in etc/init.d, & when I start it, it displays the following output, but doesn't release my console back to a bash prompt.

Code: [Select]
Starting BitSharesX

Loading blockchain from: /root/.BitSharesX/chain
Loading config from file: /root/.BitSharesX/config.json
Initializing genesis state from built-in genesis file
Please be patient, this will take a few minutes...
Successfully re-indexed 0 blocks in 0 seconds.
Starting JSON RPC server on port 43021 (localhost only)
Starting HTTP JSON RPC server on port 38631 (localhost only)
Running in daemon mode, ignoring console

Is there a way to get my prompt back after I start it?

Plus, once I <Ctrl-C> to exit that, if I do:
Code: [Select]
$bitshares_client exitI get the following output, with a prompt I have to type 'quit' at to exit completely.
Code: [Select]
$ bitshares_client exit
Loading blockchain from: /home/admin/.BitSharesX/chain
Loading config from file: /home/admin/.BitSharesX/config.json
Initializing genesis state from built-in genesis file
Please be patient, this will take a few minutes...
Successfully re-indexed 0 blocks in 0 seconds.
Starting JSON RPC server on port 56544 (localhost only)
Starting HTTP JSON RPC server on port 46261 (localhost only)
Attempting to map P2P port 1776 with UPNP...
Listening for P2P connections on port 1776
Adding peer 80.240.133.79:1776 to peer database
Adding peer 104.131.35.149:1776 to peer database
Adding peer 178.62.50.61:1776 to peer database
Adding peer 178.62.157.161:1776 to peer database
Adding peer 178.62.50.61:1779 to peer database
Adding peer 180.153.142.120:1777 to peer database
Adding peer 188.226.195.137:60696 to peer database
Adding peer 5.101.106.138:1777 to peer database
Adding peer 80.240.133.79:1778 to peer database
Adding peer 95.85.33.16:8764 to peer database
Adding peer 61.129.33.213:1776 to peer database
Adding peer 84.238.140.192:42577 to peer database
Adding peer 54.77.51.177:1776 to peer database
Adding peer 5.101.106.138:1778 to peer database
Adding peer 5.101.106.138:1776 to peer database
Adding peer 178.62.50.61:1777 to peer database
Adding peer 80.240.133.79:1777 to peer database
Adding peer 54.79.27.224:1776 to peer database
Adding peer 178.62.50.61:1778 to peer database
Adding peer 89.187.144.203:8764 to peer database
--- there are now 1 active connections to the p2p network
--- syncing with p2p network, 550807 blocks left to fetch
--- there are now 2 active connections to the p2p network
--- there are now 3 active connections to the p2p network
--- there are now 4 active connections to the p2p network
--- there are now 5 active connections to the p2p network
--- there are now 6 active connections to the p2p network
--- there are now 7 active connections to the p2p network
--- there are now 8 active connections to the p2p network
--- there are now 9 active connections to the p2p network
--- there are now 10 active connections to the p2p network
--- there are now 11 active connections to the p2p network
--- there are now 12 active connections to the p2p network
--- there are now 13 active connections to the p2p network
--- there are now 14 active connections to the p2p network
--- there are now 15 active connections to the p2p network
(wallet closed) >>>

How do I exit fully & get a command prompt back?
« Last Edit: September 22, 2014, 08:49:29 AM by FuLl »

Offline svk

Re: Problems with BitSharesX daemon initscripting
« Reply #3 on: September 22, 2014, 08:54:34 AM »
Maybe you need to add an & at the end? Never used the daemon myself so not sure. To stop the daemon you probably need to do something like "bithshares_client stop", don't think CTRL+c will suffice.

To regain control of your terminal do CTRL+z then type bg.
Worker: dev.bitsharesblocks

Offline FuLl

  • Full Member
  • ***
  • Posts: 96
    • View Profile
Re: Problems with BitSharesX daemon initscripting
« Reply #4 on: September 22, 2014, 09:08:41 AM »
I tried adding the & after a sleep period so it wouldn't place output after I got my prompt back, & that got me my command prompt back, but now it won't stop.

When I do:
Code: [Select]
$sudo bitshares_client stopI get this:
Code: [Select]
$ sudo bitshares_client stop
Loading blockchain from: /root/.BitSharesX/chain
Loading config from file: /root/.BitSharesX/config.json
------------ error --------------
10001 db_in_use_exception: Database in Use
Unable to open database /root/.BitSharesX/peers.leveldb
        IO error: lock /root/.BitSharesX/peers.leveldb/LOCK: Resource temporarily unavailable
    {"db":"/root/.BitSharesX/peers.leveldb","msg":"IO error: lock /root/.BitSharesX/peers.leveldb/LOCK: Resource temporarily unavailable"}
    p2p  level_pod_map.hpp:58 open

    {}
    p2p  level_pod_map.hpp:62 open
$
I can't even kill it with 'sudo htop' or 'sudo pkill bitshares_client'...

It appears to be starting when I tell it to stop, doesn't it.

Any ideas?

-Thanks

Offline svk

Re: Problems with BitSharesX daemon initscripting
« Reply #5 on: September 22, 2014, 09:14:01 AM »
I don't know if stop is an actual command though, it was an example cause that's how other clients work, like bitcoin and its many clones.

Check the possible options with --help.

To kill it find the process ID with "ps a" then do "kill -9 PID"
Worker: dev.bitsharesblocks

Offline FuLl

  • Full Member
  • ***
  • Posts: 96
    • View Profile
Re: Problems with BitSharesX daemon initscripting
« Reply #6 on: September 22, 2014, 12:44:00 PM »
I don't know if stop is an actual command though, it was an example cause that's how other clients work, like bitcoin and its many clones.

Check the possible options with --help.

I'm using the stop/exit commands as per the documentation here:
https://github.com/BitShares/bitshares_toolkit/wiki/Bitshares-commands:-General

--help doesn't mention how to exit it.

Offline Riverhead

Re: Problems with BitSharesX daemon initscripting
« Reply #7 on: September 22, 2014, 12:48:20 PM »
Does your start script have a loop in it? like while true start client?

Also, you can launch the client via screen then you'll always be able to get back to a command prompt with <cntrl-a> <d>

Offline FuLl

  • Full Member
  • ***
  • Posts: 96
    • View Profile
Re: Problems with BitSharesX daemon initscripting
« Reply #8 on: September 22, 2014, 12:54:52 PM »
This is my initscript:
Code: [Select]
#!/bin/sh
# Starts and stops bitsharesx
#


case "$1" in
start)
        echo ""
        echo "Starting BitSharesX"
        echo ""
        bitshares_client --daemon
sleep 15 &
        $0 view

;;

stop)
   echo ""
   echo "Stoping BitSharesX"

   /usr/bin/bitshares_client exit
sleep 30 &
;;

restart)
     $0 stop
     sleep 30
     $0 start
;;

view)
        ps -e | grep bitshares_client
;;


*)
        echo "Usage: $0 {start|stop|restart}"
        exit 1
esac


Offline FuLl

  • Full Member
  • ***
  • Posts: 96
    • View Profile
Re: Problems with BitSharesX daemon initscripting
« Reply #9 on: September 22, 2014, 03:41:50 PM »
Screen -dm starts the client when I run the script manually, but it won't start at boot, even after I do:
Code: [Select]
$sudo update-rc.d btsx defaults
But it won't start at boot.

What are other people's init scripts looking like that work?

Are there 'Required Start' parameters I need to add?

This is my script:

Code: [Select]
#!/bin/sh
# Starts bitsharesx
#

### BEGIN INIT INFO
# Provides:             bitshares_client
# Required-Start:       $syslog
# Required-Stop:
# Should-Start:
# Default-Start:        2 3 4 5
# Default-Stop:         0 1 6
# Short-Description:    bitshares_client
### END INIT INFO

case "$1" in
start)
        echo ""
        echo "Starting BitSharesX"
        echo ""
sleep 5
        screen -dm bitshares_client --daemon
sleep 10
        $0 view

;;

view)
        ps -e | grep bitshares_client
;;


*)
        echo "Usage: $0 {start}"
        exit 1
esac

Offline FuLl

  • Full Member
  • ***
  • Posts: 96
    • View Profile
Re: Problems with BitSharesX daemon initscripting
« Reply #10 on: September 22, 2014, 05:04:27 PM »
It won't even start if I use crontab to start it 120 seconds after reboot, I don't get it.

I'll just have to start it manually.

Offline FuLl

  • Full Member
  • ***
  • Posts: 96
    • View Profile
Re: Problems with BitSharesX daemon initscripting
« Reply #11 on: September 23, 2014, 08:34:47 PM »
Got it to work- had to change from Debian to Ubuntu, no problems now.

Seed node is up:
54.165.9.208

 

Google+