Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unattended installation don't work. #5283

Open
SK4ndal opened this issue May 24, 2023 · 3 comments
Open

Unattended installation don't work. #5283

SK4ndal opened this issue May 24, 2023 · 3 comments
Labels
Documentation Needed Issue: Not a bug Issue that was not found to be a bug

Comments

@SK4ndal
Copy link

SK4ndal commented May 24, 2023

Versions

none yet.

Platform

Debian 11 on proxmox (or vagrant for development)

Expected behavior

The --unattended flag allows for automated install.

Actual behavior / bug

I still get dialog screens.

Steps to reproduce

Steps to reproduce the behavior:

curl -o pi-hole.sh install.pi-hole.net
chmod 700 pi-hole.sh
./pi-hole.sh --unattended

Additional context

I added this debug out put to the script:

23  echo $@
...
115 echo "DEBUG: before flag loop" 
...
120 echo "DEBUG: in unattended case"  
...
126 echo "DEBUG: after flag loop" 
127 echo "DEBUG: runUnatttended is: $runUnattended" 

The results are:

root@server:~# ./pihole.sh  --unattended
--unattended
DEBUG: before flag loop
DEBUG: in unattended case
DEBUG: after flag loop
DEBUG: runUnattended is: true

It seems the flag is picked up but I still get the pretty blue dialog screens.

I saw that on line 2578 the variable DEBIAN_FRONTEND is set but never used again.

The dialog screen is started right after on line 2587 without checking either DEBIAN_FRONTEND or runUnattended.

I've tried to search in the git history for changes around this but I can't find anything significant as far as I can tell.

@yubiuser
Copy link
Member

DEBIAN_FRONTEND is exported and used by subsequent apt calls (see https://manpages.debian.org/jessie/debconf-doc/debconf.7.en.html).

Looking at the code, welcomeDialogs() is used to show the frist dialogs and only skipped in case "${useUpdateVars}" is true. This is only true for new installations when runUnattended=true and [[ -f "${setupVars}" ]].
So, does your setupVars="/etc/pihole/setupVars.conf" exist?

# If the setup variable file exists,
if [[ -f "${setupVars}" ]]; then
# if it's running unattended,
if [[ "${runUnattended}" == true ]]; then
printf " %b Performing unattended setup, no dialogs will be displayed\\n" "${INFO}"
# Use the setup variables
useUpdateVars=true
# also disable debconf-apt-progress dialogs
export DEBIAN_FRONTEND="noninteractive"
else
# If running attended, show the available options (repair/reconfigure)
update_dialogs
fi
fi
if [[ "${useUpdateVars}" == false ]]; then
# Display welcome dialogs
welcomeDialogs

@SK4ndal
Copy link
Author

SK4ndal commented May 24, 2023

Hey great! Thanks for the help. I missed that part. Are the variables in the setupVars.conf the same as the env vars described in the docker container ?

Now that I know what to google I can find other people finding similar questions.
Can I perhaps assist the project by adding the unattended setup to the documentation as I go along and use this? This might prevent future questions. Or is the lack of documentation by design?

@yubiuser
Copy link
Member

yubiuser commented May 24, 2023

Are the variables in the setupVars.conf the same as the env vars described in the docker container ?

I think yes (without having checked all of them - some might be docker-specific)

The ones the installer will set are those (+ WEBPASSWORD)

finalExports() {
# set or update the variables in the file
addOrEditKeyValPair "${setupVars}" "PIHOLE_INTERFACE" "${PIHOLE_INTERFACE}"
addOrEditKeyValPair "${setupVars}" "PIHOLE_DNS_1" "${PIHOLE_DNS_1}"
addOrEditKeyValPair "${setupVars}" "PIHOLE_DNS_2" "${PIHOLE_DNS_2}"
addOrEditKeyValPair "${setupVars}" "QUERY_LOGGING" "${QUERY_LOGGING}"
addOrEditKeyValPair "${setupVars}" "INSTALL_WEB_SERVER" "${INSTALL_WEB_SERVER}"
addOrEditKeyValPair "${setupVars}" "INSTALL_WEB_INTERFACE" "${INSTALL_WEB_INTERFACE}"
addOrEditKeyValPair "${setupVars}" "LIGHTTPD_ENABLED" "${LIGHTTPD_ENABLED}"
addOrEditKeyValPair "${setupVars}" "CACHE_SIZE" "${CACHE_SIZE}"
addOrEditKeyValPair "${setupVars}" "DNS_FQDN_REQUIRED" "${DNS_FQDN_REQUIRED:-true}"
addOrEditKeyValPair "${setupVars}" "DNS_BOGUS_PRIV" "${DNS_BOGUS_PRIV:-true}"
addOrEditKeyValPair "${setupVars}" "DNSMASQ_LISTENING" "${DNSMASQ_LISTENING:-local}"


Or is the lack of documentation by design?

It never is. It's a lack of awareness or a lack of motivation.

__

Can I perhaps assist the project by adding the unattended setup to the documentation as I go along and use this?

Please do so. All documentation changes are made at https://github.com/pi-hole/docs which are served at https://docs.pi-hole.net/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Needed Issue: Not a bug Issue that was not found to be a bug
Projects
None yet
Development

No branches or pull requests

2 participants