This is the first of two technical notes that give the steps to have your SAFE vaults stay out of sight while you’re using your computer, and to start automatically when you either login (the simpler approach) or when the computer boots (i.e., as a system service, without anyone logged in, but a bit more complex of an approach). That latter approach is most desirable for unattended vaults running on cloud servers, as you can appreciate if you have ever had to leave your SSH terminal running because it was running a vault on a remote computer.
This first technical note describes the simpler method, that of having one or more vaults run in the background when you login.
It is tested on Debian 8.4 stable (Jessie) and I know of no reason why it can’t be run as is, or with modest adjustment, on other distros.
Use a text editor to open a new file, ~/bin/safe_vault. If you don’t have a “bin” folder in your home folder then create it. The default Debian profile automatically puts such a folder, if it exists, on your PATH environment variable.
Paste this text into the file and save:
#! /bin/sh
# ~/bin/safe_vault
case "$1" in
start)
echo "Starting script safe_vault"
export RETURNDIR=${PWD}
cd ~/safe_vault1/
./safe_vault >/dev/null 2>&1 &
# Uncomment the following lines to run additional vaults
# cd ~/safe_vault2/
# ./safe_vault >/dev/null 2>&1 &
# cd ~/safe_vault3/
# ./safe_vault >/dev/null 2>&1 &
# cd ~/safe_vault4/
# ./safe_vault >/dev/null 2>&1 &
cd $RETURNDIR
;;
stop)
echo "Stopping script safe_vault"
killall safe_vault
;;
*)
echo "Usage: safe_vault {start|stop}"
exit 1
;;
esac
exit 0
Now make it executable:
$ chmod +x ~/bin/safe_vault
Then test it:
$ safe_vault start
Then confirm that a safe_vault process is currently running:
$ ps aux | grep safe_vault
Now stop the vault:
$ sudo safe_vault stop
To confirm that the vault is no longer running:
$ ps aux | grep safe_vault
If you have a graphical desktop, then create a symbolic link to the log for easy access:
$ ln -s ~/bin/safe_vault1/Node.log ~/Desktop/Safe-Vault-1.log
If you want to run multiple vaults, create extra folders containing the safe_vault files and uncomment the appropriate lines in the script.
If you have multiple safe_vaults running, the script will start and stop them all.
Finally, add this line to your ~/.profile file:
$ safe_vault start
Now log out and log back in to run the vault(s).
NEXT: How to have vaults run as a system service.