From 503493c1403780fd6dd456ecf17d9e26f719c8b8 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Sat, 9 May 2020 15:40:52 +0000 Subject: [PATCH 1/3] fix for ubuntu 20 --- xo-install.sh | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/xo-install.sh b/xo-install.sh index 8cd5463..be869f3 100755 --- a/xo-install.sh +++ b/xo-install.sh @@ -149,13 +149,29 @@ function InstallDependenciesDebian { # Install necessary dependencies for XO build - if [[ $OSVERSION =~ (16|18) ]]; then + if [[ $OSVERSION =~ (16|18|20) ]]; then echo -ne "${PROGRESS} OS Ubuntu so making sure universe repository is enabled" add-apt-repository universe >/dev/null echo -e "\r${OK} OS Ubuntu so making sure universe repository is enabled" echo fi + if [[ $OSVERSION =~ (16|18) ]]; then + echo -ne "${PROGRESS} Installing Python for Ubuntu 16 and 18" + apt-get install -y python-minimal >/dev/null + echo -e "\r${OK} Python installed" + echo + fi + + if [[ $OSVERSION =~ (20) ]]; then + echo -ne "${PROGRESS} Installing Python for Ubuntu 20" + apt-get install -y python2-minimal >/dev/null + echo -e "\r${OK} Python installed" + echo + fi + + + echo echo -ne "${PROGRESS} Running apt-get update" apt-get update >/dev/null @@ -225,8 +241,8 @@ function InstallDependenciesDebian { # install packages echo - echo -ne "${PROGRESS} Installing build dependencies, redis server, python, git, libvhdi-utils, lvm2, nfs-common, cifs-utils" - apt-get install -y build-essential redis-server libpng-dev git python-minimal libvhdi-utils lvm2 nfs-common cifs-utils >/dev/null + echo -ne "${PROGRESS} Installing build dependencies, redis server, git, libvhdi-utils, lvm2, nfs-common, cifs-utils" + apt-get install -y build-essential redis-server libpng-dev git libvhdi-utils lvm2 nfs-common cifs-utils >/dev/null echo -e "\r${OK} Installing build dependencies, redis server, python, git, libvhdi-utils, lvm2, nfs-common, cifs-utils" echo @@ -642,8 +658,8 @@ function CheckOS { if [[ $OSNAME == "Debian" ]] && [[ ! $OSVERSION =~ ^(8|9|10)$ ]]; then echo -e "${FAIL} Only Debian 8/9/10 supported" exit 0 - elif [[ $OSNAME == "Ubuntu" ]] && [[ ! $OSVERSION =~ ^(16|18)$ ]]; then - echo -e "${FAIL} Only Ubuntu 16/18 supported" + elif [[ $OSNAME == "Ubuntu" ]] && [[ ! $OSVERSION =~ ^(16|18|20)$ ]]; then + echo -e "${FAIL} Only Ubuntu 16/18/20 supported" exit 0 fi else From 631124d683fa246b62df5604715d60d89c89ad9a Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Sat, 9 May 2020 15:54:22 +0000 Subject: [PATCH 2/3] add fix for service not running as root --- xo-install.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xo-install.sh b/xo-install.sh index be869f3..f550db2 100755 --- a/xo-install.sh +++ b/xo-install.sh @@ -488,6 +488,8 @@ function InstallXO { echo -e "${INFO} Activating modified configuration file" mkdir -p $CONFIGPATH/.config/xo-server mv -f $INSTALLDIR/xo-builds/xen-orchestra-$TIME/packages/xo-server/sample.config.toml $CONFIGPATH/.config/xo-server/config.toml + #fix permissions if service is not running as root + chown -R $XOUSER:$XOUSER $CONFIGPATH fi From 1ddef1efbf284679b5610b903b3828f3c4193e7a Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Mon, 11 May 2020 12:45:57 +0000 Subject: [PATCH 3/3] changes per upstream mainters request --- README.md | 2 ++ xo-install.sh | 32 ++++++++++++-------------------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 351a235..d22e0b1 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ Installation works but not tested frequently: - Debian 8 - Debian 9 - Ubuntu 16.04 +- Ubuntu 20.04 In order to use file level restore from delta backups, the service needs to be ran as root. CentOS installation is currently not able to do file level restore if the backed up disk contains LVM or only sees some of the partitions. @@ -116,6 +117,7 @@ Debian/Ubuntu: - libpng-dev - git - python-minimal +- python2-minimal (Ubuntu 20 only, replaces python-minimal) - libvhdi-utils - lvm2 - nfs-common diff --git a/xo-install.sh b/xo-install.sh index f550db2..a13fca6 100755 --- a/xo-install.sh +++ b/xo-install.sh @@ -156,22 +156,6 @@ function InstallDependenciesDebian { echo fi - if [[ $OSVERSION =~ (16|18) ]]; then - echo -ne "${PROGRESS} Installing Python for Ubuntu 16 and 18" - apt-get install -y python-minimal >/dev/null - echo -e "\r${OK} Python installed" - echo - fi - - if [[ $OSVERSION =~ (20) ]]; then - echo -ne "${PROGRESS} Installing Python for Ubuntu 20" - apt-get install -y python2-minimal >/dev/null - echo -e "\r${OK} Python installed" - echo - fi - - - echo echo -ne "${PROGRESS} Running apt-get update" apt-get update >/dev/null @@ -238,11 +222,18 @@ function InstallDependenciesDebian { echo -e "\r${OK} Installing node.js" fi fi + + #determine which python package is needed. Ubuntu 20 requires python2-minimal, 16 and 18 are python-minimal + if [[ $OSVERSION == "20" ]]; then + PYTHON="python2-minimal" + else + PYTHON="python-minimal" + fi # install packages echo - echo -ne "${PROGRESS} Installing build dependencies, redis server, git, libvhdi-utils, lvm2, nfs-common, cifs-utils" - apt-get install -y build-essential redis-server libpng-dev git libvhdi-utils lvm2 nfs-common cifs-utils >/dev/null + echo -ne "${PROGRESS} Installing build dependencies, redis server, git, libvhdi-utils, python-minimal, lvm2, nfs-common, cifs-utils" + apt-get install -y build-essential redis-server libpng-dev git libvhdi-utils $PYTHON lvm2 nfs-common cifs-utils >/dev/null echo -e "\r${OK} Installing build dependencies, redis server, python, git, libvhdi-utils, lvm2, nfs-common, cifs-utils" echo @@ -488,8 +479,7 @@ function InstallXO { echo -e "${INFO} Activating modified configuration file" mkdir -p $CONFIGPATH/.config/xo-server mv -f $INSTALLDIR/xo-builds/xen-orchestra-$TIME/packages/xo-server/sample.config.toml $CONFIGPATH/.config/xo-server/config.toml - #fix permissions if service is not running as root - chown -R $XOUSER:$XOUSER $CONFIGPATH + fi @@ -508,6 +498,8 @@ function InstallXO { fi chown -R $XOUSER:$XOUSER /var/lib/xo-server + + chown -R $XOUSER:$XOUSER $CONFIGPATH/.config/xo-server fi # fix to prevent older installations to not update because systemd service is not symlinked anymore