Page 1 of 1

Moquitto Start-Stop Daemon Problem

Posted: Wed Oct 28, 2015 12:18 am
by phaze3131
Hey guys, I'm running Wheezy on my Rpi 2. I installed mosquitto using this method:

curl -O http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
sudo apt-key add mosquitto-repo.gpg.key
rm mosquitto-repo.gpg.key
cd /etc/apt/sources.list.d/
sudo curl -O http://repo.mosquitto.org/debian/mosquitto-repo.list
sudo apt-get update
sudo apt-get install mosquitto mosquitto-clients python-mosquitto
_________________________________________________________

Then when I run:
sudo /etc/init.d/mosquitto stop

I get this error:
[....] Stopping network daemon:: mosquittostart-stop-daemon: warning: failed to kill 2824: No such process
. ok

I run the start and restart commands which both work, but when I run the stop command the error comes up everytime.

I removed and reinstalled mosquitto because something was not working, so this time I want to make sure everything goes smooth, but this problem I think needs to be addressed by me and not looked over.

Thanks so much for all the help,

Travis

Edit: When I first ran sudo apt-get update I was getting this error:
E: Type '<?xml' is not known on line 1 in source list /etc/apt/sources.list.d/mosquitto-repo.list

So I removed the everything in the file which was html code and just put:
deb http://repo.mosquitto.org/debian wheezy main

Which is the only contents of mosquitto-wheezy.list

Re: Moquitto Start-Stop Daemon Problem

Posted: Wed Oct 28, 2015 8:22 am
by DougieLawson
If I were you I'd build Mosquitto 1.4.4 (MQTT v3.1.1 & websockets) from source code.

Re: Moquitto Start-Stop Daemon Problem

Posted: Wed Oct 28, 2015 8:47 am
by Massi
DougieLawson wrote:If I were you I'd build Mosquitto 1.4.4 (MQTT v3.1.1 & websockets) from source code.
i realized that mosquitto's websockets aren't even in jessie :(
i'm so sad :(

Re: Moquitto Start-Stop Daemon Problem

Posted: Wed Oct 28, 2015 2:06 pm
by DougieLawson
It's an easy and quick build. You need libssl-dev and libwebsockets-dev.

There's also a couple of tweaks in the CMake stuff to set WITH_WEBSOCKETS to yes/on.

Code: Select all

CMakeCache.txt:WITH_WEBSOCKETS:BOOL=ON

Code: Select all

config.mk:WITH_WEBSOCKETS:=yes

Re: Moquitto Start-Stop Daemon Problem

Posted: Thu Oct 29, 2015 11:36 pm
by phaze3131
Dougie thanks so much like always.

I've never installed mosquitto from source, which I'm assuming means to manually do it by copying over the necessary files onto the Rpi. As opposed to doing it the way I did.

That makes sense and seems more pure.

I'm wondering if you know of a site that lists instructions on how to do this and which files exactly need to get moved where (and probably permissions changed)

Last thing, to start fresh with my source build, Will this command do a full uninstall/remove:
sudo apt-get remove mosquitto

or should I be doing something more than that to start fresh?

Thanks so much Dougie!

Travis

Re: Moquitto Start-Stop Daemon Problem

Posted: Fri Oct 30, 2015 12:07 am
by DougieLawson
cd /tmp
wget http://mosquitto.org/files/source/mosquitto-1.4.4.tar.gz
tar xavf mosquitto-1.4.4.tar.gz
cd mosquitto*


The Makefile does everything.

make
sudo make install


It all ended up in /usr/local/ (because I left things alone apart from the websockets stuff).

I left the old mosquitto installed. I just moved the old executable out of the way
sudo mv /usr/sbin/mosquitto /usr/sbin/mosquitto.dpkg
and made a symbolic link to the new version
sudo ln -s /usr/local/sbin/mosquitto /usr/sbin/mosquitto

Re: Moquitto Start-Stop Daemon Problem

Posted: Thu Nov 19, 2015 8:44 am
by phaze3131
Dougie, thanks so much for your help.

I am getting this output when I run the "make" command.


pi@raspberrypi /tmp/mosquitto-1.4.4 $ make
set -e; for d in lib client src; do make -C ${d}; done
make[1]: Entering directory '/tmp/mosquitto-1.4.4/lib'
cc -Wall -ggdb -O2 -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -DWITH_SOCKS -DWITH_SRV -c mosquitto.c -o mosquitto.o
In file included from mosquitto.c:33:0:
./mosquitto_internal.h:27:27: fatal error: openssl/ssl.h: No such file or directory
compilation terminated.
Makefile:51: recipe for target 'mosquitto.o' failed
make[1]: *** [mosquitto.o] Error 1
make[1]: Leaving directory '/tmp/mosquitto-1.4.4/lib'
Makefile:21: recipe for target 'mosquitto' failed
make: *** [mosquitto] Error 2

...............................
Here are the contents of the mosquitto directory inside /tmp


pi@raspberrypi /tmp/mosquitto-1.4.4 $ ls
about.html CONTRIBUTING.md Makefile readme-windows.txt
aclfile.example edl-v10 man security
ChangeLog.txt epl-v10 misc service
client examples mosquitto.conf src
CMakeLists.txt installer notice.html test
compiling.txt lib pskfile.example
config.h LICENSE.txt pwfile.example
config.mk logo readme.md


...........

I like your method of installation and I learned alot about how file linking 'ln' works after doing some research, really trying to get a grasp on this, and thanks so much again.

Travis

Re: Moquitto Start-Stop Daemon Problem

Posted: Thu Nov 19, 2015 8:49 am
by AndyD
phaze3131 wrote:./mosquitto_internal.h:27:27: fatal error: openssl/ssl.h: No such file or directory
The openssl/ssl.h header is in the libssl-dev package. Try installing that.

Code: Select all

sudo apt-get update
sudo apt-get install libssl-dev
and then run make again.