I am trying to create a fully automated installation and configuration of streams on a Red Hat Linux Enterprise cluster. This has been successful for everything but configuring the recovery database without user input. I can assume that the DB2 instance already exists and that the user provides me all of the connection information as attributes to my script. However, the setupdb command does not appear to have a way to send passwords in without user interaction. I have tried several methods of input redirection at the command line (bash shell) but the script cannot read my input properly.
Is there a way to automate the recovery database configuration?
Here are two examples of what I have tried (and several variations in between):
streamtool setupdb --global --dbadmin db2user --dbuser db2user --dbname streams --host db2host.fullpath.net --port 50000 --overwrite << EOF
echo "$PW" | streamtool setupdb --global --dbadmin db2user --dbuser db2user --dbname streams --host db2host.fullpath.net --port 50000 --overwrite
I recieve the following error no matter how I try to redirect the input. Using the verbose flag does not provide any additional information. When I run the command interactively it completes as expected.
Exception in thread "main" java.lang.NullPointerException
Any assistance is greatly appreciated.