GithubHelp home page GithubHelp logo

Comments (7)

jpmens avatar jpmens commented on August 23, 2024

This is probably a duplicate of #33
please see if that solves the problem for you.

from mosquitto-auth-plug.

zhangshexin avatar zhangshexin commented on August 23, 2024

Very embrace owe, in "# 33" I asked, because worried that you can't see the separate wrote a title, from last week to now has not solved the problem, I am in the mosquitto config.mk file modified WITH_SRV value is NO. And make again, but still show "unable to load"

from mosquitto-auth-plug.

jpmens avatar jpmens commented on August 23, 2024

You are not giving me any detail on the steps you took to install Mosquitto with the authentication plugin. Show me what you did, show me your OS version, etc.

from mosquitto-auth-plug.

zhangshexin avatar zhangshexin commented on August 23, 2024

ubuntu 14.04

mosquitto version 1.3.5

I use mosquitto - v shows under the terminal
samzhang@samzhang-virtual-machine:~$ /usr/local/mosquitto/sbin/mosquitto -v
1419241438: mosquitto version 1.3.5 (build date 2014-12-19 17:34:38+0800) starting
1419241438: Using default config.
1419241438: Opening ipv4 listen socket on port 1883.
1419241438: Opening ipv6 listen socket on port 1883.

I modified mosquitto.conf file

auth_plugin /home/samzhang/Downloads/mosquitto-auth-plug-master/auth-plug.so
auth_opt_backends MYSQL
#auth_opt_cdbname pwdb.cdb
auth_opt_host 10.2.0.211
auth_opt_port 3306
auth_opt_dbname mqttdb
auth_opt_user root
auth_opt_pass samzhang
auth_opt_userquery SELECT pw FROM users WHERE username = '%s'
auth_opt_superquery SELECT IFNULL(COUNT(*), 0) FROM users WHERE username = '%s' AND super = 1

auth_opt_aclquery SELECT topic FROM acls WHERE username = '%s'

The auth plug config. mk file

BACKEND_CDB ?= no
BACKEND_MYSQL ?= yes
BACKEND_SQLITE ?= no
BACKEND_REDIS ?= no
BACKEND_POSTGRES ?= no
BACKEND_LDAP ?= no
BACKEND_HTTP ?= no

Specify the path to the Mosquitto sources here

MOSQUITTO_SRC =/home/samzhang/mosquitto-1.3.5

Specify the path the OpenSSL here

OPENSSLDIR = /usr

The results of auth plug-in make

samzhang@samzhang-virtual-machine:~/Downloads/mosquitto-auth-plug-master$ make
Selected backends: MySQL
Using mosquitto source dir: /home/samzhang/mosquitto-1.3.5
OpenSSL install dir: /usr

If you changed the backend selection, you might need to 'make clean' first

cc -I/home/samzhang/mosquitto-1.3.5/src/ -I/home/samzhang/mosquitto-1.3.5/lib/ -fPIC -Wall -Werror -DBE_MYSQL mysql_config --cflags -I/src -DDEBUG=1 -I/usr/include -c -o auth-plug.o auth-plug.c
cc -I/home/samzhang/mosquitto-1.3.5/src/ -I/home/samzhang/mosquitto-1.3.5/lib/ -fPIC -Wall -Werror -DBE_MYSQL mysql_config --cflags -I/src -DDEBUG=1 -I/usr/include -c -o base64.o base64.c
cc -I/home/samzhang/mosquitto-1.3.5/src/ -I/home/samzhang/mosquitto-1.3.5/lib/ -fPIC -Wall -Werror -DBE_MYSQL mysql_config --cflags -I/src -DDEBUG=1 -I/usr/include -c -o pbkdf2-check.o pbkdf2-check.c
cc -I/home/samzhang/mosquitto-1.3.5/src/ -I/home/samzhang/mosquitto-1.3.5/lib/ -fPIC -Wall -Werror -DBE_MYSQL mysql_config --cflags -I/src -DDEBUG=1 -I/usr/include -c -o log.o log.c
cc -I/home/samzhang/mosquitto-1.3.5/src/ -I/home/samzhang/mosquitto-1.3.5/lib/ -fPIC -Wall -Werror -DBE_MYSQL mysql_config --cflags -I/src -DDEBUG=1 -I/usr/include -c -o hash.o hash.c
cc -I/home/samzhang/mosquitto-1.3.5/src/ -I/home/samzhang/mosquitto-1.3.5/lib/ -fPIC -Wall -Werror -DBE_MYSQL mysql_config --cflags -I/src -DDEBUG=1 -I/usr/include -c -o be-psk.o be-psk.c
cc -I/home/samzhang/mosquitto-1.3.5/src/ -I/home/samzhang/mosquitto-1.3.5/lib/ -fPIC -Wall -Werror -DBE_MYSQL mysql_config --cflags -I/src -DDEBUG=1 -I/usr/include -c -o backends.o backends.c
cc -I/home/samzhang/mosquitto-1.3.5/src/ -I/home/samzhang/mosquitto-1.3.5/lib/ -fPIC -Wall -Werror -DBE_MYSQL mysql_config --cflags -I/src -DDEBUG=1 -I/usr/include -c -o cache.o cache.c
cc -I/home/samzhang/mosquitto-1.3.5/src/ -I/home/samzhang/mosquitto-1.3.5/lib/ -fPIC -Wall -Werror -DBE_MYSQL mysql_config --cflags -I/src -DDEBUG=1 -I/usr/include -c -o be-mysql.o be-mysql.c
cc -I/home/samzhang/mosquitto-1.3.5/src/ -I/home/samzhang/mosquitto-1.3.5/lib/ -fPIC -Wall -Werror -DBE_MYSQL mysql_config --cflags -I/src -DDEBUG=1 -I/usr/include -L/home/samzhang/mosquitto-1.3.5/lib/ -lcares -fPIC -shared -o auth-plug.so auth-plug.o base64.o pbkdf2-check.o log.o hash.o be-psk.o backends.o cache.o be-mysql.o mysql_config --libs -L/usr/lib -lcrypto -lmosquitto
cc -I/home/samzhang/mosquitto-1.3.5/src/ -I/home/samzhang/mosquitto-1.3.5/lib/ -fPIC -Wall -Werror -DBE_MYSQL mysql_config --cflags -I/src -DDEBUG=1 -I/usr/include np.c base64.o -o np -L/usr/lib -lcrypto

Successfully obtained auth-plug.so


use ldd
samzhang@samzhang-virtual-machine:~/Downloads/mosquitto-auth-plug-master$ ldd auth-plug.so
linux-gate.so.1 => (0xb7788000)
libmysqlclient.so.18 => /usr/lib/i386-linux-gnu/libmysqlclient.so.18 (0xb7439000)
libcrypto.so.1.0.0 => /lib/i386-linux-gnu/libcrypto.so.1.0.0 (0xb728d000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb70dd000)
libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xb70c3000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb70be000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb70a2000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb705c000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb703e000)
/lib/ld-linux.so.2 (0xb7789000)

that's all

thank you very much again

from mosquitto-auth-plug.

jpmens avatar jpmens commented on August 23, 2024

Did you copy auth-plug.so to the path you configured as /home/samzhang/Downloads/mosquitto-auth-plug-master/auth-plug.so?

Have you tried printing the cause of the loader error as described at #33 (comment) ? Please show me that error.

from mosquitto-auth-plug.

zhangshexin avatar zhangshexin commented on August 23, 2024

This is my information

samzhang@samzhang-virtual-machine:~$ /usr/local/mosquitto/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf -v
1419301406: mosquitto version 1.3.5 (build date 2014-12-23 10:20:56+0800) starting
1419301406: Config loaded from /etc/mosquitto/mosquitto.conf.
LOADERROR /home/samzhang/Downloads/mosquitto-auth-plug-master/auth-plug.so: undefined symbol: ares_library_init
1419301406: Error: Unable to load auth plugin "/home/samzhang/Downloads/mosquitto-auth-plug-master/auth-plug.so".

Is the same with # 33, but I've put the "WITH_SRV: = yes" change to "WITH_SRV: = no"

from mosquitto-auth-plug.

zhangshexin avatar zhangshexin commented on August 23, 2024

Thank you very much, already can use, may be I used the virtual machine

from mosquitto-auth-plug.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.