1

运行通过 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"
                />
4

0 回答 0