0

I'm on Ubuntu 16.04 I'm trying to use the 'Startup Applications' program to run an .sh script to launch a 'Vertcoin' wallet v0.11.1.0

I found the answer to a similar problem what to get the script to delete a .lock file. I've done so but it doesn't effect anything. Contents of my .sh file that 'Startup Applications' runs upon startup.

#!/bin/bash
sleep 2
rm ~/.vertcoin/.lock
gnome-terminal -e
./vert/vertcoin-qt

When restarting the program (which is a crypto wallet) displays the the usual startup box but with the error messege... "Unable to start HTTP server. See debug log for details."

The 'debug log' says...

Open database handle: wallet.dat/main
Database handles still open at environment close
Open database handle: wallet.dat/main
Database handles still open at environment close
Open database handle: wallet.dat/main
Database handles still open at environment close

I've tried more elaborate commands in the .sh file such as

#!/bin/bash 
rm ~/.vertcoin/.lock  
sleep 2  
gnome-terminal -e
./vert/vertcoin-qt
killall ./vert/vertcoin-qt
sleep 2
./vert/vertcoin-qt

Typing 'killall ./vert/vertcoin-qt' then './vert/vertcoin-qt' manually starts the wallet. But it gives the same type of error in the .sh script when run at startup. What process should be killed or started in my .sh script that will allow the wallet to start?

Photo of My Error

3
  • 2
    One problem I do see is that the commands after the gnome-terminal -e will not run in the new gnome-terminal. Using the -e command, you should put the commands on the same line like gnome-terminal -e './vert/vertcoin-qt; killall ./vert/vertcoin-qt; sleep 2; ./vert/vertcoin-qt'
    – Terrance
    Commented Feb 8, 2018 at 22:55
  • Thank you. That was the problem. It doesn't allow more than one command on a line with ; like that but I can stack them #!/bin/bash sleep 2 gnome-terminal -e './vert/vertcoin-qt' sleep 2 gnome-terminal -e 'killall ./vert/vertcoin-qt' sleep 2 gnome-terminal -e './vert/vertcoin-qt' Commented Feb 9, 2018 at 5:09
  • @Terrance That's the answer!
    – dessert
    Commented Feb 9, 2018 at 7:26

2 Answers 2

0

In scripts when you're using gnome-terminal -e command to run commands in the gnome-terminal, the commands need to be on the same line as gnome-terminal.

Examples:

gnome-terminal -e './vert/vertcoin-qt'
gnome-terminal -e 'killall ./vert/vertcoin-qt'

The above commands will open a gnome-terminal window and run the killall and ./vert/vertcoin-qt within them.

Hope this helps!

2
  • Yes. close. but the race condition was about closing the wallet AND removing the .lock file. Commented Feb 13, 2018 at 16:16
  • @OneBTonces If you look at my comment in the question, I already set OP on the correct answer. Already solved.
    – Terrance
    Commented Feb 13, 2018 at 16:18
0

Opens the wallet. Closes the wallet. Deletes the lock file. Opens the wallet. Starts the miner and pool.

#!/bin/bash
sleep 10
gnome-terminal -e '/home/eagle/vert/vertcoin-qt'
sleep 2

gnome-terminal -e 'killall /home/eagle/vert/vertcoin-qt'
sleep 2

gnome-terminal -e 'rm .vertcoin/.lock'
sleep 2

gnome-terminal -e '/home/eagle/vert/vertcoin-qt'
sleep 15

gnome-terminal -e '/usr/bin/python /home/eagle/p2pool2/p2pool-vtc/run_p2pool.py --net vertcoin node <PASSWORD>'
sleep 3

gnome-terminal -e '/home/eagle/ccminer/ccminer/ccminer -a lyra2v2 -i 20 -o stratum+tcp://127.0.0.1:9171/ -u VneboMA75nHf8HdBQxv36CRxy5xeK7n4nG -p miner'
6
  • I didn't write the whole answer because you already had that information. Answer deleted. Besides, I am the one that gave you the information and my answer was there to help you, not to rewrite your whole script for you.
    – Terrance
    Commented Feb 13, 2018 at 16:19
  • I got this solution from a user on the Vertcoin reddit and my trial and error, plus a problem a bitcoin wallet user was having. Not from you. Further, your answer did nothing to address the race condition problem. The question in the OP. Commented Feb 13, 2018 at 18:02
  • Look at my comment on Feb 8 and your response on Feb 9 in your question. You did get the single line gnome-terminal from me. You said Thank you that was the problem
    – Terrance
    Commented Feb 13, 2018 at 18:04
  • Oh, yeah. That semi colon ';' symbol didn't end up working. I can only get it work with each command as is in this answer. One command only after gnome-termianl -e. Maybe because the race condition problem needs to be solved with sleep in between the opening, closing, lock file deletion, and re opening. Commented Feb 13, 2018 at 18:11
  • If you see on Feb 9 I responded you pointed out half the problem but it wasn't a solution " It doesn't allow more than one command on a line with ; like that " Commented Feb 13, 2018 at 18:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .