public inbox for [email protected]  
help / color / mirror / Atom feed
From: Sandeep Thakkar <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: setup-web.sh - support for suse 12/15
Date: Thu, 17 Mar 2022 17:12:15 +0530
Message-ID: <CANFyU97LC5=wMUMTfsYRbrDZkfoc1Oo+k13NpJ=P3zyPb-WRrQ@mail.gmail.com> (raw)

Hi,

Please find attached the patch for the setup-web.sh to add support for the
SUSE platform. I verified it on SUSE 12 and 15, x86_64 and PPCLE
architectures

Thanks,

-- 
Sandeep Thakkar


Attachments:

  [application/octet-stream] suse-support-setupweb.patch (1.6K, 3-suse-support-setupweb.patch)
  download | inline diff:
diff --git a/pkg/linux/setup-web.sh b/pkg/linux/setup-web.sh
index 86607898f..a279841a3 100755
--- a/pkg/linux/setup-web.sh
+++ b/pkg/linux/setup-web.sh
@@ -16,6 +16,7 @@ fi
 
 IS_REDHAT=0
 IS_DEBIAN=0
+IS_SUSE=0
 UNAME=$(uname -a)
 
 # Get the distro from the environment
@@ -24,6 +25,11 @@ if [ "x${PGADMIN_PLATFORM_TYPE}" == "x" ]; then
         PLATFORM_TYPE=redhat
     elif [[ ${UNAME} =~ "Ubuntu" ]] || [[ ${UNAME} =~ "Debian" ]] || [ -f /etc/apt/sources.list ]; then
         PLATFORM_TYPE=debian
+    elif [ -f /etc/os-release ]; then
+        if grep suse /etc/os-release > /dev/null
+        then
+            PLATFORM_TYPE=suse
+        fi
     else
         echo "Failed to detect the platform. This may mean you're running on a Linux distribution that isn't supported by pgAdmin."
         echo "Please set the PGADMIN_PLATFORM_TYPE environment variable to one of 'redhat' or 'debian' and try again."
@@ -45,6 +51,11 @@ case ${PLATFORM_TYPE} in
         IS_DEBIAN=1
         APACHE=apache2
         ;;
+    suse)
+        echo "Setting up pgAdmin 4 in web mode on a SUSE based platform..."
+        IS_SUSE=1
+        APACHE=apache2
+        ;;
 
     *)
         echo "Invalid value for the PGADMIN_PLATFORM_TYPE environment variable. Please set it to one of 'redhat' or 'debian' and try again."
@@ -75,6 +86,8 @@ mkdir -p /var/log/pgadmin /var/lib/pgadmin
 
 if [ ${IS_REDHAT} == 1 ]; then
     chown apache: /var/log/pgadmin /var/lib/pgadmin -R
+elif [ ${IS_SUSE} == 1 ]; then
+    chown wwwrun: /var/log/pgadmin /var/lib/pgadmin -R
 else
     chown www-data: /var/log/pgadmin /var/lib/pgadmin -R
 fi


view thread (2+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: setup-web.sh - support for suse 12/15
  In-Reply-To: <CANFyU97LC5=wMUMTfsYRbrDZkfoc1Oo+k13NpJ=P3zyPb-WRrQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox