By: Merlin Hughes user 25 Jan 2017 at 8:34 p.m. CST

3 Responses
Merlin Hughes gravatar
Hi, I installed Gluu on an AWS Linux EC2 instance using the CentOS 6 installation instructions. Everything almost works perfectly, but there is a bug in the `/etc/init.d/gluu-server-2.4.4.2` init script that makes `service gluu-server-2.4.4.2 login / stop` fail on this system, claiming the server is not running. The problem is this check: ``` STAT=(`df -aP |grep \/opt\/gluu-server-2.4.4.2\/ | awk '{ print $6 }' | grep -Eohw 'proc|lo|pts|modules|dev'`) ... elif [ -f $PIDFILE ] && [ ${#STAT[@]} = "6" ]; then ``` This fails because `${#STAT[@]}` is 7. Specifically, here's what gets that answer: ``` # df -aP |grep \/opt\/gluu-server-2.4.4.2\/ devtmpfs 2014036 56 2013980 1% /opt/gluu-server-2.4.4.2/dev /proc 0 0 0 - /opt/gluu-server-2.4.4.2/proc /sys/class/net/lo 0 0 0 - /opt/gluu-server-2.4.4.2/sys/class/net/lo /dev/xvda1 65922792 2884608 62937936 5% /opt/gluu-server-2.4.4.2/lib/modules /dev/pts 0 0 0 - /opt/gluu-server-2.4.4.2/dev/pts none 0 0 0 - /opt/gluu-server-2.4.4.2/proc/sys/fs/binfmt_misc ``` ``` # df -aP |grep \/opt\/gluu-server-2.4.4.2\/ | awk '{ print $6 }' /opt/gluu-server-2.4.4.2/dev /opt/gluu-server-2.4.4.2/proc /opt/gluu-server-2.4.4.2/sys/class/net/lo /opt/gluu-server-2.4.4.2/lib/modules /opt/gluu-server-2.4.4.2/dev/pts /opt/gluu-server-2.4.4.2/proc/sys/fs/binfmt_misc ``` ``` # df -aP |grep \/opt\/gluu-server-2.4.4.2\/ | awk '{ print $6 }'| grep -Eohw 'proc|lo|pts|modules|dev' dev proc lo modules dev pts proc ``` I just changed the script to "7" and all was good.

By Sahil Arora user 25 Jan 2017 at 10:21 p.m. CST

Sahil Arora gravatar
Hi Hughes, I'm NOT able to reproduce on Cent OS 6.8. I will check further on this and get back to you. Thanks

By Aliaksandr Samuseu staff 27 Jan 2017 at 2:10 p.m. CST

Aliaksandr Samuseu gravatar
Hi, Merlin. I've done a test install on AWS CentOS 6.7 vm, and also wasn't able to reproduce your issue. My steps: 1. Run `# yum update` 2. Install **wget** 3. Follow usual Gluu CE deployment steps from docs portal for CentOS6; I used exact commands from the guide, simply copy-pasting them into console; no issues were encountered 4. Exit container after installation is complete 5. Stop/Start/Login with `# service gluu-server-2.4.4.2 start`/etc 6. Stop/Start/Login with `# /etc/init.d/gluu-server-2.4.4.2 start`/etc ..still no issues encountered. Am I missing something here?

By Aliaksandr Samuseu staff 30 Jan 2017 at 12:34 p.m. CST

Aliaksandr Samuseu gravatar
I was able to reproduce it in another vm with "AWS Linux" as OS. Here is distro's info: ``` # cat /etc/*release NAME="Amazon Linux AMI" VERSION="2016.09" ID="amzn" ID_LIKE="rhel fedora" VERSION_ID="2016.09" PRETTY_NAME="Amazon Linux AMI 2016.09" ANSI_COLOR="0;33" CPE_NAME="cpe:/o:amazon:linux:2016.09:ga" HOME_URL="http://aws.amazon.com/amazon-linux-ami/" Amazon Linux AMI release 2016.09 # uname -a Linux my.host.loc 4.4.41-36.55.amzn1.x86_64 #1 SMP Wed Jan 18 01:03:26 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux ``` Merlin's observation is correct, here is output of `# df -aP |grep \/opt\/gluu-server-2.4.4.2\/ ` from it: ``` devtmpfs 2014036 56 2013980 1% /opt/gluu-server-2.4.4.2/dev /proc 0 0 0 - /opt/gluu-server-2.4.4.2/proc /sys/class/net/lo 0 0 0 - /opt/gluu-server-2.4.4.2/sys/class/net/lo /dev/xvda1 8123812 3012156 5011408 38% /opt/gluu-server-2.4.4.2/lib/modules /dev/pts 0 0 0 - /opt/gluu-server-2.4.4.2/dev/pts none 0 0 0 - /opt/gluu-server-2.4.4.2/proc/sys/fs/binfmt_misc ``` ...and from another (CentOS6) vm: ``` /dev 8155112 164 8154948 1% /opt/gluu-server-2.4.4/dev /proc 0 0 0 - /opt/gluu-server-2.4.4/proc /sys/devices/virtual/net/lo 0 0 0 - /opt/gluu-server-2.4.4/sys/class/net/lo /lib/modules 61288328 15323580 42844828 27% /opt/gluu-server-2.4.4/lib/modules /dev/pts 0 0 0 - /opt/gluu-server-2.4.4/dev/pts ``` The former has this additional `/opt/gluu-server-2.4.4.2/proc/sys/fs/binfmt_misc` line which will result in final number of patterns found by **grep** be greater by one in that case, hence the issue. Changing all inclusions of `"6"` to `"7"` seems to fix it completely. I'll reassign the ticket to Adrian now so he could decide what is the best way to fix it.