We hope you'll join us for our 4/23 webinar on using data tables to apply reference ranges and AE codes in OC4. For more information and to register, visit https://register.gotowebinar.com/register/2882170018956684555

/bin/sh: bad interpreter: Permission denied when installing Postgres on Linux

Hello

I have a vps Linux x64 (v2.6.18; CentOS 6.7). I am in the process of installing OpenClinica on it.
So far, I have (following the instructions) installed Java and Tomcat. However, when I try to install
Postgres typing as root at the command line this

./postgresql* --mode text

I get the frustrating message below.

Error:
Error running /tmp/postgresql_installer/getlocales.sh :
/bin/sh: /tmp/postgresql_installer/getlocales.sh:
/bin/sh: bad interpreter: Permission denied

What I have already checked

1) the first line of getlocales.sh has '#!/bin/sh' in it

2) there is a link sh -> bash* at /bin

[email protected] [/bin]# ls -l sh lrwxrwxrwx 1 root root 4 Nov 14 12:29 sh -> bash*

3) sestatus is DISABLED in my system

4) I gave chmod a+x permission to postgres*.bin before I ran it.

5) I have even tried to run postgres*.bin from ~/ with no success.

Any ideas?

Comments

  • wdeanmedicalwdeanmedical Posts: 18
    via Email
    This might be your answer, related to exec permissions on a mounted drive.

    http://forums.justlinux.com/showthread.php?126810-SOLVED-bin-bash-bad-interpreter-Permission-denied
  • THANK YOU very much!! You were right!! I have been to that post before, and thought it had nothing to do with my case. BUT when you mentioned it again I had a closer look at it and found the solution. It involved changing the status of /tmp to EXEC flag in /etc/fstab. My CentOS system, for some reason, had NOEXEC attribute on for /tmp. It would never work.
    Best Regards
  • zwetszwets Posts: 59
    via Email
    Mario,

    Which installation instructions are you following? For installing
    PostgreSQL (or any server software) I'd strongly recommend sticking with
    the distro's package manager (rpm, yum, apt). It's always easier than
    installing from source (usually a single statement suffices); it frees
    you of hassles like the below, and it'll keep your system stable.

    Cheers
    Marco
  • Marco, I'm following the instructions provided in the OC site. In the site there is no mention of using rpm or yum. How did you manage to do that? What about the particular and specific configurations like diretories, etc of OC? Did it work for you? I would like to hear your experience. Thanks.
  • zwetszwets Posts: 59
    via Email
    Hi Mario,

    On 16/11/15 14:04, [email protected] wrote:
    > Marco, I'm following the instructions provided in the OC site. In the site there is no mention of using rpm or yum. How did you manage to do that? What about the particular and specific configurations like diretories, etc of OC? Did it work for you? I would like to hear your experience. Thanks.
    When time allows I'll write down my setup of OC, but ATM I'm just too
    much short of time. My opinion is that the way OC does it is
    non-standard, messy and complicated.

    In short:
    - Java: use your distro's package installer
    - Postgres: use your distro's package installer
    - Tomcat: unpack in e.g. /opt/tomcat/... and stick to standard Tomcat
    install
    - configure conf/* and bin/setenv.sh
    - add the postgres jdbc jar (NEWEST from jdbc.postgresql.org) in lib
    - remove the postgres jdbc jar from the OC webapp lib directory
    - OC:
    - put the webapp in the Tomcat webapps directory
    - point the filepath OUTSIDE of the tomcat directory, e.g.
    /var/lib/openclinica/filedata/...

    Sorry to not being of much help right now ...

    Good luck!
    Marco
This discussion has been closed.