• Forum has been upgraded, all links, images, etc are as they were. Please see Official Announcements for more information

Keep your MN up and running after crash! (ubuntu > 1 users, one installed dashd)

Hello Everyone!

I wanted to try this here but I fear that it does not work. What Dash4Ever found is actually an error. Running the script

ps aux | grep $myusername | grep dashd | grep -v wc -l

will give an error of grep.

Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.


So the thing why nobody noticed is that the script simply starts dashd again. But since it is already running the process gets canceled. Therefore it really restarts dashd when it crashed. However, this is not a really nice solution (it is basically trying to restart dashd every 10 minutes). Furthermore, I want to add a command into the script that, in case of a crash, I want to receive a mail via ssmtp. This does not seem to work (probably because of the problem of grep).

EDIT: Okay I had the $ in front of my username. However, the IF command is even true if the dashd is already running.

Can we fix this issue ? I did not come up with a good solution.



Thanks guys!
 
Last edited:
Okay I managed to make it work with a new code:

#!/bin/bash
#!/bin/bash
if ! pgrep -fu USER pivxd >/dev/null; then
~/pivx-3.1.0/bin/pivxd -daemon 2>&1 >/dev/null
fi

This is for pivx but for dash it is the same I guess!
 
Back
Top