Bitcoin Forum
May 11, 2024, 08:46:33 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: bitcoind hangs on CentOS  (Read 1656 times)
jaychristopher spendbitcoins.com (OP)
Newbie
*
Offline Offline

Activity: 18
Merit: 0


View Profile
July 26, 2012, 10:49:04 PM
 #1

When I start bitcoind through SSH on my CentOS box it just goes to the next line and does nothing. If I run another connection through SSH I can start issuing bitcoind commands no problem.
If I close the first Shell - bitcoind shuts down..

This is weird to me because on my ubuntu box this doesnt happen.. it just says bitcoind starting and keeps running even if i close the shell..

Any ideas on this?
1715460393
Hero Member
*
Offline Offline

Posts: 1715460393

View Profile Personal Message (Offline)

Ignore
1715460393
Reply with quote  #2

1715460393
Report to moderator
1715460393
Hero Member
*
Offline Offline

Posts: 1715460393

View Profile Personal Message (Offline)

Ignore
1715460393
Reply with quote  #2

1715460393
Report to moderator
1715460393
Hero Member
*
Offline Offline

Posts: 1715460393

View Profile Personal Message (Offline)

Ignore
1715460393
Reply with quote  #2

1715460393
Report to moderator
In order to achieve higher forum ranks, you need both activity points and merit points.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715460393
Hero Member
*
Offline Offline

Posts: 1715460393

View Profile Personal Message (Offline)

Ignore
1715460393
Reply with quote  #2

1715460393
Report to moderator
Raoul Duke
aka psy
Legendary
*
Offline Offline

Activity: 1358
Merit: 1002



View Profile
July 26, 2012, 10:53:18 PM
 #2

You have a few options:

-   Turn off huponexit: shopt -u huponexit. The process may still exit if it ever tries to write to the terminal after it's been closed, depending on how it handles write errors. (Note that twiddling this option only affects that one shell. You'll need to add it to a shell startup script — or find and delete the corresponding command that's turning the option on — to have it apply to all shells subsequently started.)

-   Use nohup to run the command instead. This wrapper ignores SIGHUP, letting the underlying command run unaffected. Standard output streams are redirected into a file.

-   Use screen. This starts a completely new terminal session. You can detach to this session and reattach to it at a later time, as you please.
jaychristopher spendbitcoins.com (OP)
Newbie
*
Offline Offline

Activity: 18
Merit: 0


View Profile
July 26, 2012, 11:52:08 PM
 #3

I couldnt get nohup or others to work -- I'd love to get it so I can start/stop in shell..
The cron worked okay.. Any hints on how I'd go about checking if its running before trying to execute it though?
Raoul Duke
aka psy
Legendary
*
Offline Offline

Activity: 1358
Merit: 1002



View Profile
July 26, 2012, 11:59:38 PM
Last edit: July 27, 2012, 12:10:05 AM by psy
 #4

Code:
$ nohup bitcoind &
$ exit

That should be all. It works for me. It's strange it didn't work.
But gweedo is right. You should start it with the system and avoid those problems.

To check if a certain process is running and start it if not you can do something along the lines of

Code:
#!/bin/bash

if ! pgrep bitcoind > /dev/null
then
  <do something to restart the bitcoind>
fi
vom
Newbie
*
Offline Offline

Activity: 27
Merit: 0



View Profile
July 29, 2012, 04:53:57 PM
 #5

Is there a reason you aren't using -daemon ?

Code:
 -daemon
                        Run in the background as a daemon and accept commands

Also, as mentioned already - screen.  Seriously - you should learn screen if you haven't already.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!