Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 564434

Summary: net-im/prosody - init script should wait for database
Product: Gentoo Linux Reporter: Erich Seifert <eseifert>
Component: Current packagesAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: RESOLVED FIXED    
Severity: normal CC: zx2c4
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Erich Seifert 2015-10-29 15:40:23 UTC
When I use net-im/prosody-0.9.8 with PostgreSQL as a storage backend (USE flag postgres), prosody fails to start at boot time because it can't connect to the database.

Restarting prosody as soon as the database is running makes it work again.


Reproducible: Always

Steps to Reproduce:
1. # USE="postgresql" emerge net-im/prosody
2. # rc-update add prosody default
3. reboot

Actual Results:  
Oct 26 00:28:45 general info    Hello and welcome to Prosody version 0.9.8
Oct 26 00:28:46 general info    Prosody is using the select backend for connection handling
Oct 26 00:28:46 modulemanager   error   Error initializing module 'storage_sql' on 'muc.server.org': /usr/lib64/prosody/modules/mod_storage_sql.lua:172: Failed to connect to database: no connection 

stack traceback:
        /usr/lib64/prosody/core/modulemanager.lua:29: in function </usr/lib64/prosody/core/modulemanager.lua:29>
        [C]: in function 'assert'
        /usr/lib64/prosody/modules/mod_storage_sql.lua:172: in main chunk
        [C]: in function 'pcall'
        /usr/lib64/prosody/core/modulemanager.lua:171: in function 'do_load_module'
        /usr/lib64/prosody/core/modulemanager.lua:249: in function 'load'
        /usr/lib64/prosody/core/storagemanager.lua:54: in function 'load_driver'
        /usr/lib64/prosody/core/storagemanager.lua:74: in function 'get_driver'
        /usr/lib64/prosody/core/storagemanager.lua:84: in function 'open_store'
        /usr/lib64/prosody/modules/muc/mod_muc.lua:36: in main chunk
        [C]: in function 'pcall'
        /usr/lib64/prosody/core/modulemanager.lua:171: in function 'do_load_module'
        /usr/lib64/prosody/core/modulemanager.lua:249: in function 'load'
        /usr/lib64/prosody/core/modulemanager.lua:71: in function </usr/lib64/prosody/core/modulemanager.lua:46>
        /usr/lib64/prosody/util/events.lua:67: in function 'fire_event'
        /usr/lib64/prosody/core/hostmanager.lua:98: in function 'activate'
        /usr/lib64/prosody/core/hostmanager.lua:44: in function </usr/lib64/prosody/core/hostmanager.lua:35>
        /usr/lib64/prosody/util/events.lua:67: in function 'fire_event'
        /usr/lib64/prosody/../../bin/prosody:337: in function 'prepare_to_start'
        /usr/lib64/prosody/../../bin/prosody:403: in main chunk
        [C]: at 0x00404540
Oct 26 00:28:46 storagemanager  error   Failed to load storage driver plugin sql on muc.server.org: /usr/lib64/prosody/modules/mod_storage_sql.lua:172: Failed to connect to database: no connection to the server



# emerge -pv prosody

[ebuild   R    ] net-im/prosody-0.9.8::gentoo  USE="ipv6 jit libevent postgres ssl zlib -mysql -sqlite" 0 KiB
Comment 1 Conrad Kostecki gentoo-dev 2020-10-03 12:51:15 UTC
I will add "use postgresql" to the init script, os it will be automatically started before, if in the same runlevel, as "postgresql" is provided by the postgresql server init script.
Comment 2 Larry the Git Cow gentoo-dev 2020-10-03 13:43:46 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=672482e9799801839773c26a248ebe3fca6c6ef1

commit 672482e9799801839773c26a248ebe3fca6c6ef1
Author:     Conrad Kostecki <conikost@gentoo.org>
AuthorDate: 2020-10-03 13:23:08 +0000
Commit:     Conrad Kostecki <conikost@gentoo.org>
CommitDate: 2020-10-03 13:43:37 +0000

    net-im/prosody: bump to version 0.11.7
    
    Changes:
    Dropped useflag ipv6,
    since old non ipv6 dependency does not exist anymore.
    Renamed lua to luajit to use gentoos default.
    Added optional postgresql dependency to init script.
    Overhauled ebuild.
    Dropped multilib inherit, as it's not being used.
    Updated deps for correct luaexpat.
    
    Closes: https://bugs.gentoo.org/564434
    Closes: https://bugs.gentoo.org/674842
    Closes: https://bugs.gentoo.org/740662
    Package-Manager: Portage-3.0.8, Repoman-3.0.1
    Signed-off-by: Conrad Kostecki <conikost@gentoo.org>

 net-im/prosody/Manifest               |  1 +
 net-im/prosody/files/prosody.initd-r3 | 46 ++++++++++++++++++++
 net-im/prosody/prosody-0.11.7.ebuild  | 79 +++++++++++++++++++++++++++++++++++
 3 files changed, 126 insertions(+)