Error when running starting server service

Hi

I have installed using tar a program called rabbitmq , and when I try to start it according to documentation, I get the following error:

/usr/local/sbin/rabbitmq_server-3.6.14/sbin# ./rabbitmq-server
./rabbitmq-server[22]: .[49]: local: not found [No such file or directory]
root@solaris11test:/usr/local/sbin/rabbitmq_server-3.6.14/sbin#

I did add the path as

export PATH=/usr/local/sbin:$PATH

, But I still get the error.
Can you tell if I am missing something

That means that the file 'rabbitmq-server' is not in the directory that you are trying to launch it from. You are in the wrong directory.

Find the directory that the file is in, change to that directory, and try it again from there.

cd <wherever>
./rabbitmq-server

You may then get a different error depending on what else is needed eg, a search path needs setting.

Hi

Thanks for the reply, but I am in the right directory:

root@solaris11test:/usr/local/sbin/rabbitmq_server-3.6.14/sbin# ls -lrt
total 61
-rwxr-xr-x   1 1023     1023        1480 Nov  7 09:46 rabbitmqctl
-rwxr-xr-x   1 1023     1023       10971 Nov  7 09:46 rabbitmq-server
-rwxr-xr-x   1 1023     1023        1362 Nov  7 09:46 rabbitmq-plugins
-rwxr-xr-x   1 1023     1023       12095 Nov  7 09:46 rabbitmq-env
-rwxr-xr-x   1 1023     1023        1885 Nov  7 09:46 rabbitmq-defaults
root@solaris11test:/usr/local/sbin/rabbitmq_server-3.6.14/sbin# ./rabbitmq-server
./rabbitmq-server[22]: .[49]: local: not found [No such file or directory]
root@solaris11test:/usr/local/sbin/rabbitmq_server-3.6.14/sbin#

and still not able to run it

Show us the first 50 lines of rabbitmq-server and tell us what operating system and shell you're using.

One would guess that either rabbitmq-server line 49 contains the command:

. local ...

and local is not a file in your current working directory when you get to line 49 in that script or that rabbitmq-server line 49 is trying to declare a variable in a function to be a local variable and the shell you're using when you run that script doesn't recognize the local keyword.

Please show the rabbitmq-server script, esp. the line 22 (and the definition of all shell variables referenced therein).

EDIT: and line 49 as requested by Don Cragun.

Hi

I did found a solution for that particular error which was I had to replace #!/bin/sh with

#!/usr/xpg4/bin/sh

. But now I am having another error, refering to line 81 of the script:~

 ./rabbitmq-server
./rabbitmq-server: line 81: erl: command not found

and viewing the line 81 with vi :

79 # NOTIFY_SOCKET is needed here to prevent epmd from impersonating the
     80 # success of our startup sequence to systemd.
     81 NOTIFY_SOCKET= \
     82 RABBITMQ_CONFIG_FILE=$RABBITMQ_CONFIG_FILE \
     83 RABBITMQ_DIST_PORT=$RABBITMQ_DIST_PORT \

Now I am also stuck

But erlang is installed as per the following line:

/usr/sbin/pkgchk -L CSWerlang # list files

which lists the files

NOTIFY_SOCKET= \

Lose the space

NOTIFY_SOCKET=\

sorry:

line 22:

 18
     19 set -e
     20
     21 # Get default settings with user overrides for (RABBITMQ_)<var_name>
     22 # Non-empty defaults should be set in rabbitmq-env
     23 . `dirname $0`/rabbitmq-env
     24
     25 RABBITMQ_START_RABBIT=
     26 [ "x" = "x$RABBITMQ_ALLOW_INPUT" ] && RABBITMQ_START_RABBIT=" -noinput"
     27 [ "x" = "x$RABBITMQ_NODE_ONLY" ] && RABBITMQ_START_RABBIT="$RABBITMQ_START_RABBIT -s $RABBITMQ_BOOT_MODULE boot "
     28

line 49:

 46                if ! mkdir -p "$RABBITMQ_PID_DIR"; then
     47                    # Better diagnostics - 'mkdir -p' reports only the first directory in chain that
     48                    # it fails to create
     49                    echo "Failed to create directory: $RABBITMQ_PID_DIR"
     50                    exit $EX_CANTCREAT
     51                fi