通过phing ssh执行bash脚本时出错

时间:2014-11-24 15:21:53

标签: php bash ssh phing debconf

运行一个通过phing ssh任务安装mysql的脚本给我这个输出:

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: 

如果我在通过ssh登录后运行相同的脚本,它运行时没有任何错误:

负责的脚本是我认为(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

这只是第一次发生。如果我运行两次脚本就会完美执行。

Phing任务仅供参考:

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

0 个答案:

没有答案