debconf

preconfigure an empty password for mysql via debconf-set-selections

断了今生、忘了曾经 提交于 2020-08-01 12:41:00
问题 I am setting up a bash script to automate the building of a LAMP environment. I am using debconf-set-selections to set options before installing mysql, phpmyadmin, etc ... It works mainly great. But the problem is that I have to set an empty password for mysql and it still asks for the password during installation even with the lines typed before : echo "mysql-server-5.5 mysql-server/root_password password" | debconf-set-selections echo "mysql-server-5.5 mysql-server/root_password_again

preconfigure an empty password for mysql via debconf-set-selections

筅森魡賤 提交于 2020-08-01 12:37:44
问题 I am setting up a bash script to automate the building of a LAMP environment. I am using debconf-set-selections to set options before installing mysql, phpmyadmin, etc ... It works mainly great. But the problem is that I have to set an empty password for mysql and it still asks for the password during installation even with the lines typed before : echo "mysql-server-5.5 mysql-server/root_password password" | debconf-set-selections echo "mysql-server-5.5 mysql-server/root_password_again

db_input in postinst doesn't work

家住魔仙堡 提交于 2019-12-24 10:45:21
问题 I have a problem with postinst script, I have to ask root password for MySQL to create some user for my application. I know, it's bad practice to use db_input in postinst however I really need it. Why this postinst doesn't work when I install my app form repository but works properly when I install it as .deb package? postinst: #!/bin/bash -e . /usr/share/debconf/confmodule db_input high my_app/mysql_root_password || true db_go error: dpkg: error processing my-app (--configure): subprocess

Can't properly set MySQL password from external bash script

荒凉一梦 提交于 2019-12-21 22:00:31
问题 I have two scripts - The main one that does a few different things and calls the second script, and the second script that installs MySQL. From my main script I do something like this: ... read -p "Set the password for the database [min. 4 characters]: " MPASS # Install MySQL path/to/setup-mysql.sh "$MPASS" mysql --user="root" --password=${MPASS} -e "GRANT ALL ON *.* TO root@'${IPADDRESS}' IDENTIFIED BY '${MPASS}';" mysql --user="root" --password=${MPASS} -e "GRANT ALL ON *.* TO root@'%'

Handling input confirmations in Linux shell scripting

青春壹個敷衍的年華 提交于 2019-12-03 12:48:58
问题 I'm writing a Linux Shell Script to automate a few things I'm doing on Ubuntu 11.04. Basically, I'm writing a shell script to install NGINX, MySQL, and PHP, and then configure everything. I know how to do everything via the command-line. However, I don't know how I'm going to handle the parts where the process asks for user input. For example, certain things I install with apt-get ask you for a confirmation i.e. (Y)es or (N)o. How exactly would I handle auto-confirmation in the shell script i