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

Installer dies silently on openSUSE #4947

Open
coogor opened this issue Sep 27, 2022 · 19 comments
Open

Installer dies silently on openSUSE #4947

coogor opened this issue Sep 27, 2022 · 19 comments
Labels
Bug: Confirmed Verified as a bug to be resolved WIP Work in progress.

Comments

@coogor
Copy link

coogor commented Sep 27, 2022

Versions

  • Pi-hole: 5.12.2
  • AdminLTE:
  • FTL: 5.18.1

Platform

  • OS and version: openSUSE MicroOS 20220921
  • Platform: Raspberry Pi 3

Expected behavior

The installation script tells the user what the issue is, resp. asks for input like package manager to use etc

Actual behavior / bug

The installation script determines that the underlying system uses RPM as package manager, however, it searches for some redhat files (see debug output) which it does not find and just finished. No output to the user

Steps to reproduce

According to https://docs.pi-hole.net/main/basic-install/ use alternative 2

No further steps required

Debug Token

see output of installation script (executed with set -x)

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

install.log

@yubiuser
Copy link
Member

openSUSE MicroOS 20220921 is not an supported OS.

We check if the used OS is supported

However, this check depends on grep and dnsutils/bind-utils. So we need to figure out which package manager to use and which repo to activate in case one of these packages is not available. As you don't ran a redhat derivative OS, the check will fail at this position.

You've got a point that the installer should not fail silently, but this will only happen in really un-supported OS.

https://docs.pi-hole.net/main/prerequisites/#supported-operating-systems

@coogor
Copy link
Author

coogor commented Sep 27, 2022

openSUSE MicroOS 20220921 is not an supported OS.

I know. None of the openSUSE flavours is currently supported (I just checked Tumbleweed, same error) - time to change this ;-)
compared to all the other OS that you support MicroOS is self-contained, minimalistic and basically immutable - exactly what you want for a server that is running somewhere unattended in your network....

However, this check depends on grep and dnsutils/bind-utils. So we need to figure out which package manager to use and which repo to activate in case one of these packages is not available. As you don't ran a redhat derivative OS, the check will fail at this position.

grep is installed, and bind-utils are available (but not installed by default. as said, a minimalistic system)
zypper in bind-utils
would do the job and resolve all dependencies
(I did so, but it does not change the result)

You've got a point that the installer should not fail silently, but this will only happen in really un-supported OS.

Yes...let me know if you need additional information

@yubiuser
Copy link
Member

time to change this

Pull requests and contributions are always welcomed. However, I don't think one of us will add a workaround for an unsupported OS that will stay unsupported even after the change (which does not mean we wouldn't accept the change). At a first glance it looks simple: just add a check for the existence of /etc/redhat-release. But you might encounter other issues later during installation or during usage.

@PromoFaux
Copy link
Member

Of course, if one really wants to install on an unsupported OS...

https://github.com/pi-hole/docker-pi-hole

@coogor
Copy link
Author

coogor commented Sep 29, 2022

@PromoFaux - sure, that is an option (which I consider in the next run ;-)

I have adapted the installation script so that it installs and runs on Tumbleweed (patch will follow)
2 things....

  • pihole-FTL.service is not a systemd-service, but a SysV start script. Is there any systemd-service script available to install?
  • during installation there was no user/passwd dialog (I read somewhere that this should appear). Where is that asked?
    Thanks!

@yubiuser
Copy link
Member

Is there any systemd-service script available to install?

Hopefully soon: #4924

during installation there was no user/passwd dialog

There is no. During installation it generates an initial password and presents this to the user. You can change it anytime with pihole -a -p

@coogor
Copy link
Author

coogor commented Sep 29, 2022

during installation there was no user/passwd dialog

There is no. During installation it generates an initial password and presents this to the user. You can change it anytime with pihole -a -p

The 'presentation' part is somehow missing. Where is that in the script?

@PromoFaux
Copy link
Member

Where is that in the script?

if [[ "${INSTALL_WEB_INTERFACE}" == true ]]; then
# If there is a password,
if (( ${#pw} > 0 )) ; then
# display the password
printf " %b Web Interface password: %b%s%b\\n" "${INFO}" "${COL_LIGHT_GREEN}" "${pw}" "${COL_NC}"
printf " %b This can be changed using 'pihole -a -p'\\n\\n" "${INFO}"
fi
fi

@yubiuser
Copy link
Member

yubiuser commented Sep 29, 2022

# If the Web interface was installed,
if [[ "${INSTALL_WEB_INTERFACE}" == true ]]; then
# If there is a password,
if (( ${#pw} > 0 )) ; then
# display the password
printf " %b Web Interface password: %b%s%b\\n" "${INFO}" "${COL_LIGHT_GREEN}" "${pw}" "${COL_NC}"
printf " %b This can be changed using 'pihole -a -p'\\n\\n" "${INFO}"
fi

displayFinalMessage() {
# If the number of arguments is > 0,
if [[ "${#1}" -gt 0 ]] ; then
# set the password to the first argument.
pwstring="$1"
elif [[ $(grep 'WEBPASSWORD' -c "${setupVars}") -gt 0 ]]; then
# Else if the password exists from previous setup, we'll load it later
pwstring="unchanged"
else
# Else, inform the user that there is no set password.
pwstring="NOT SET"
fi
# If the user wants to install the dashboard,
if [[ "${INSTALL_WEB_INTERFACE}" == true ]]; then
# Store a message in a variable and display it
additional="View the web interface at http://pi.hole/admin or http://${IPV4_ADDRESS%/*}/admin\\n\\nYour Admin Webpage login password is ${pwstring}"
fi
# Final completion message to user
dialog --no-shadow --keep-tite \
--title "Installation Complete!" \
--msgbox "Configure your devices to use the Pi-hole as their DNS server using:\
\\n\\nIPv4: ${IPV4_ADDRESS%/*}\
\\nIPv6: ${IPV6_ADDRESS:-"Not Configured"}\
\\nIf you have not done so already, the above IP should be set to static.\
\\n${additional}" "${r}" "${c}"
}

The second should also present it in a dialog.

@coogor
Copy link
Author

coogor commented Sep 29, 2022

Well, it generates a password, but it does not reach the point where this message is displayed. I guess the reason is that no service for pihole-FTL exists, as this is the last entry in the log (installscript ran with set -x)
https://paste.opensuse.org/86177770

@yubiuser
Copy link
Member

I think you are right with your analysis. We could improve the installer to exit with a message in case it fails here:

enable_service() {
# Local, named variables
local str="Enabling ${1} service to start on reboot"
printf " %b %s..." "${INFO}" "${str}"
# If systemctl exists,
if is_command systemctl ; then
# use that to enable the service
systemctl enable "${1}" &> /dev/null
else
# Otherwise, use update-rc.d to accomplish this
update-rc.d "${1}" defaults &> /dev/null

@coogor
Copy link
Author

coogor commented Sep 30, 2022

pihole_opensuse.diff.txt
Here is a patch for the installation script that allowed me to install pihole on openSUSE Tumbleweed.
There is still some manual work as no proper .service file is available

@yubiuser
Copy link
Member

Thanks for that patch. Do you feel comfortable enough to open a pull request? Maybe after the .service PR moved on.

@coogor
Copy link
Author

coogor commented Oct 2, 2022

Thanks for that patch. Do you feel comfortable enough to open a pull request? Maybe after the .service PR moved on.

Well, I'm not really familar with github, but I will try....just let me know when it is time to move on!

@github-actions
Copy link

github-actions bot commented Nov 2, 2022

This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days.

@github-actions github-actions bot added the stale label Nov 2, 2022
@coogor
Copy link
Author

coogor commented Nov 2, 2022

I have seen that the systemd service seems to be implemented. I will look at the installation script next days....

@github-actions
Copy link

github-actions bot commented Dec 4, 2022

This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days.

@github-actions github-actions bot added the stale label Dec 4, 2022
@coogor
Copy link
Author

coogor commented Dec 4, 2022

#5001 is still pending

@yubiuser yubiuser added WIP Work in progress. and removed stale labels Dec 4, 2022
@yubiuser yubiuser changed the title Installer dies silently if OS is not supported Installer dies silently on openSUSE Dec 4, 2022
@yubiuser yubiuser linked a pull request Dec 4, 2022 that will close this issue
1 task
@github-actions
Copy link

github-actions bot commented Jan 4, 2023

This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days.

@github-actions github-actions bot added the stale label Jan 4, 2023
@yubiuser yubiuser removed the stale label Jan 4, 2023
@yubiuser yubiuser added the Bug: Confirmed Verified as a bug to be resolved label Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Confirmed Verified as a bug to be resolved WIP Work in progress.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants