FOGProject / fogproject

An open source computer cloning & management system
https://fogproject.org
GNU General Public License v3.0
1.14k stars 222 forks source link

Installer does not support forks of debian that aren't *ubuntu* or *mint* #416

Closed 68267a closed 3 years ago

68267a commented 3 years ago

I'm running System76's Pop!_OS. The fog installer fails to set $dbservice here:

lib/common/functions.sh
1092 configureMySql() {
1093     stopInitScript
1094     dots "Setting up and starting MySQL"
1095     dbservice=$(systemctl list-units | grep -o -e "mariadb\.service" -e "mysqld\.service" -e "mysql\.service" | tr -d '@')
1096     [[ -z $dbservice ]] && dbservice=$(systemctl list-unit-files | grep -v bad | grep -o -e "mariadb\.service" -e "mysqld\.service" -e "mysql\.service" | tr -d '@')

Which causes the script to exit at systemctl is-active $dbservice with code 127

I'm assuming this is because the packages list is basically empty, which is set here:

lib/ubuntu/config.sh
100 case $linuxReleaseName in
101     *[Uu][Bb][Uu][Nn][Tt][Uu]*|*[Bb][Ii][Aa][Nn]*|*[Mm][Ii][Nn][Tt]*)
102         if [[ -z $packages ]]; then
103             x="mysql-server"
...
117         ;;
118 esac

I don't understand why there's a case statement with only one clause. I edited /etc/os-release and it was able to continue, but failed at some point later. ~Probably a separate issue.~ edit: apache couldn't start because port 80 was already in use by an old nginx install for some reason.

# cat /etc/os-release
NAME="Mint"
#NAME="Pop!_OS"
VERSION="20.04 LTS"
ID=pop
ID_LIKE="ubuntu debian"
PRETTY_NAME="Pop!_OS 20.04 LTS"
VERSION_ID="20.04"
HOME_URL="https://pop.system76.com"
SUPPORT_URL="https://support.system76.com"
BUG_REPORT_URL="https://github.com/pop-os/pop/issues"
PRIVACY_POLICY_URL="https://system76.com/privacy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
LOGO=distributor-logo-pop-os

# uname -a
Linux foog 5.4.0-7642-generic #46~1598628707~20.04~040157c-Ubuntu SMP Fri Aug 28 18:02:16 UTC  x86_64 x86_64 x86_64 GNU/Linux
mastacontrola commented 3 years ago

This is because we support Debian, Ubuntu, Mint.

We don't support other OSs' for the installer. There's just too many variables to consider.

The reason for the single instance case is a future proofing technique so if we do need to support another OS (say Pop!_OS for example) we can add in the case statement for it and have a reference technique. Not everyone automatically know how to use a case statement within bash scripting. This just allows a simpler method to add any inclusions.

68267a commented 3 years ago

What I meant is that you have a switch with only one case and no default.

If a fork isn't supported then the installer should exit and provide minimum requirements. Otherwise the case that you do have should be the default, and any exceptions should have their own case.

68267a commented 3 years ago

Not sure if it was obvious from the os-release, Pop! OS is a fork of Ubuntu, no different than Mint.

mastacontrola commented 3 years ago

We don't have a default because reasons? There isn't really a need to set a default. It looks like the case statement was put in to add potential fixes for things.

We don't exit out simply because some times the installer will work fine. For example, I am fairly sure ElementaryOS will install just fine even though it's not "officially" supported.