Error executing bash script throught phing ssh

405 views Asked by At

Running a script that install mysql through phing ssh task give me this output :

debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin: 

If I run the same script after log-in through ssh, it runs without any errors :

The script responsible is I think (setup.sh):

export DEBIAN_FRONTEND=noninteractive
echo "mysql-server mysql-server/root_password password $rootPwd" | sudo debconf-set-selections
echo "mysql-server mysql-server/root_password_again password $rootPwd" | sudo debconf-set-selections
sudo apt-get install -y mysql-server mysql-client

And this happens for the first time only. If I run the script twice it execute perfectly.

Phing task just for reference:

 <ssh host="${deploy.host}"
             username="${deploy.user}"
             privkeyfile="${deploy.pem}"
             pubkeyfile="${deploy.pub}"
             command="./setup.sh"
             display="false"
             property="ssh_output"
             failonerror="true"
                />
0

There are 0 answers