Title: [Back to not solved] Block notify refusing to execute script Post by: Automatic on December 25, 2013, 10:22:58 PM Log from bitcoind:-
Code: 2013-12-25 20:17:10 runCommand error: system(/home/bitcoin/block.sh 0000000000000001add7cf0bbc4520992f0c9f4346391273f27a93513a806a27) returned -1 As you can see, I've tried lots of configurations. Here's me running the command myself:- Code: [bitcoin@steam .bitcoin]$ /home/bitcoin/block.sh "000000000000000374a7b6359cc993d3638c72c14d8c7529fef7e6e7e545bffb" As you can see, works fine:- Code: [bitcoin@steam ~]$ cat block.log The block.sh:- Code: [bitcoin@steam ~]$ cat block.sh Any help? I can't work out why it refuses to run. EDIT:- Nor this:- Code: 2013-12-25 22:53:32 runCommand error: system("/usr/bin/bash" "/home/bitcoin/block.sh" "00000000000000025efa4d291485de8c34136c3d0d6b2cfd487514b4f81c27c5") returned -1 Title: Re: Block notify refusing to execute script Post by: theymos on December 25, 2013, 10:54:01 PM Your block.sh isn't a valid executable. It needs to start with a #! line or be executed by a shell explicitly.
Title: Re: Block notify refusing to execute script Post by: Automatic on December 25, 2013, 10:57:17 PM Your block.sh isn't a valid executable. It needs to start with a #! line or be executed by a shell explicitly. I tried specifically calling it via bash, didn't work. Added a hashbang to the start of the shell script, see if that works. EDIT:- Code: 2013-12-25 23:12:50 runCommand error: system(/home/bitcoin/block.sh 000000000000000275f2223e520067759159e83be4f23e6f21b9661a54e27efc) returned -1 Code: [bitcoin@steam .bitcoin]$ cat /home/bitcoin/block.sh EDIT:- Code: 2013-12-25 23:23:57 runCommand error: system(/home/bitcoin/block.sh 00000000000000003788ac3db98f21b99151ea65711b53686e1ad3583bd1a2a1) returned -1 Code: [bitcoin@steam .bitcoin]$ cat /home/bitcoin/block.sh Title: Re: Block notify refusing to execute script Post by: kjj on December 26, 2013, 05:59:47 AM Execute bit set?
Title: Re: Block notify refusing to execute script Post by: Automatic on December 26, 2013, 02:37:41 PM Execute bit set? Code: [bitcoin@steam ~]$ ls -ls I even went through with the time to compile a c++ app that simply called (As, from the log, this seems to be the function bitcoind calls):- Code: system("/home/bitcoin/block.sh thisisarandomhash"); And it worked fine, I also tried copying block.sh to /tmp/block.sh, and, giving it 777 perms:- Code: [bitcoin@steam .bitcoin]$ tail -f debug.log | grep block.sh Title: Re: Block notify refusing to execute script Post by: kjj on December 26, 2013, 03:12:21 PM SE?
Any other errors popping up in /var/log/* ? What is your walletnotify= line in your .conf? Title: Re: Block notify refusing to execute script Post by: Automatic on December 26, 2013, 03:24:48 PM SE? Any other errors popping up in /var/log/* ? What is your walletnotify= line in your .conf? I've tried a hell of a lot of wallet notifies so far, including, but not limited to:- Code: blocknotify=/tmp/block.sh Code: blocknotify="/tmp/block.sh" Code: blocknotify=/home/bitcoin/block.sh "%s" Code: blocknotify="/home/bitcoin/block.sh" "%s" Code: blocknotify="/home/bitcoin/block.sh" %s Code: blocknotify=/home/bitcoin/block.sh %s Code: blocknotify="/bin/bash" "/home/bitcoin/block.sh" "%s" Code: blocknotify="/bin/sh" "/home/bitcoin/block.sh" "%s" Running:- Code: journalctl -f and initiating bitcoind again resulted in nothing new being dumped to journalctl. Title: Re: Block notify refusing to execute script Post by: Automatic on December 26, 2013, 04:53:34 PM Well, I worked it out. Apparently there was an error else-where in my config that was fucking everything up. Woohoo, non-useful error messages are non-useful.
Code: [bitcoin@steam ~]$ tail -f block.log For later reference, if someone is googling this, the issue was that "wallet" and "alert" notify were _APPARENTLY_ formatted incorrectly (despite looking okay when viewing 'em), once deleting those two entries everything works. Title: Re: [SOLVED] Block notify refusing to execute script Post by: Automatic on February 05, 2014, 04:54:47 PM This issue has popped back up, not changed anything. Great.
Title: Re: [Back to not solved] Block notify refusing to execute script Post by: fbueller on February 07, 2014, 09:01:24 PM If you are specifying these parameters in the config file, don't use quotes, and do use an absolute path. Now that you've fixed the other issue!
Title: Re: [Back to not solved] Block notify refusing to execute script Post by: Automatic on February 07, 2014, 09:32:51 PM If you are specifying these parameters in the config file, don't use quotes, and do use an absolute path. Now that you've fixed the other issue! Do not use an absolute path? Then, what's the current directory I'm in? The directory I run bitcoind from? $HOME/.bitcoin? I have issues even if I just do:- Code: blocknotify=echo %s Which, isn't absolute, nor does it contain quotes, so, same issue. Title: Re: [Back to not solved] Block notify refusing to execute script Post by: dserrano5 on February 07, 2014, 09:49:45 PM and do use an absolute path. Do not use an absolute path? Reread, he said do use ;). Title: Re: [Back to not solved] Block notify refusing to execute script Post by: Automatic on February 08, 2014, 12:18:31 AM and do use an absolute path. Do not use an absolute path? Reread, he said do use ;). Whoops, well, I've also tried (Which was working till it randomly stopped, includes hashbang to /bin/sh):- Code: /home/bitcoin/block.sh %s I'm unsure how how to use an absolute path of sh or something of the like without quotes, as, the space for the argument would break it:- Code: /bin/sh -c /home/bitcoin/block.sh<SpaceHereWouldBreakArgumentsBeingParsedToTheBashScript>%s I'd need:- Code: /bin/sh -c "/home/bitcoin/block.sh %s" EDIT:- This was the .conf that worked just fine, until, well, it randomly stopped working without me updating anything (System, .conf, bitcoin, .sh, anything!):- Code: rpcuser=no. Title: Re: [Back to not solved] Block notify refusing to execute script Post by: nicon on November 18, 2014, 10:39:28 AM and do use an absolute path. Do not use an absolute path? Reread, he said do use ;). Whoops, well, I've also tried (Which was working till it randomly stopped, includes hashbang to /bin/sh):- Code: /home/bitcoin/block.sh %s I'm unsure how how to use an absolute path of sh or something of the like without quotes, as, the space for the argument would break it:- Code: /bin/sh -c /home/bitcoin/block.sh<SpaceHereWouldBreakArgumentsBeingParsedToTheBashScript>%s I'd need:- Code: /bin/sh -c "/home/bitcoin/block.sh %s" EDIT:- This was the .conf that worked just fine, until, well, it randomly stopped working without me updating anything (System, .conf, bitcoin, .sh, anything!):- Code: rpcuser=no. I have the exact same problem. Did you solve it? Title: Re: [Back to not solved] Block notify refusing to execute script Post by: Automatic on November 18, 2014, 01:47:53 PM and do use an absolute path. Do not use an absolute path? Reread, he said do use ;). Whoops, well, I've also tried (Which was working till it randomly stopped, includes hashbang to /bin/sh):- Code: /home/bitcoin/block.sh %s I'm unsure how how to use an absolute path of sh or something of the like without quotes, as, the space for the argument would break it:- Code: /bin/sh -c /home/bitcoin/block.sh<SpaceHereWouldBreakArgumentsBeingParsedToTheBashScript>%s I'd need:- Code: /bin/sh -c "/home/bitcoin/block.sh %s" EDIT:- This was the .conf that worked just fine, until, well, it randomly stopped working without me updating anything (System, .conf, bitcoin, .sh, anything!):- Code: rpcuser=no. I have the exact same problem. Did you solve it? I did, but, I had absolutely nothing to do with it, one day it just started working. Sorry. Title: Re: [Back to not solved] Block notify refusing to execute script Post by: nicon on November 18, 2014, 05:00:26 PM Ok, wow...
So do you specify this in the conf file Code: blocknotify=/home/bitcoin/block.sh %s and in the block.sh file: Code: #!/bin/sh not sure if I should use dh or bash and if I should call the .sh file direct or via blocknotify=/bin/sh /home/bitcoin/block.sh %s How are you doing this? |