Modify

Opened 4 years ago

Last modified 2 years ago

#12178 new defect

Prosody not working properly

Reported by: anonymous Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: prosody xmpp jabber chat im messenger Cc:

Description

Please update the Package "Prosody" (XMPP server) which is at version 0.6.2 while the latest version is 0.8.2.

Prosody has a few bugs which, I belive, are fixed in the latest version. I cant add other users. When I try to do so logread throws errors like this at me:

Sep 13 22:30:02 OpenWRT daemon.crit prosody[14334]: [truncated] Traceback[c2s]: /usr/lib/prosody/net/adns.lua:34: /usr/lib/prosody/net/dns.lua:186:
bad argument #1 to 'randomseed' (integer expected, got number): stack traceback:    /usr/lib/prosody/net/xmppclient_listener.

Attachments (1)

prosody.patch (733 bytes) - added by anonymous 4 years ago.
Try this patch

Download all attachments as: .zip

Change History (22)

Changed 4 years ago by anonymous

Try this patch

comment:1 Changed 4 years ago by anonymous

I tried it but got compiler errors. Will post them later today.

Thanks!

comment:2 follow-up: Changed 4 years ago by anonymous

After using the new makefile with v0.8.2 and the new md5 hash, I "make dirclean"ed everything and tried to compile it for the ar71xx platform. ("make world V=99")

Here's the log of the first try:

make[3]: Entering directory `/home/vmuser/compiler/openwrt/trunk/feeds/packages/net/prosody'
. /home/vmuser/compiler/openwrt/trunk/include/shell.sh; gzip -dc /home/vmuser/compiler/openwrt/trunk/dl/prosody-0.8.2.tar.gz | /bin/tar -C /home/vmuser/compiler/openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33.2/prosody-0.8.2/.. -xf - 

Applying ./patches/001-conf.patch using plaintext: 
patching file prosody.cfg.lua.dist
Hunk #1 FAILED at 47.
Hunk #2 FAILED at 65.
Hunk #3 succeeded at 129 with fuzz 1 (offset 56 lines).
2 out of 3 hunks FAILED -- saving rejects to file prosody.cfg.lua.dist.rej
Patch failed!  Please fix ./patches/001-conf.patch!
make[3]: *** [/home/vmuser/compiler/openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33.2/prosody-0.8.2/.prepared_13b7bb9675110e95bc36fbc488de914b] Error 1
make[3]: Leaving directory `/home/vmuser/compiler/openwrt/trunk/feeds/packages/net/prosody'
make[2]: *** [package/feeds/packages/prosody/compile] Error 2
make[2]: Leaving directory `/home/vmuser/compiler/openwrt/trunk'
make[1]: *** [/home/vmuser/compiler/openwrt/trunk/staging_dir/target-mips_r2_uClibc-0.9.33.2/stamp/.package_compile] Error 2
make[1]: Leaving directory `/home/vmuser/compiler/openwrt/trunk'
make: *** [world] Fehler 2

Obviously "001-conf.patch" isn't compatible with the new files. As I don't know how to fix that and this patch just changes a few lines in the configuration file anyway (which I can do myself after installing), I deleted it and recompiled.

Here's the log of the second try, without the patch:

sed 's|certs/|/etc/prosody/certs/|' prosody.cfg.lua.dist > prosody.cfg.lua.install
cp prosody.release prosody.version || true
make -C util-src install
make[5]: Entering directory `/home/vmuser/compiler/openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33.2/prosody-0.8.2/util-src'
mips-openwrt-linux-uclibc-gcc -Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -fpic -I/home/vmuser/compiler/openwrt/trunk/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/include -I/home/vmuser/compiler/openwrt/trunk/staging_dir/target-mips_r2_uClibc-0.9.33.2/include -I/home/vmuser/compiler/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/usr/include -I/home/vmuser/compiler/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/include -std=gnu99 -I/home/vmuser/compiler/openwrt/trunk/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/include -c -o encodings.o encodings.c
MACOSX_DEPLOYMENT_TARGET="10.3"; export MACOSX_DEPLOYMENT_TARGET;
mips-openwrt-linux-uclibc-gcc -o encodings.so encodings.o -L/home/vmuser/compiler/openwrt/trunk/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/lib -L/home/vmuser/compiler/openwrt/trunk/staging_dir/target-mips_r2_uClibc-0.9.33.2/lib -L/home/vmuser/compiler/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/usr/lib -L/home/vmuser/compiler/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/lib -lidn
encodings.o: In function `Lidna_to_unicode':
encodings.c:(.text+0xc): undefined reference to `luaL_checklstring'
encodings.c:(.text+0x28): undefined reference to `luaL_checklstring'
encodings.c:(.text+0x58): undefined reference to `lua_pushstring'
encodings.c:(.text+0x5c): undefined reference to `lua_pushstring'
encodings.c:(.text+0x6c): undefined reference to `lua_pushnil'
encodings.c:(.text+0x70): undefined reference to `lua_pushnil'
encodings.o: In function `Lidna_to_ascii':
encodings.c:(.text+0xa8): undefined reference to `luaL_checklstring'
encodings.c:(.text+0xc4): undefined reference to `luaL_checklstring'
encodings.c:(.text+0xf4): undefined reference to `lua_pushstring'
encodings.c:(.text+0xf8): undefined reference to `lua_pushstring'
encodings.c:(.text+0x108): undefined reference to `lua_pushnil'
encodings.c:(.text+0x10c): undefined reference to `lua_pushnil'
encodings.o: In function `base64_decode':
encodings.c:(.text+0x18c): undefined reference to `luaL_addlstring'
encodings.c:(.text+0x1ac): undefined reference to `luaL_addlstring'
encodings.c:(.text+0x1b0): undefined reference to `luaL_addlstring'
encodings.o: In function `Lbase64_decode':
encodings.c:(.text+0x1d0): undefined reference to `luaL_checklstring'
encodings.c:(.text+0x1fc): undefined reference to `luaL_checklstring'
encodings.c:(.text+0x210): undefined reference to `luaL_buffinit'
encodings.c:(.text+0x218): undefined reference to `luaL_buffinit'
encodings.c:(.text+0x254): undefined reference to `luaL_pushresult'
encodings.c:(.text+0x350): undefined reference to `luaL_pushresult'
encodings.o: In function `base64_encode':
encodings.c:(.text+0x400): undefined reference to `luaL_addlstring'
encodings.c:(.text+0x408): undefined reference to `luaL_addlstring'
encodings.o: In function `Lbase64_encode':
encodings.c:(.text+0x428): undefined reference to `luaL_checklstring'
encodings.c:(.text+0x45c): undefined reference to `luaL_checklstring'
encodings.c:(.text+0x470): undefined reference to `luaL_buffinit'
encodings.c:(.text+0x478): undefined reference to `luaL_buffinit'
encodings.c:(.text+0x504): undefined reference to `luaL_pushresult'
encodings.c:(.text+0x544): undefined reference to `luaL_pushresult'
encodings.c:(.text+0x548): undefined reference to `luaL_pushresult'
encodings.o: In function `stringprep_prep.part.0':
encodings.c:(.text+0x588): undefined reference to `lua_tolstring'
encodings.c:(.text+0x5ac): undefined reference to `lua_tolstring'
encodings.c:(.text+0x600): undefined reference to `lua_pushstring'
encodings.c:(.text+0x604): undefined reference to `lua_pushstring'
encodings.c:(.text+0x614): undefined reference to `lua_pushnil'
encodings.c:(.text+0x618): undefined reference to `lua_pushnil'
encodings.o: In function `stringprep_prep':
encodings.c:(.text+0x640): undefined reference to `lua_isstring'
encodings.c:(.text+0x660): undefined reference to `lua_isstring'
encodings.c:(.text+0x674): undefined reference to `lua_pushnil'
encodings.c:(.text+0x678): undefined reference to `lua_pushnil'
encodings.o: In function `luaopen_util_encodings':
encodings.c:(.text+0x734): undefined reference to `luaL_register'
encodings.c:(.text+0x750): undefined reference to `luaL_register'
encodings.c:(.text+0x768): undefined reference to `lua_pushlstring'
encodings.c:(.text+0x76c): undefined reference to `lua_pushlstring'
encodings.c:(.text+0x780): undefined reference to `lua_createtable'
encodings.c:(.text+0x784): undefined reference to `lua_createtable'
encodings.c:(.text+0x79c): undefined reference to `luaL_register'
encodings.c:(.text+0x7a0): undefined reference to `luaL_register'
encodings.c:(.text+0x7b0): undefined reference to `lua_settable'
encodings.c:(.text+0x7b4): undefined reference to `lua_settable'
encodings.c:(.text+0x7cc): undefined reference to `lua_pushlstring'
encodings.c:(.text+0x7d0): undefined reference to `lua_pushlstring'
encodings.c:(.text+0x7e4): undefined reference to `lua_createtable'
encodings.c:(.text+0x7e8): undefined reference to `lua_createtable'
encodings.c:(.text+0x800): undefined reference to `luaL_register'
encodings.c:(.text+0x804): undefined reference to `luaL_register'
encodings.c:(.text+0x814): undefined reference to `lua_settable'
encodings.c:(.text+0x818): undefined reference to `lua_settable'
encodings.c:(.text+0x830): undefined reference to `lua_pushlstring'
encodings.c:(.text+0x834): undefined reference to `lua_pushlstring'
encodings.c:(.text+0x848): undefined reference to `lua_createtable'
encodings.c:(.text+0x84c): undefined reference to `lua_createtable'
encodings.c:(.text+0x864): undefined reference to `luaL_register'
encodings.c:(.text+0x868): undefined reference to `luaL_register'
encodings.c:(.text+0x878): undefined reference to `lua_settable'
encodings.c:(.text+0x87c): undefined reference to `lua_settable'
encodings.c:(.text+0x894): undefined reference to `lua_pushlstring'
encodings.c:(.text+0x898): undefined reference to `lua_pushlstring'
encodings.c:(.text+0x8b0): undefined reference to `lua_pushlstring'
encodings.c:(.text+0x8b4): undefined reference to `lua_pushlstring'
encodings.c:(.text+0x8c4): undefined reference to `lua_settable'
encodings.c:(.text+0x8c8): undefined reference to `lua_settable'
/home/vmuser/compiler/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/lib/gcc/mips-openwrt-linux-uclibc/4.6.3/../../../../mips-openwrt-linux-uclibc/lib/crt1.o: In function `__start':
(.text+0xc): undefined reference to `main'
/home/vmuser/compiler/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/lib/gcc/mips-openwrt-linux-uclibc/4.6.3/../../../../mips-openwrt-linux-uclibc/lib/crt1.o: In function `__start':
(.text+0x10): undefined reference to `main'
collect2: ld returned 1 exit status
make[5]: *** [encodings.so] Error 1
make[5]: Leaving directory `/home/vmuser/compiler/openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33.2/prosody-0.8.2/util-src'
make[4]: *** [all] Error 2
make[4]: Leaving directory `/home/vmuser/compiler/openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33.2/prosody-0.8.2'
make[3]: *** [/home/vmuser/compiler/openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33.2/prosody-0.8.2/.built] Error 2
make[3]: Leaving directory `/home/vmuser/compiler/openwrt/trunk/feeds/packages/net/prosody'
make[2]: *** [package/feeds/packages/prosody/compile] Error 2
make[2]: Leaving directory `/home/vmuser/compiler/openwrt/trunk'
make[1]: *** [/home/vmuser/compiler/openwrt/trunk/staging_dir/target-mips_r2_uClibc-0.9.33.2/stamp/.package_compile] Error 2
make[1]: Leaving directory `/home/vmuser/compiler/openwrt/trunk'
make: *** [world] Fehler 2

This is where I don't know what to do to fix this. Any idea?

Thanks a lot!

comment:3 Changed 4 years ago by Nilfred <nilfred@…>

Try again after r33715, lua gets updated.

comment:4 Changed 4 years ago by anonymous

Unfortunately, errors like that still exist after r33715.

Oct 30 01:26:02 OpenWRT daemon.crit prosody[21098]: [truncated] Traceback[c2s]: /usr/lib/prosody/net/adns.lua:34: /usr/lib/prosody/net/dns.lua:186: bad argument #1 to 'randomseed' (integer expected, got number): stack traceback:    /usr/lib/prosody/net/xmppclient_listener.

comment:5 Changed 4 years ago by Nilfred <nilfred@…>

Looks fixable if someone knows about lua cast to integer:

sed -n "186 p" /usr/lib/prosody/net/dns.lua
	math.randomseed(math.floor(10000*socket.gettime()));
/etc/init.d/prosody status
Prosody is running with PID 4337

It doesn't prevent prosody from running.

Did you get this error with the new makefile for v0.8.2? So finally it compiles after r33715?

comment:6 Changed 4 years ago by Nilfred <nilfred@…>

Got it squashed!:
First read some about lua:
http://www.lua.org/manual/5.1/manual.html#pdf-math.randomseed
http://www.lua.org/manual/5.1/manual.html#pdf-lua_tointeger
Looks like an integer overflow, so remove some zeros until there is no error:

sed -i -e '186 s/\(randomseed(.*1\)0\(.*\)/\1\2/' /usr/lib/prosody/net/dns.lua
/etc/init.d/prosody restart
date
sleep 53
logread | tail
...

When there is no more zeros finally works, so the final code you should test is this:

sed -i -e '186 s/\(randomseed.*\)10*.\(.*\)/\1\2/' /usr/lib/prosody/net/dns.lua

That would remove the "10000*" from that line.

sed -n "186 p" /usr/lib/prosody/net/dns.lua
	math.randomseed(math.floor(socket.gettime()));

Looks like the programmer intention was to get some random from socket.gettime() decimals, so a better code should be a modulus (math.fmod) against integer limit (math.huge?), 65535 or whatever.

My first intention was to replace altogether with a single zero LOL

comment:7 Changed 4 years ago by anonymous

Thanks a lot Nilfred! The errors are gone!

Also I was wrong about the LUA update. That update seemed to have fixed all errors except that one which you described in the previous post.

Still, I can not add other users properly. If I, as User A, add a User B, then B will appear in A's list, but B will never receive a message that he was added. So B can not accept A's request and they can never add each other.
Tried multiple messenger (Miranda, Pidgin, Kadu, something else I dont remember) but still nothing. Now those lua-errors are fixed too (I thought it was because of them), so it must be in the prosody-code itself. Or am I doing something wrong?

tl;dr I still can't add other users.

comment:8 Changed 4 years ago by anonymous

Forgot to add: I will try to compile v0.8.2 again soon.
Again many thanks!

comment:9 Changed 4 years ago by Nilfred <nilfred@…>

Check folders permissions, I don't know where add messages go, but looks familiar to me.

chown -R prosody:prosody your/domain/folder/*

Check http://wiki.openwrt.org/doc/howto/xmpp.server?s[]=prosody#not.so.easy

BTW testing with Pidgin, there is a add message at bottom, so worksforme.

Oh, found it: They go to the pending group in the roster file. So is not a permission issue. Unless... Do you see the roster files created?

comment:10 Changed 4 years ago by anonymous

I can definitely say it's not a permission error.
Rosterfile from User A:

return {
	[false] = {
		["version"] = 31;
	};
	["UserB"] = {
		["ask"] = "subscribe";
		["groups"] = {
			["Testgroup"] = true;
		};
		["subscription"] = "none";
	};
}

But B never got a request to add A.
I discovered something new: The server uses the domain "testdomain". When I add "UserB@testdomain" I saw a client complaining that the server can not find a server with the hostname "testdomain". Perhaps I can add "127.0.0.1 testdomain" to the hosts-file so the server can find itself? I thought prosody was smart enough to recognize its own domain... Anyway, I will try that later.

About the 0.8.2 patch: Still the same as I wrote earlier in comment 2, still the exact same errors.

Thanks!

comment:11 in reply to: ↑ 2 Changed 4 years ago by Nilfred <nilfred@…>

Replying to anonymous:
I follow up refreshing also the patch:

cd ~/build/openwrt/attitude_adjustment/feeds/packages
svn diff
  • net/prosody/Makefile

     
    11# 
    2 # Copyright (C) 2009-2011 OpenWrt.org 
     2# Copyright (C) 2009-2012 OpenWrt.org 
    33# 
    44# This is free software, licensed under the GNU General Public License v2. 
    55# See /LICENSE for more information. 
     
    88include $(TOPDIR)/rules.mk 
    99 
    1010PKG_NAME:=prosody 
    11 PKG_VERSION:=0.6.2 
    12 PKG_RELEASE:=2 
     11PKG_VERSION:=0.8.2 
     12PKG_RELEASE:=1 
    1313 
    1414PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 
    1515PKG_SOURCE_URL:=http://prosody.im/downloads/source 
    16 PKG_MD5SUM:=5da59bc906419ad3b4faa21516a6ca18 
     16PKG_MD5SUM:=6e907bf0d0acf24f1011083020ba6ffb 
    1717 
    1818PKG_INSTALL:=1 
    1919 
  • net/prosody/patches/001-conf.patch

     
    11--- a/prosody.cfg.lua.dist 
    22+++ b/prosody.cfg.lua.dist 
    3 @@ -47,7 +47,7 @@ modules_enabled = { 
    4                 "register"; -- Allow users to register on this server using a client and change passwords 
    5          
     3@@ -59,7 +59,7 @@ modules_enabled = { 
     4                --"admin_telnet"; -- Opens telnet console interface on localhost port 5582 
     5  
    66        -- Other specific functionality 
    77-               --"posix"; -- POSIX functionality, sends server to background, enables syslog, etc. 
    88+               "posix"; -- POSIX functionality, sends server to background, enables syslog, etc. 
    9                 --"console"; -- Opens admin telnet interface on localhost port 5582 
    109                --"bosh"; -- Enable BOSH clients, aka "Jabber over HTTP" 
    1110                --"httpserver"; -- Serve static files from a directory over HTTP 
    12 @@ -65,6 +65,9 @@ modules_disabled = { 
    13  -- Disable account creation by default, for security 
     11                --"groups"; -- Shared roster support 
     12@@ -83,6 +83,9 @@ modules_disabled = { 
    1413 -- For more information see http://prosody.im/doc/creating_accounts 
    1514 allow_registration = false; 
    16 + 
     15  
    1716+-- File to write pid in 
    1817+pidfile = "/var/run/prosody/prosody.pid"; 
    19          
     18+        
    2019 -- These are the SSL/TLS-related settings. If you don't want 
    2120 -- to use SSL/TLS, you may comment or remove this 
    22 @@ -73,6 +76,15 @@ ssl = { 
    23         certificate = "certs/localhost.cert"; 
    24  } 
    25   
    26 +-- Errors to syslog 
    27 +-- All to /var/log/prosody/ 
    28 +log = { 
    29 +       { levels = { "error" }; to = "syslog";  }; 
     21 ssl = { 
     22@@ -123,10 +126,16 @@ 
     23 -- Logging configuration 
     24 -- For advanced logging see http://prosody.im/doc/logging 
     25 log = { 
     26-       info = "prosody.log"; -- Change 'info' to 'debug' for verbose logging 
     27-       error = "prosody.err"; 
     28+       -- info = "prosody.log"; -- Change 'info' to 'debug' for verbose logging 
     29+       -- error = "prosody.err"; 
     30        -- "*syslog"; -- Uncomment this for logging to syslog 
     31+       -- Requires mod_posix to be loaded 
     32        -- "*console"; -- Log to the console, useful for debugging with daemonize=false 
     33+       { levels = { "error" }; to = "syslog";  }; -- Errors to syslog 
     34+       -- All to /var/log/prosody/ 
    3035+       { levels = { "error" }; to = "file"; filename = "/var/log/prosody/prosody.err";  }; 
    3136+       -- Change "info" to "debug" for more verbose logging 
    3237+       { levels = { min = "info" }; to = "file"; filename = "/var/log/prosody/prosody.log";  }; 
    33 +} 
    34 + 
     38 } 
     39  
    3540 ----------- Virtual hosts ----------- 
    36  -- You need to add a VirtualHost entry for each domain you wish Prosody to serve. 
    37  -- Settings under each VirtualHost entry apply *only* to that host. 

RTFM then install compile dependencies

sudo apt-get -y install lua5.1 liblua5.1-dev libidn11-dev

Still no luck. So, asking prosody dev's they say:

Zash: The headers that would live in liblua5.1-dev are probably not found.
Zash: So, search paths for that
Zash: Nilfred: How did you run ./configure ?
Nilfred: Well the Makefile takes care of run ./configure, but the Makefile is for an older 0.6.2 version: https://dev.openwrt.org/browser/branches/packages_12.09/net/prosody/Makefile
Nilfred: The Makefile as been patched to download 0.8.2 instead and nothing else
Zash: But it sure sounded like some path was wrong
Nilfred: Well, about the path: What should I put to find the header: find . -name ...
Zash: 47 --with-lua="$(STAGING_DIR)/host/bin" \ 48 --with-lua-include="$(STAGING_DIR)/usr/include" \ 49 --with-lua-lib="$(STAGING_DIR)/usr/lib" \
Zash: Probably the include or lib one there.
waqas: Either you don't have lua headers available, or it's the wrong lua version
waqas: I wonder why the Makefile you linked is using -std=gnu99 instead of -ansi
waqas: Nilfred: I'm not entirely certain what the issue is. Perhaps gcc wants to link against liblua, but I thought only the interpreter needed that, and lua libraries did not...
waqas: Nilfred: Could this be relevant: http://hg.prosody.im/0.8/rev/73f078caf99d ?

Searching around:
I forgot to put extern "C" { } arround the lua headers. https://bbs.archlinux.org/viewtopic.php?id=141261

Searching OpenWrt:
r33707 lua: update to v5.1.5, refresh patches
r34022 libubox: add build dependency on lua
r34033 libubox: pass the lua path to cmake to avoid build errors

I still has no clue and have to get some sleep, but libubox ones looks promising.

comment:12 Changed 4 years ago by Nilfred <nilfred@…>

I got some progress reverting http://hg.prosody.im/0.8/rev/73f078caf99d
svn diff:

  • net/prosody/patches/001-conf.patch

     
    11--- a/prosody.cfg.lua.dist 
    22+++ b/prosody.cfg.lua.dist 
    3 @@ -47,7 +47,7 @@ modules_enabled = { 
    4                 "register"; -- Allow users to register on this server using a client and change passwords 
    5          
     3@@ -59,7 +59,7 @@ modules_enabled = { 
     4                --"admin_telnet"; -- Opens telnet console interface on localhost port 5582 
     5  
    66        -- Other specific functionality 
    77-               --"posix"; -- POSIX functionality, sends server to background, enables syslog, etc. 
    88+               "posix"; -- POSIX functionality, sends server to background, enables syslog, etc. 
    9                 --"console"; -- Opens admin telnet interface on localhost port 5582 
    109                --"bosh"; -- Enable BOSH clients, aka "Jabber over HTTP" 
    1110                --"httpserver"; -- Serve static files from a directory over HTTP 
    12 @@ -65,6 +65,9 @@ modules_disabled = { 
    13  -- Disable account creation by default, for security 
     11                --"groups"; -- Shared roster support 
     12@@ -83,6 +83,9 @@ modules_disabled = { 
    1413 -- For more information see http://prosody.im/doc/creating_accounts 
    1514 allow_registration = false; 
    16 + 
     15  
    1716+-- File to write pid in 
    1817+pidfile = "/var/run/prosody/prosody.pid"; 
    19          
     18+        
    2019 -- These are the SSL/TLS-related settings. If you don't want 
    2120 -- to use SSL/TLS, you may comment or remove this 
    22 @@ -73,6 +76,15 @@ ssl = { 
    23         certificate = "certs/localhost.cert"; 
    24  } 
    25   
    26 +-- Errors to syslog 
    27 +-- All to /var/log/prosody/ 
    28 +log = { 
    29 +       { levels = { "error" }; to = "syslog";  }; 
     21 ssl = { 
     22@@ -123,10 +126,16 @@ 
     23 -- Logging configuration 
     24 -- For advanced logging see http://prosody.im/doc/logging 
     25 log = { 
     26-       info = "prosody.log"; -- Change 'info' to 'debug' for verbose logging 
     27-       error = "prosody.err"; 
     28+       -- info = "prosody.log"; -- Change 'info' to 'debug' for verbose logging 
     29+       -- error = "prosody.err"; 
     30        -- "*syslog"; -- Uncomment this for logging to syslog 
     31+       -- Requires mod_posix to be loaded 
     32        -- "*console"; -- Log to the console, useful for debugging with daemonize=false 
     33+       { levels = { "error" }; to = "syslog";  }; -- Errors to syslog 
     34+       -- All to /var/log/prosody/ 
    3035+       { levels = { "error" }; to = "file"; filename = "/var/log/prosody/prosody.err";  }; 
    3136+       -- Change "info" to "debug" for more verbose logging 
    3237+       { levels = { min = "info" }; to = "file"; filename = "/var/log/prosody/prosody.log";  }; 
    33 +} 
    34 + 
     38 } 
     39  
    3540 ----------- Virtual hosts ----------- 
    36  -- You need to add a VirtualHost entry for each domain you wish Prosody to serve. 
    37  -- Settings under each VirtualHost entry apply *only* to that host. 
  • net/prosody/Makefile

     
    11# 
    2 # Copyright (C) 2009-2011 OpenWrt.org 
     2# Copyright (C) 2009-2012 OpenWrt.org 
    33# 
    44# This is free software, licensed under the GNU General Public License v2. 
    55# See /LICENSE for more information. 
     
    88include $(TOPDIR)/rules.mk 
    99 
    1010PKG_NAME:=prosody 
    11 PKG_VERSION:=0.6.2 
    12 PKG_RELEASE:=2 
     11PKG_VERSION:=0.8.2 
     12PKG_RELEASE:=1 
    1313 
    1414PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 
    1515PKG_SOURCE_URL:=http://prosody.im/downloads/source 
    16 PKG_MD5SUM:=5da59bc906419ad3b4faa21516a6ca18 
     16PKG_MD5SUM:=6e907bf0d0acf24f1011083020ba6ffb 
    1717 
    1818PKG_INSTALL:=1 
    1919 
     20PKG_BUILD_DEPENDS:=lua 
     21 
    2022include $(INCLUDE_DIR)/package.mk 
    2123 
    2224define Package/prosody 
     
    3941endef 
    4042 
    4143TARGET_CFLAGS += $(FPIC) 
     44CMAKE_OPTIONS = -DLUAPATH=/usr/lib/lua 
    4245 
    4346define Build/Configure 
    4447        # this is *NOT* GNU autoconf stuff 

svn status

?       net/prosody/patches/002-makefile.patch
M       net/prosody/patches/001-conf.patch
M       net/prosody/Makefile

002-makefile.patch

  • util-src/Makefile

    a b  
    1414 
    1515encodings.so: encodings.o 
    1616        MACOSX_DEPLOYMENT_TARGET="10.3"; export MACOSX_DEPLOYMENT_TARGET; 
    17         $(CC) -o $@ $< $(LDFLAGS) $(IDNA_LIBS) 
     17        # $(CC) -o $@ $< $(LDFLAGS) $(IDNA_LIBS) 
     18        $(LD) $(LDFLAGS) -o $@ $< -L$(LUA_LIBDIR) -llua$(LUA_SUFFIX) -lidn -lcrypto 
    1819 
    1920hashes.so: hashes.o 
    2021        MACOSX_DEPLOYMENT_TARGET="10.3"; export MACOSX_DEPLOYMENT_TARGET; 

Which leads to a different error:

make[3]: Entering directory `~/build/openwrt/attitude_adjustment/feeds/packages/net/prosody'
. ~/build/openwrt/attitude_adjustment/include/shell.sh; gzip -dc ~/build/openwrt/attitude_adjustment/dl/prosody-0.8.2.tar.gz | /bin/tar -C ~/build/openwrt/attitude_adjustment/build_dir/target-mips_r2_uClibc-0.9.33.2/prosody-0.8.2/.. -xf - 

Applying ./patches/001-conf.patch using plaintext: 
patching file prosody.cfg.lua.dist

Applying ./patches/002-makefile.patch using plaintext: 
patching file util-src/Makefile
touch ~/build/openwrt/attitude_adjustment/build_dir/target-mips_r2_uClibc-0.9.33.2/prosody-0.8.2/.prepared_08c25b6e560863b6b596721745d086bf
# this is *NOT* GNU autoconf stuff
(cd ~/build/openwrt/attitude_adjustment/build_dir/target-mips_r2_uClibc-0.9.33.2/prosody-0.8.2; ./configure --prefix=/usr --with-lua="~/build/openwrt/attitude_adjustment/staging_dir/target-mips_r2_uClibc-0.9.33.2/host/bin" --with-lua-include="~/build/openwrt/attitude_adjustment/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/include" --with-lua-lib="~/build/openwrt/attitude_adjustment/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/lib" --cflags="-Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -fpic" --datadir="/etc/prosody/data" )
Checking Lua includes... lua.h found in ~/build/openwrt/attitude_adjustment/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/include/lua.h
Writing configuration...

Installation prefix: /usr
Prosody configuration directory: /etc/prosody
Using Lua from: ~/build/openwrt/attitude_adjustment/staging_dir/target-mips_r2_uClibc-0.9.33.2/host/bin

Done. You can now run 'make' to build.

rm -f ~/build/openwrt/attitude_adjustment/build_dir/target-mips_r2_uClibc-0.9.33.2/prosody-0.8.2/.configured_*
touch ~/build/openwrt/attitude_adjustment/build_dir/target-mips_r2_uClibc-0.9.33.2/prosody-0.8.2/.configured_
CFLAGS="-Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -fpic  -I~/build/openwrt/attitude_adjustment/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/include -I~/build/openwrt/attitude_adjustment/staging_dir/target-mips_r2_uClibc-0.9.33.2/include -I~/build/openwrt/attitude_adjustment/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/usr/include -I~/build/openwrt/attitude_adjustment/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/include " CXXFLAGS="-Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -fpic  -I~/build/openwrt/attitude_adjustment/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/include -I~/build/openwrt/attitude_adjustment/staging_dir/target-mips_r2_uClibc-0.9.33.2/include -I~/build/openwrt/attitude_adjustment/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/usr/include -I~/build/openwrt/attitude_adjustment/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/include " LDFLAGS="-L~/build/openwrt/attitude_adjustment/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/lib -L~/build/openwrt/attitude_adjustment/staging_dir/target-mips_r2_uClibc-0.9.33.2/lib -L~/build/openwrt/attitude_adjustment/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/usr/lib -L~/build/openwrt/attitude_adjustment/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/lib " make -j1 -C ~/build/openwrt/attitude_adjustment/build_dir/target-mips_r2_uClibc-0.9.33.2/prosody-0.8.2/. AR=mips-openwrt-linux-uclibc-ar AS="mips-openwrt-linux-uclibc-gcc -c -Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -fpic" LD=mips-openwrt-linux-uclibc-ld NM=mips-openwrt-linux-uclibc-nm CC="mips-openwrt-linux-uclibc-gcc" GCC="mips-openwrt-linux-uclibc-gcc" CXX="mips-openwrt-linux-uclibc-g++" RANLIB=mips-openwrt-linux-uclibc-ranlib STRIP=mips-openwrt-linux-uclibc-strip OBJCOPY=mips-openwrt-linux-uclibc-objcopy OBJDUMP=mips-openwrt-linux-uclibc-objdump SIZE=mips-openwrt-linux-uclibc-size CROSS="mips-openwrt-linux-uclibc-" ARCH="mips" CFLAGS="-Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -fpic -I~/build/openwrt/attitude_adjustment/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/include -I~/build/openwrt/attitude_adjustment/staging_dir/target-mips_r2_uClibc-0.9.33.2/include -I~/build/openwrt/attitude_adjustment/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/usr/include -I~/build/openwrt/attitude_adjustment/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/include -std=gnu99" LDFLAGS="-L~/build/openwrt/attitude_adjustment/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/lib -L~/build/openwrt/attitude_adjustment/staging_dir/target-mips_r2_uClibc-0.9.33.2/lib -L~/build/openwrt/attitude_adjustment/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/usr/lib -L~/build/openwrt/attitude_adjustment/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/lib" PREFIX="/usr"  ;
make[4]: Entering directory `~/build/openwrt/attitude_adjustment/build_dir/target-mips_r2_uClibc-0.9.33.2/prosody-0.8.2'
sed "s|^CFG_SOURCEDIR=.*;$|CFG_SOURCEDIR='/usr/lib/prosody';|; \
		s|^CFG_CONFIGDIR=.*;$|CFG_CONFIGDIR='/etc/prosody';|; \
		s|^CFG_DATADIR=.*;$|CFG_DATADIR='/etc/prosody/data';|; \
		s|^CFG_PLUGINDIR=.*;$|CFG_PLUGINDIR='/usr/lib/prosody/modules/';|;" < prosody > prosody.install
sed "s|^CFG_SOURCEDIR=.*;$|CFG_SOURCEDIR='/usr/lib/prosody';|; \
		s|^CFG_CONFIGDIR=.*;$|CFG_CONFIGDIR='/etc/prosody';|; \
		s|^CFG_DATADIR=.*;$|CFG_DATADIR='/etc/prosody/data';|; \
		s|^CFG_PLUGINDIR=.*;$|CFG_PLUGINDIR='/usr/lib/prosody/modules/';|;" < prosodyctl > prosodyctl.install
sed 's|certs/|/etc/prosody/certs/|' prosody.cfg.lua.dist > prosody.cfg.lua.install
cp prosody.release prosody.version || true
make -C util-src install
make[5]: Entering directory `~/build/openwrt/attitude_adjustment/build_dir/target-mips_r2_uClibc-0.9.33.2/prosody-0.8.2/util-src'
mips-openwrt-linux-uclibc-gcc -Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -fpic -I~/build/openwrt/attitude_adjustment/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/include -I~/build/openwrt/attitude_adjustment/staging_dir/target-mips_r2_uClibc-0.9.33.2/include -I~/build/openwrt/attitude_adjustment/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/usr/include -I~/build/openwrt/attitude_adjustment/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/include -std=gnu99 -I~/build/openwrt/attitude_adjustment/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/include -c -o encodings.o encodings.c
MACOSX_DEPLOYMENT_TARGET="10.3"; export MACOSX_DEPLOYMENT_TARGET;
# mips-openwrt-linux-uclibc-gcc -o encodings.so encodings.o -L~/build/openwrt/attitude_adjustment/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/lib -L~/build/openwrt/attitude_adjustment/staging_dir/target-mips_r2_uClibc-0.9.33.2/lib -L~/build/openwrt/attitude_adjustment/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/usr/lib -L~/build/openwrt/attitude_adjustment/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/lib -lidn
mips-openwrt-linux-uclibc-ld -L~/build/openwrt/attitude_adjustment/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/lib -L~/build/openwrt/attitude_adjustment/staging_dir/target-mips_r2_uClibc-0.9.33.2/lib -L~/build/openwrt/attitude_adjustment/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/usr/lib -L~/build/openwrt/attitude_adjustment/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/lib -o encodings.so encodings.o -L~/build/openwrt/attitude_adjustment/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/lib -llua -lidn -lcrypto
mips-openwrt-linux-uclibc-ld: encodings.o: undefined reference to symbol 'strcpy'
mips-openwrt-linux-uclibc-ld: note: 'strcpy' is defined in DSO ~/build/openwrt/attitude_adjustment/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/bin/../../toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/lib/libc.so.0 so try adding it to the linker command line
~/build/openwrt/attitude_adjustment/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/bin/../../toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/lib/libc.so.0: could not read symbols: Invalid operation
make[5]: *** [encodings.so] Error 1
make[5]: Leaving directory `~/build/openwrt/attitude_adjustment/build_dir/target-mips_r2_uClibc-0.9.33.2/prosody-0.8.2/util-src'
make[4]: *** [all] Error 2
make[4]: Leaving directory `~/build/openwrt/attitude_adjustment/build_dir/target-mips_r2_uClibc-0.9.33.2/prosody-0.8.2'
make[3]: *** [~/build/openwrt/attitude_adjustment/build_dir/target-mips_r2_uClibc-0.9.33.2/prosody-0.8.2/.built] Error 2
make[3]: Leaving directory `~/build/openwrt/attitude_adjustment/feeds/packages/net/prosody'
make[2]: *** [package/feeds/packages/prosody/compile] Error 2
make[2]: Leaving directory `~/build/openwrt/attitude_adjustment'
make[1]: *** [~/build/openwrt/attitude_adjustment/staging_dir/target-mips_r2_uClibc-0.9.33.2/stamp/.package_compile] Error 2
make[1]: Leaving directory `~/build/openwrt/attitude_adjustment'
make: *** [world] Error 2

WTF? 'strcpy' is deprecated! I surrender...

comment:13 Changed 4 years ago by Nilfred <nilfred@…>

Me again, I didn't really surrender.
Culprit wasn't the deprecated function, but in a brief...
Finally got it compiling replacing with the old ./configure and the ./util-src/Makefile
002-makefile.patch:

  • configure

    a b  
    1111LUA_INCDIR="/usr/include" 
    1212LUA_LIBDIR="/usr/lib" 
    1313IDN_LIB=idn 
    14 ICU_FLAGS="-licui18n -licudata -licuuc" 
    1514OPENSSL_LIB=crypto 
    1615CC=gcc 
    17 CXX=g++ 
    1816LD=gcc 
    1917 
    2018CFLAGS="-fPIC -Wall" 
    21 LDFLAGS="-shared" 
    22  
    23 IDN_LIBRARY=idn 
     19LFLAGS="-shared" 
     20 
    2421# Help 
    2522 
    2623show_help() { 
     
    2926 
    3027--help                      This help. 
    3128--ostype=OS                 Use one of the OS presets. 
    32                             May be one of: debian, macosx, linux, freebsd 
     29                            May be one of: debian, macosx 
    3330--prefix=DIR                Prefix where Prosody should be installed. 
    3431                            Default is $PREFIX 
    3532--sysconfdir=DIR            Location where the config file should be installed. 
     
    4643                            Default is \$LUA_DIR/lib 
    4744--with-idn=LIB              The name of the IDN library to link with. 
    4845                            Default is $IDN_LIB 
    49 --idn-library=(idn|icu)          Select library to use for IDNA functionality. 
    50                                                                          idn: use GNU libidn (default) 
    51                                                                          icu: use ICU from IBM 
    5246--with-ssl=LIB              The name of the SSL to link with. 
    5347                            Default is $OPENSSL_LIB 
    5448--cflags=FLAGS              Flags to pass to the compiler 
    5549                            Default is $CFLAGS 
    56 --ldflags=FLAGS             Flags to pass to the linker 
    57                             Default is $LDFLAGS 
     50--lflags=FLAGS              Flags to pass to the linker 
     51                            Default is $LFLAGS 
    5852--c-compiler=CC             The C compiler to use when building modules. 
    5953                            Default is $CC 
    6054--linker=CC                 The linker to use when building modules. 
     
    6761 
    6862while [ "$1" ] 
    6963do 
    70    value="`echo $1 | sed 's/[^=]*=\(.*\)/\1/'`" 
     64   value="`echo $1 | sed 's/.*=\(.*\)/\1/'`" 
    7165   if echo "$value" | grep -q "~" 
    7266   then 
    7367      echo 
     
    9185   --ostype=*) 
    9286      OSTYPE="$value" 
    9387      OSTYPE_SET=yes 
    94       if [ "$OSTYPE" = "debian" ] 
    95       then LUA_SUFFIX="5.1"; 
     88      ;; 
     89   --datadir=*) 
     90        DATADIR="$value" 
     91        DATADIR_SET=yes 
     92      ;; 
     93   --require-config) 
     94      REQUIRE_CONFIG=yes 
     95      ;; 
     96   --lua-suffix=*) 
     97      LUA_SUFFIX="$value" 
     98      LUA_SUFFIX_SET=yes 
     99      ;; 
     100   --with-lua=*) 
     101      LUA_DIR="$value" 
     102      LUA_DIR_SET=yes 
     103      ;; 
     104   --with-lua-include=*) 
     105      LUA_INCDIR="$value" 
     106      LUA_INCDIR_SET=yes 
     107      ;; 
     108   --with-lua-lib=*) 
     109      LUA_LIBDIR="$value" LUA_LIBDIR_SET=yes 
     110      ;;       
     111   --with-idn=*) 
     112      IDN_LIB="$value" 
     113      ;;       
     114   --with-ssl=*) 
     115      OPENSSL_LIB="$value" 
     116      ;;       
     117   --cflags=*) 
     118      CFLAGS="$value" 
     119      ;;       
     120   --lflags=*) 
     121      LFLAGS="$value" 
     122      ;;       
     123   --c-compiler=*) 
     124      CC="$value" 
     125      ;;       
     126   --linker=*) 
     127      LD="$value" 
     128      ;;       
     129   *) 
     130      echo "Error: Unknown flag: $1" 
     131      exit 1 
     132      ;; 
     133   esac 
     134   shift 
     135done 
     136 
     137if [ "$OSTYPE_SET" = "yes" ] 
     138then 
     139        if [ "$OSTYPE" = "debian" ] 
     140        then LUA_SUFFIX="5.1"; 
    96141        LUA_SUFFIX_SET=yes 
    97142        LUA_INCDIR=/usr/include/lua5.1; 
    98143        LUA_INCDIR_SET=yes 
    99144        fi 
    100145        if [ "$OSTYPE" = "macosx" ] 
    101146        then LUA_INCDIR=/usr/local/include; 
    102         LUA_INCDIR_SET=yes 
     147        LUA_INCDIR_SET=yes       
    103148        LUA_LIBDIR=/usr/local/lib 
    104149        LUA_LIBDIR_SET=yes 
    105         LDFLAGS="-bundle -undefined dynamic_lookup" 
    106         fi 
    107         if [ "$OSTYPE" = "linux" ] 
    108         then LUA_INCDIR=/usr/local/include; 
    109         LUA_INCDIR_SET=yes 
    110         LUA_LIBDIR=/usr/local/lib 
    111         LUA_LIBDIR_SET=yes 
    112         CFLAGS="-Wall -fPIC" 
    113         LDFLAGS="-shared" 
    114         fi 
    115         if [ "$OSTYPE" = "freebsd" ] 
    116         then LUA_INCDIR="/usr/local/include/lua51" 
    117         LUA_INCDIR_SET=yes 
    118         CFLAGS="-Wall -fPIC -I/usr/local/include" 
    119         LDFLAGS="-I/usr/local/include -L/usr/local/lib -shared" 
    120         LUA_SUFFIX="-5.1" 
    121         LUA_SUFFIX_SET=yes 
    122         LUA_DIR=/usr/local 
    123         LUA_DIR_SET=yes 
    124         fi 
    125       ;; 
    126    --datadir=*) 
    127         DATADIR="$value" 
    128         DATADIR_SET=yes 
    129       ;; 
    130    --require-config) 
    131       REQUIRE_CONFIG=yes 
    132       ;; 
    133    --lua-suffix=*) 
    134       LUA_SUFFIX="$value" 
    135       LUA_SUFFIX_SET=yes 
    136       ;; 
    137    --with-lua=*) 
    138       LUA_DIR="$value" 
    139       LUA_DIR_SET=yes 
    140       ;; 
    141    --with-lua-include=*) 
    142       LUA_INCDIR="$value" 
    143       LUA_INCDIR_SET=yes 
    144       ;; 
    145    --with-lua-lib=*) 
    146       LUA_LIBDIR="$value" LUA_LIBDIR_SET=yes 
    147       ;; 
    148    --with-idn=*) 
    149       IDN_LIB="$value" 
    150       ;; 
    151         --idn-library=*) 
    152                 IDN_LIBRARY="$value" 
    153                 ;; 
    154    --with-ssl=*) 
    155       OPENSSL_LIB="$value" 
    156       ;; 
    157    --cflags=*) 
    158       CFLAGS="$value" 
    159       ;; 
    160    --ldflags=*) 
    161       LDFLAGS="$value" 
    162       ;; 
    163    --c-compiler=*) 
    164       CC="$value" 
    165       ;; 
    166    --linker=*) 
    167       LD="$value" 
    168       ;; 
    169    *) 
    170       echo "Error: Unknown flag: $1" 
    171       exit 1 
    172       ;; 
    173    esac 
    174    shift 
    175 done 
     150        CFLAGS="-Wall" 
     151        LFLAGS="-bundle -undefined dynamic_lookup" 
     152        fi       
     153fi 
    176154 
    177155if [ "$PREFIX_SET" = "yes" -a ! "$SYSCONFDIR_SET" = "yes" ] 
    178156then 
     
    269247   LUA_BINDIR="$LUA_DIR/bin" 
    270248fi 
    271249 
    272 if [ "$IDN_LIBRARY" = "icu" ] 
    273 then 
    274         IDNA_LIBS="$ICU_FLAGS" 
    275         CFLAGS="$CFLAGS -DUSE_STRINGPREP_ICU" 
    276 fi 
    277 if [ "$IDN_LIBRARY" = "idn" ]  
    278 then 
    279         IDNA_LIBS="-l$IDN_LIB" 
    280 fi 
    281  
    282250echo -n "Checking Lua includes... " 
    283251lua_h="$LUA_INCDIR/lua.h" 
    284252if [ -e "$lua_h" ] 
     
    329297LUA_BINDIR=$LUA_BINDIR 
    330298REQUIRE_CONFIG=$REQUIRE_CONFIG 
    331299IDN_LIB=$IDN_LIB 
    332 IDNA_LIBS=$IDNA_LIBS 
    333300OPENSSL_LIB=$OPENSSL_LIB 
    334301CFLAGS=$CFLAGS 
    335 LDFLAGS=$LDFLAGS 
     302LFLAGS=$LFLAGS 
    336303CC=$CC 
    337 CXX=$CXX 
    338304LD=$LD 
    339305 
    340306EOF 
  • util-src/Makefile

    a b  
    77IDN_LIB?=idn 
    88OPENSSL_LIB?=crypto 
    99CC?=gcc 
    10 CXX?=g++ 
    1110LD?=gcc 
    1211 
    13 .SUFFIXES: .c .o .so 
    14  
    15 encodings.so: encodings.o 
    16         MACOSX_DEPLOYMENT_TARGET="10.3"; export MACOSX_DEPLOYMENT_TARGET; 
    17         $(CC) -o $@ $< $(LDFLAGS) $(IDNA_LIBS) 
    18  
    19 hashes.so: hashes.o 
    20         MACOSX_DEPLOYMENT_TARGET="10.3"; export MACOSX_DEPLOYMENT_TARGET; 
    21         $(CC) -o $@ $< $(LDFLAGS) -l$(OPENSSL_LIB) 
    22  
    23 .c.o: 
    24         $(CC) $(CFLAGS) -I$(LUA_INCDIR) -c -o $@ $< 
    25  
    26 .o.so: 
    27         MACOSX_DEPLOYMENT_TARGET="10.3"; export MACOSX_DEPLOYMENT_TARGET; 
    28         $(LD) -o $@ $< $(LDFLAGS) 
    2912 
    3013all: encodings.so hashes.so pposix.so signal.so 
    3114 
    3215install: encodings.so hashes.so pposix.so signal.so 
    3316        install *.so ../util/ 
     17         
    3418 
    3519clean: 
    3620        rm -f *.o 
    3721        rm -f *.so 
    3822        rm -f ../util/*.so 
     23 
     24encodings.o: encodings.c 
     25        $(CC) $(CFLAGS) -I$(LUA_INCDIR) -c -o encodings.o encodings.c 
     26encodings.so: encodings.o 
     27        MACOSX_DEPLOYMENT_TARGET="10.3"; export MACOSX_DEPLOYMENT_TARGET; 
     28        $(LD) $(LFLAGS) -o encodings.so encodings.o -L$(LUA_LIBDIR) -llua$(LUA_SUFFIX) -lidn 
     29         
     30 
     31hashes.o: hashes.c 
     32        $(CC) $(CFLAGS) -I$(LUA_INCDIR) -c -o hashes.o hashes.c 
     33hashes.so: hashes.o 
     34        MACOSX_DEPLOYMENT_TARGET="10.3"; 
     35        export MACOSX_DEPLOYMENT_TARGET; 
     36        $(LD) $(LFLAGS) -o hashes.so hashes.o -L$(LUA_LIBDIR) -llua$(LUA_SUFFIX) -lcrypto 
     37 
     38pposix.o: pposix.c 
     39        $(CC) $(CFLAGS) -I$(LUA_INCDIR) -c -o pposix.o pposix.c 
     40pposix.so: pposix.o 
     41        MACOSX_DEPLOYMENT_TARGET="10.3"; 
     42        export MACOSX_DEPLOYMENT_TARGET; 
     43        $(LD) $(LFLAGS) -o pposix.so pposix.o -L$(LUA_LIBDIR) -llua$(LUA_SUFFIX) 
     44         
     45signal.o: signal.c 
     46        $(CC) $(CFLAGS) -I$(LUA_INCDIR) -c -o signal.o signal.c 
     47signal.so: signal.o 
     48        MACOSX_DEPLOYMENT_TARGET="10.3"; 
     49        export MACOSX_DEPLOYMENT_TARGET; 
     50        $(LD) $(LFLAGS) -o signal.so signal.o -L$(LUA_LIBDIR) -llua$(LUA_SUFFIX) 
     51         

This long patch did just that, reverting to the 0.6.2 versions an rename lsignal to signal.
There is another problem: Old OpenWrt Makefile left new files out during final install. Hope nothing important, at this stage I don't know what's important.
Hope this help you out.

comment:14 Changed 4 years ago by Nilfred <nilfred@…>

I created a reproducible and working stuff on the http://wiki.openwrt.org/doc/howto/xmpp.server#upgrade.to.prosody.0.8.2 to not flood here.
Better flood here: https://forum.openwrt.org/viewtopic.php?id=21643

Also reported upstream, you may have to star the issues to get updated:
http://code.google.com/p/lxmppd/issues/detail?id=319 (lack of maintainer)
http://code.google.com/p/lxmppd/issues/detail?id=320 (integer expected)
http://code.google.com/p/lxmppd/issues/detail?id=321 (does not compile)

comment:15 Changed 4 years ago by anonymous

Wow, Nilfred, I am amazed of how much work you put into this!

I applied the 0.8.2 patches from the wiki to trunk (manually, "patch" threw errors for some parts), compiled, installed, and so far everything worked right away. Then I tried to add another user in my XMPP client, aaand... now it works!! Awesome!!

Thanks a lot for your time and effort to get this working!! :)

comment:16 Changed 4 years ago by anonymous

Next problem (not OpenWRT related) is prosodys huge CPU consumption after a few hours runtime.
The third topic "Stability issues" on https://groups.google.com/group/prosody-users/browse_frm/month/2012-08 seems to be the same problem I have. Except that guy there has a lot of connections while I only handle 5 right now - with 100% CPU on my router.

Perhaps I should try alternatives like ejabberd or something. Doesn't look like the devs there care about prosody too much.

comment:17 Changed 4 years ago by anonymous

For now I fixed that 100%-CPU-problem by modifying prosodys init.d script to start it with a niceness of 19. By far not the best solution, but it works...

comment:18 Changed 4 years ago by anonymous

Update for the 100%-CPU-thing: Turns out it isn't a prosody bug, some bot which tries to crack some accounts causes the load.
Unfortunately prosody doesnt seem to log failed authentications in its logfile by default (or the attack avoided that somehow? i dont know), so I thought it was a prosody bug of some sort.

Easy work around: Change the default port to something else.

So yeah, thats it! Finally prosody is running without any more problems!
Thanks again to Nilfred for making the patches and the wiki page about the upgrade!

comment:19 Changed 4 years ago by Nilfred <nilfred@…>

http://code.google.com/p/lxmppd/issues/detail?id=318 (100% CPU)
https://code.google.com/p/prosody-modules/wiki/mod_limits (Prosody 0.9)
I didn't face the problem before, because my server is internal, thats means closed for external connections.
I take a different approach:
crond:

0,15,30,45 * * * * /etc/init.d/prosody ifhog

/etc/init.d/prosody

  • feeds/packages/net/prosody/files/prosody.init

    a b  
    33 
    44START=99 
    55 
    6 EXTRA_COMMANDS="status" 
    7 EXTRA_HELP="    status  Print the status of the service" 
     6EXTRA_COMMANDS="status ifhog" 
     7EXTRA_HELP="    status  Print the status of the service 
     8        ifhog   Restart the service if hog more than 50 % of CPU" 
    89 
    910BIN=/usr/bin/prosodyctl 
    1011LOG_D=/var/log/prosody 
     
    2526                chown prosody:prosody /var/log/prosody 
    2627        } 
    2728 
    28         $BIN start 
     29        nice -n 18 $BIN start 
    2930} 
    3031 
    3132stop() { 
     
    3940status() { 
    4041        $BIN status 
    4142} 
     43 
     44ifhog() { 
     45        cpuhog=$(top -b -n 1 | awk -v FS='% *' '/prosody/ {print $2;exit}') 
     46        [ $cpuhog -gt 50 ] && { 
     47                /usr/bin/logger -p daemon.crit -t prosody "Scheduled restart due to resource hog ($cpuhog % CPU)" 
     48                restart 
     49        } 
     50} 
     51 

I included your nice setting. Tell me if I understand right.
For the record: nice looks ugly in http://192.168.1.1/cgi-bin/luci/admin/status/processes/

comment:20 Changed 4 years ago by mwild1@…

Hi, we just released 0.9.0beta1: http://blog.prosody.im/prosody-0-9-0beta1-available-for-testing/

If you have time, would you look it over and let us know if there is anything we can do to help OpenWRT support for the final 0.9.0 release? (hopefully in a few weeks). Thanks!

comment:21 Changed 2 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.