0

I tried to stop the rabbitmq server from shell script, but its failing to stop

i can run the below command from the shell prompt and could able to stop the rabbitmq server.

sh /data/rabbitmq-3.1.5/rabbitmq_server-3.1.5/sbin/rabbitmqctl stop

but when i try to run the same command from shell script its not able to identify the "stop" after rabbitmqctl command.

Message Received  

Error: could not recognize command Usage: rabbitmqctl [-n ] [-q] []

  • I don't see why you would need the leading `sh ` on cmd-line or in a script. can you try that? Good luck. – shellter Nov 11 '15 at 10:27
  • I tried even without sh its not working. – Java Leo Nov 11 '15 at 10:41
  • Basically its not accepting the command "stop" after rabbitmqctl. Is there any way we can run the "/data/rabbitmq-3.1.5/rabbitmq_server-3.1.5/sbin/rabbitmqctl stop" as single command. – Java Leo Nov 11 '15 at 10:42
  • do `file /data/rabbitmq-3.1.5/rabbitmq_server-3.1.5/sbin/rabbitmqctl ` If the result is something `script`, then look at file w editor and see if it will process a `stop` argument. Based on Usage msg you quote, it doesn't look to be designed to work that way. Consult more `rabbitmq` doc? As a seperate issue, installing software under a dir named `/data` seems non-standard and possibly error prone (but unlikey the cause of your current problem). I'm leaving for a while. Good luck.! – shellter Nov 11 '15 at 10:50
  • Depends on distro etc. Please see http://stackoverflow.com/questions/10608950/how-do-i-stop-the-rabbitmq-server-on-localhost or try /sbin/service rabbitmq-server stop (RHEL) – Andy Thompson Nov 11 '15 at 15:07

0 Answers0