User avatar
phaze3131
Posts: 45
Joined: Thu Apr 30, 2015 3:50 am

Moquitto Start-Stop Daemon Problem

Wed Oct 28, 2015 12:18 am

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

User avatar
DougieLawson
Posts: 35779
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Moquitto Start-Stop Daemon Problem

Wed Oct 28, 2015 8:22 am

If I were you I'd build Mosquitto 1.4.4 (MQTT v3.1.1 & websockets) from source code.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Massi
Posts: 1691
Joined: Fri May 02, 2014 1:52 pm
Location: Italy

Re: Moquitto Start-Stop Daemon Problem

Wed Oct 28, 2015 8:47 am

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 :(

User avatar
DougieLawson
Posts: 35779
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Moquitto Start-Stop Daemon Problem

Wed Oct 28, 2015 2:06 pm

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
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
phaze3131
Posts: 45
Joined: Thu Apr 30, 2015 3:50 am

Re: Moquitto Start-Stop Daemon Problem

Thu Oct 29, 2015 11:36 pm

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

User avatar
DougieLawson
Posts: 35779
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Moquitto Start-Stop Daemon Problem

Fri Oct 30, 2015 12:07 am

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
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
phaze3131
Posts: 45
Joined: Thu Apr 30, 2015 3:50 am

Re: Moquitto Start-Stop Daemon Problem

Thu Nov 19, 2015 8:44 am

Dougie, thanks so much for your help.

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


[email protected] /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


[email protected] /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

User avatar
AndyD
Posts: 2331
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: Moquitto Start-Stop Daemon Problem

Thu Nov 19, 2015 8:49 am

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.

Return to “Beginners”