Bitcoin Forum
August 05, 2025, 06:40:24 PM *
News: Latest Bitcoin Core release: 29.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Question about -blocknotify  (Read 70 times)
BlackHatCoiner (OP)
Legendary
*
Offline Offline

Activity: 1792
Merit: 8677


View Profile
January 05, 2025, 07:55:52 PM
 #1

I have a bash script A which calls another bash script B. I use -blocknotify option to call bash script A when a new block is found, but bash script B is not called. I have tried calling bash script A from terminal, and it correctly calls bash script B, which makes me think there's a special treatment when the node calls a bash script. I have also confirmed that node does run script A, as I can see the debug log of script A.

Does it lack permission, or something? The line of code that calls script B is this:
Code:
bash "$RESTART_SCRIPT" $BLOCK_HASH >> debug.txt 2>&1
LoyceV
Legendary
*
Offline Offline

Activity: 3752
Merit: 19478


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
January 05, 2025, 08:08:02 PM
Merited by BlackHatCoiner (4), ABCbits (1)
 #2

When I get "weird, annoying things" in bash, it's often caused by things like different environment variables, or relative paths. I'd start by trying what happens if you replace $RESTART_SCRIPT by a hardcoded command starting from /path/command.

¡uʍop ǝpᴉsdn pɐǝɥ ɹnoʎ ɥʇᴉʍ ʎuunɟ ʞool no⅄
BlackHatCoiner (OP)
Legendary
*
Offline Offline

Activity: 1792
Merit: 8677


View Profile
January 05, 2025, 08:22:58 PM
 #3

It had to do with full path... Problem solved.

Thank you!
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!