I have installed mosquito broker on my mac using brew install mosquitto
.
Normally I don't give any commands to start the mosquitto server. It is started automatically when I switch on my mac.
I have verified that it is running by using the command ps -ef | grep mosquitto
, which gives the following output
501 209 153 0 2:20PM ?? 0:06.93/usr/local/opt/mosquitto/sbin/mosquitto -c /usr/local/etc/mosquitto/mosquitto.conf
501 2559 1007 0 10:36AM ttys001 0:00.00 grep mosquitto
501 865 815 0 2:32PM ttys003 0:00.86 mosquitto_sub -h 127.0.0.1 -t esb.test2
Then I stopped the server by killing the mosquitto process using kill -9 above-pid
.
Now I would like to know how can I restart the server again from command line, but without restarting my mac.
You could kill the mosquitto process using the steps detailed in the answer here, then restart it in the same way you did originally.
To summarise the answer
Should do the job to stop the existing process.