salt: pkgng provider on FreeBSD does not do BATCH=yes
The pkgng provider on FreeBSD does not use the “BATCH=yes” environment setting when installing new packages.
This is problematic when installing packages that have an interactive post-install script (e.g. mail/postfix). The lack of the batch flag causes pkg
to forever wait for a user response (which it will never receive), which in turn causes the minion to “hang”.
# pkg install -qy postfix
===> Creating users and/or groups.
Using existing group 'mail'.
Creating group 'maildrop' with gid '126'.
Creating group 'postfix' with gid '125'.
Creating user 'postfix' with uid '125'.
Adding user 'postfix' to group 'mail'.
Would you like to activate Postfix in /etc/mail/mailer.conf [n]? ^C
But, because the minion is still reachable by the master, your highstate never completes or times out, and you then have to log in, kill the minion child, manually install the package in question, and then restart your highstate run.
# salt --versions-report
Salt: 2015.5.2
Python: 2.7.9 (default, Aug 27 2015, 01:28:02)
Jinja2: 2.7.3
M2Crypto: 0.22
msgpack-python: 0.4.2
msgpack-pure: Not Installed
pycrypto: 2.6.1
libnacl: Not Installed
PyYAML: 3.11
ioflo: Not Installed
PyZMQ: 14.6.0
RAET: Not Installed
ZMQ: 4.1.3
Mako: Not Installed
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 16 (10 by maintainers)
I have this exact problem when installing
postfix
using the postfix-formula.First I tested using env vars and shell, with these results (using bash):
So it keeps waiting there for interaction, even when explicitly adding
ASSUME_ALWAYS_YES=YES
.Next step is using
BATCH=true
:So using that the package gets installed.
So for me working solution will be to force install using batch when you add ‘Force=true’ for example.
I created PR #48730 with this fix.