I run this:
ssh -t -vvv -i ~/.ssh/druid-keypair -o StrictHostKeyChecking=no ubuntu@${INSTANCE_ADDRESS} <<EOI
# Setup Oracle Java
...
# Install dependencies - mysql must be built from source, as the 12.04 apt-get hangs
export DEBIAN_FRONTEND=noninteractive
sudo debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password password diurd'
sudo debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password_again password diurd'
sudo apt-get -q -y -V --force-yes --reinstall install mysql-server-5.5
echo "ALL DONE with druid environment setup!"
exit
EOI
Note: I have tried with and without -t in ssh.
The debug output from -vvv is this:
...
ldconfig deferred processing now taking place
ALL DONE with druid environment setup!
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
And then the process just sits there forever. Why won't the ssh command end? I have tried with -t and without, and I have tried with the exit and without. It doesn't make a difference :(
Update: When I type 'jobs' at the end of the script, I see:
JOBS:
[1]- Running nohup bin/zookeeper-server-start.sh config/zookeeper.properties 2>&1 > /dev/null &
[2]+ Running nohup bin/kafka-server-start.sh config/server.properties 2>&1 > /dev/null &
How can I run these services and still have an ssh session that ends?
Update: I now manually disown these processes. The thing still doesn't exit. WTF mate?
Update: When executing line by line, two commands don't return to shell without hitting CR:
nohup bin/zookeeper-server-start.sh config/zookeeper.properties &
nohup bin/kafka-server-start.sh config/server.properties &