Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm currently trying to automate my Postfix installation and most things work really... but I can't seem to stop postfix-policyd asking for the MySQL root password.

Here is what I got so far:

echo 'dbconfig-common postfix-policyd/dbconfig-install boolean false' | debconf-set-selections

echo 'postfix-policyd postfix-policyd/dbconfig-install boolean false' | debconf-set-selections

echo 'postfix-policyd postfix-ploicyd/internal/skip-preseed boolean false' | debconf-set-selections

echo 'dbconfig-common dbconfig-common/internal/skip-preseed boolean false' | debconf-set-selections

echo 'postfix-policyd postfix-policyd/dbconfig-upgrade boolean false' | debconf-set-selections

echo 'postfix-policyd/dbconfig-reinstall boolean false' | debconf-set-selections

echo 'dbconfig-common dbconfig-reinstall boolean false' | debconf-set-selections

echo "postfix-policyd postfix-policyd/internal/reconfiguring boolean false" | debconf-set-selections

It seems postfix-policyd just ignores the

postfix-policyd postfix-policyd/dbconfig-install boolean false

How do I fix this?

share|improve this question
up vote 7 down vote accepted

In my script I disable the interactive frontend first:
export DEBIAN_FRONTEND=noninteractive

Then I set al the preferences, f.e.:
postconf -e "mynetworks = 127.0.0.0/8, ${NETWORK_CIDR}"

You can then re-enable it by unsetting it:
unset DEBIAN_FRONTEND

Or, you can make it very easy by just running this command:
DEBIAN_FRONTEND=noninteractive apt-get install postfix-policyd

share|improve this answer
    
Oh man, this is awesome. Works like a charm! +1 for you! – Pierre Dennert Mar 5 '11 at 17:09

To set the MySQL password you need to do the following for your script:

ADMIN_PASS=YourPassword

#MySql settings
echo "mysql-server-5.6 mysql-server/root_password password $ADMIN_PASS" \
  | debconf-set-selections

echo "mysql-server-5.6 mysql-server/root_password_again password $ADMIN_PASS" \
  | debconf-set-selections

Just change the numbers for the version of MySQL

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.