25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-26 17:38:45 +01:00

* src/ejabberd_rdbms.erl: fix SQL database reconnection

issues (EJAB-764) and add odbc_start_interval configuration
directive (default to 30 seconds).
* src/odbc/ejabberd_odbc.erl: likewise.
* src/odbc/ejabberd_odbc_sup.erl: likewise.
* doc/guide.tex: likewise.

SVN Revision: 1600
This commit is contained in:
Jérôme Sautret 2008-10-06 14:18:46 +00:00
parent a2340ea8b8
commit 2f8127d343
5 changed files with 229 additions and 193 deletions

View File

@ -1,3 +1,12 @@
2008-10-06 Jerome Sautret <jerome.sautret@process-one.net>
* src/ejabberd_rdbms.erl: fix SQL database reconnection
issues (EJAB-764) and add odbc_start_interval configuration
directive (default to 30 seconds).
* src/odbc/ejabberd_odbc.erl: likewise.
* src/odbc/ejabberd_odbc_sup.erl: likewise.
* doc/guide.tex: likewise.
2008-10-03 Jerome Sautret <jerome.sautret@process-one.net> 2008-10-03 Jerome Sautret <jerome.sautret@process-one.net>
* src/odbc/odbc_queries.erl: Fix empty query that fail on MySQL. * src/odbc/odbc_queries.erl: Fix empty query that fail on MySQL.

View File

@ -102,7 +102,7 @@
\include{contributed_modules} \include{contributed_modules}
%% Common options %% Common options
\newcommand{\iqdiscitem}[1]{\titem{iqdisc} \ind{options!iqdisc}This specifies \newcommand{\iqdiscitem}[1]{\titem{iqdisc} \ind{options!iqdisc}This specifies
the processing discipline for #1 IQ queries (see section~\ref{modiqdiscoption}).} the processing discipline for #1 IQ queries (see section~\ref{modiqdiscoption}).}
\newcommand{\hostitem}[1]{ \newcommand{\hostitem}[1]{
\titem{host} \ind{options!host} This option defines the Jabber ID of the \titem{host} \ind{options!host} This option defines the Jabber ID of the
@ -159,8 +159,8 @@ ejabberd Development Team
\newstyle{table[border="1"]}{border-collapse:collapse;margin-bottom:1em;} \newstyle{table[border="1"]}{border-collapse:collapse;margin-bottom:1em;}
\newstyle{table[border="1"] td}{border:1px solid \#aaa;padding:2px} \newstyle{table[border="1"] td}{border:1px solid \#aaa;padding:2px}
% Don't display <hr> before and after tables or images: % Don't display <hr> before and after tables or images:
\newstyle{BLOCKQUOTE.table DIV.center DIV.center HR}{display:none;} \newstyle{BLOCKQUOTE.table DIV.center DIV.center HR}{display:none;}
\newstyle{BLOCKQUOTE.figure DIV.center DIV.center HR}{display:none;} \newstyle{BLOCKQUOTE.figure DIV.center DIV.center HR}{display:none;}
%% Footnotes %% Footnotes
\begin{latexonly} \begin{latexonly}
@ -208,8 +208,8 @@ ejabberd Development Team
\makesection{install.binary}{Installing \ejabberd{} with Binary Installer} \makesection{install.binary}{Installing \ejabberd{} with Binary Installer}
Probably the easiest way to install an \ejabberd{} instant messaging server Probably the easiest way to install an \ejabberd{} instant messaging server
is using the binary installer published by ProcessOne. is using the binary installer published by ProcessOne.
The binary installers of released \ejabberd{} versions The binary installers of released \ejabberd{} versions
are available in the ProcessOne \ejabberd{} downloads page: are available in the ProcessOne \ejabberd{} downloads page:
\ahrefurl{http://www.process-one.net/en/ejabberd/downloads} \ahrefurl{http://www.process-one.net/en/ejabberd/downloads}
@ -227,17 +227,17 @@ or automatically by the operating system at system boot time.
To start and stop \ejabberd{} manually, To start and stop \ejabberd{} manually,
use the desktop shortcuts created by the installer. use the desktop shortcuts created by the installer.
If the machine doesn't have a graphical system, use the scripts 'start' If the machine doesn't have a graphical system, use the scripts 'start'
and 'stop' in the 'bin' directory where \ejabberd{} is installed. and 'stop' in the 'bin' directory where \ejabberd{} is installed.
The Windows installer also adds ejabberd as a system service, The Windows installer also adds ejabberd as a system service,
and a shortcut to a debug console for experienced administrators. and a shortcut to a debug console for experienced administrators.
If you want ejabberd to be started automatically at boot time, If you want ejabberd to be started automatically at boot time,
go to the Windows service settings and set ejabberd to be automatically started. go to the Windows service settings and set ejabberd to be automatically started.
Note that the Windows service is a feature still in development, Note that the Windows service is a feature still in development,
and for example it doesn't read the file ejabberdctl.cfg. and for example it doesn't read the file ejabberdctl.cfg.
On a *nix system, if you want ejabberd to be started as daemon at boot time, On a *nix system, if you want ejabberd to be started as daemon at boot time,
copy \term{ejabberd.init} from the 'bin' directory to something like \term{/etc/init.d/ejabberd} copy \term{ejabberd.init} from the 'bin' directory to something like \term{/etc/init.d/ejabberd}
(depending on your distribution) and call \term{/etc/inid.d/ejabberd start} to start it. (depending on your distribution) and call \term{/etc/inid.d/ejabberd start} to start it.
@ -263,9 +263,9 @@ and configurable options to fine tune the Erlang runtime system.
\makesection{install.os}{Installing \ejabberd{} with Operating System specific packages} \makesection{install.os}{Installing \ejabberd{} with Operating System specific packages}
Some Operating Systems provide a specific \ejabberd{} package adapted to Some Operating Systems provide a specific \ejabberd{} package adapted to
the system architecture and libraries. the system architecture and libraries.
It usually also checks dependencies It usually also checks dependencies
and performs basic configuration tasks like creating the initial and performs basic configuration tasks like creating the initial
administrator account. Some examples are Debian and Gentoo. Consult the administrator account. Some examples are Debian and Gentoo. Consult the
resources provided by your Operating System for more information. resources provided by your Operating System for more information.
@ -282,7 +282,7 @@ The binaries are available for many different system architectures, so this is a
alternative to the binary installer and Operating System's \ejabberd{} packages. alternative to the binary installer and Operating System's \ejabberd{} packages.
You will have to create your own \ejabberd{} start You will have to create your own \ejabberd{} start
script depending of how you handle your CEAN installation. script depending of how you handle your CEAN installation.
The default \term{ejabberdctl} script is located The default \term{ejabberdctl} script is located
into \ejabberd{}'s priv directory and can be used as an example. into \ejabberd{}'s priv directory and can be used as an example.
@ -290,7 +290,7 @@ into \ejabberd{}'s priv directory and can be used as an example.
\ind{install} \ind{install}
The canonical form for distribution of \ejabberd{} stable releases is the source code package. The canonical form for distribution of \ejabberd{} stable releases is the source code package.
Compiling \ejabberd{} from source code is quite easy in *nix systems, Compiling \ejabberd{} from source code is quite easy in *nix systems,
as long as your system have all the dependencies. as long as your system have all the dependencies.
\makesubsection{installreq}{Requirements} \makesubsection{installreq}{Requirements}
@ -337,12 +337,12 @@ To get the full list run the command:
Some options that you may be interested in modifying: Some options that you may be interested in modifying:
\begin{description} \begin{description}
\titem{--prefix=/} \titem{--prefix=/}
Specify the path prefix where the files will be copied when running Specify the path prefix where the files will be copied when running
the \term{make install} command. the \term{make install} command.
\titem{--enable-user[=USER]} \titem{--enable-user[=USER]}
Allow this normal system user to execute the ejabberdctl script Allow this normal system user to execute the ejabberdctl script
(see section~\ref{ejabberdctl}), (see section~\ref{ejabberdctl}),
read the configuration files, read the configuration files,
read and write in the spool directory, read and write in the spool directory,
@ -352,20 +352,20 @@ Some options that you may be interested in modifying:
This account doesn't need an explicit HOME directory, because This account doesn't need an explicit HOME directory, because
\term{/var/lib/ejabberd/} will be used by default. \term{/var/lib/ejabberd/} will be used by default.
\titem{--enable-pam} \titem{--enable-pam}
Enable the PAM authentication method (see section \ref{pam}). Enable the PAM authentication method (see section \ref{pam}).
\titem{--enable-odbc or --enable-mssql} \titem{--enable-odbc or --enable-mssql}
Required if you want to use an external database. Required if you want to use an external database.
See section~\ref{database} for more information. See section~\ref{database} for more information.
\titem{--enable-full-xml} \titem{--enable-full-xml}
Enable the use of XML based optimisations. Enable the use of XML based optimisations.
It will for example use CDATA to escape characters in the XMPP stream. It will for example use CDATA to escape characters in the XMPP stream.
Use this option only if you are sure your Jabber clients include a fully compliant XML parser. Use this option only if you are sure your Jabber clients include a fully compliant XML parser.
\titem{--disable-transient-supervisors} \titem{--disable-transient-supervisors}
Disable the use of Erlang/OTP supervision for transient processes. Disable the use of Erlang/OTP supervision for transient processes.
\end{description} \end{description}
@ -456,8 +456,8 @@ gmake
You need to have \term{GNU install}, You need to have \term{GNU install},
but it isn't included in Solaris. but it isn't included in Solaris.
It can be easily installed if your Solaris system It can be easily installed if your Solaris system
is set up for \footahref{http://www.blastwave.org/}{blastwave.org} is set up for \footahref{http://www.blastwave.org/}{blastwave.org}
package repository. package repository.
Make sure \term{/opt/csw/bin} is in your \term{PATH} and run: Make sure \term{/opt/csw/bin} is in your \term{PATH} and run:
\begin{verbatim} \begin{verbatim}
pkg-get -i fileutils pkg-get -i fileutils
@ -519,8 +519,8 @@ We assume that we will try to put as much library as possible into \verb|C:\sdk\
\verb|C:\sdk\GnuWin32\bin| to the \verb|PATH| environment \verb|C:\sdk\GnuWin32\bin| to the \verb|PATH| environment
variable. variable.
\item Install OpenSSL in \verb|C:\sdk\OpenSSL| and add \verb|C:\sdk\OpenSSL\lib\VC| to your path or copy the binaries to your system directory. \item Install OpenSSL in \verb|C:\sdk\OpenSSL| and add \verb|C:\sdk\OpenSSL\lib\VC| to your path or copy the binaries to your system directory.
\item Install ZLib in \verb|C:\sdk\gnuWin32|. Copy \item Install ZLib in \verb|C:\sdk\gnuWin32|. Copy
\verb|C:\sdk\GnuWin32\bin\zlib1.dll| to your system directory. If you change your path it should already be set after libiconv install. \verb|C:\sdk\GnuWin32\bin\zlib1.dll| to your system directory. If you change your path it should already be set after libiconv install.
\item Make sure the you can access Erlang binaries from your path. For example: \verb|set PATH=%PATH%;"C:\sdk\erl5.5.5\bin"| \item Make sure the you can access Erlang binaries from your path. For example: \verb|set PATH=%PATH%;"C:\sdk\erl5.5.5\bin"|
\item Depending on how you end up actually installing the library you might need to check and tweak the paths in the file configure.erl. \item Depending on how you end up actually installing the library you might need to check and tweak the paths in the file configure.erl.
\item While in the directory \verb|ejabberd\src| run: \item While in the directory \verb|ejabberd\src| run:
@ -542,20 +542,20 @@ werl -s ejabberd -name ejabberd
You need a Jabber account and grant him administrative privileges You need a Jabber account and grant him administrative privileges
to enter the \ejabberd{} Web Admin: to enter the \ejabberd{} Web Admin:
\begin{enumerate} \begin{enumerate}
\item Register a Jabber account on your \ejabberd{} server, for example \term{admin1@example.org}. \item Register a Jabber account on your \ejabberd{} server, for example \term{admin1@example.org}.
There are two ways to register a Jabber account: There are two ways to register a Jabber account:
\begin{enumerate} \begin{enumerate}
\item Using \term{ejabberdctl}\ind{ejabberdctl} (see section~\ref{ejabberdctl}): \item Using \term{ejabberdctl}\ind{ejabberdctl} (see section~\ref{ejabberdctl}):
\begin{verbatim} \begin{verbatim}
ejabberdctl register admin1 example.org FgT5bk3 ejabberdctl register admin1 example.org FgT5bk3
\end{verbatim} \end{verbatim}
\item Using a Jabber client and In-Band Registration (see section~\ref{modregister}). \item Using a Jabber client and In-Band Registration (see section~\ref{modregister}).
\end{enumerate} \end{enumerate}
\item Edit the \ejabberd{} configuration file to give administration rights to the Jabber account you created: \item Edit the \ejabberd{} configuration file to give administration rights to the Jabber account you created:
\begin{verbatim} \begin{verbatim}
{acl, admins, {user, "admin1", "example.org"}}. {acl, admins, {user, "admin1", "example.org"}}.
{access, configure, [{allow, admins}]}. {access, configure, [{allow, admins}]}.
\end{verbatim} \end{verbatim}
You can grant administrative privileges to many Jabber accounts, You can grant administrative privileges to many Jabber accounts,
and also to accounts in other Jabber servers. and also to accounts in other Jabber servers.
\item Restart \ejabberd{} to load the new configuration. \item Restart \ejabberd{} to load the new configuration.
@ -569,7 +569,7 @@ ejabberdctl register admin1 example.org FgT5bk3
To upgrade an ejabberd installation to a new version, To upgrade an ejabberd installation to a new version,
simply uninstall the old version, and then install the new one. simply uninstall the old version, and then install the new one.
Of course, it is important that the configuration file Of course, it is important that the configuration file
and Mnesia database spool directory are not removed. and Mnesia database spool directory are not removed.
\ejabberd{} automatically updates the Mnesia table definitions at startup when needed. \ejabberd{} automatically updates the Mnesia table definitions at startup when needed.
@ -586,9 +586,9 @@ indicates you need to also update those tables.
The configuration file will be loaded the first time you start \ejabberd{}. The The configuration file will be loaded the first time you start \ejabberd{}. The
content from this file will be parsed and stored in the internal \ejabberd{} database. Subsequently the content from this file will be parsed and stored in the internal \ejabberd{} database. Subsequently the
configuration will be loaded from the database and any commands in the configuration will be loaded from the database and any commands in the
configuration file are appended to the entries in the database. configuration file are appended to the entries in the database.
Note that \ejabberd{} never edits the configuration file. Note that \ejabberd{} never edits the configuration file.
So, the configuration changes done using the Web Admin So, the configuration changes done using the Web Admin
are stored in the database, but are not reflected in the configuration file. are stored in the database, but are not reflected in the configuration file.
If you want those changes to be use after \ejabberd{} restart, you can either If you want those changes to be use after \ejabberd{} restart, you can either
@ -675,7 +675,7 @@ Examples:
{ldap_password, ""}]}. {ldap_password, ""}]}.
\end{verbatim} \end{verbatim}
\end{itemize} \end{itemize}
To define specific ejabberd modules in a virtual host, To define specific ejabberd modules in a virtual host,
you can define the global \term{modules} option with the common modules, you can define the global \term{modules} option with the common modules,
and later add specific modules to certain virtual hosts. and later add specific modules to certain virtual hosts.
@ -740,7 +740,7 @@ tuple with the following elements:
\ind{modules!ejabberd\_c2s}\ind{modules!ejabberd\_s2s\_in}\ind{modules!ejabberd\_service}\ind{modules!ejabberd\_http}\ind{protocols!XEP-0114: Jabber Component Protocol} \ind{modules!ejabberd\_c2s}\ind{modules!ejabberd\_s2s\_in}\ind{modules!ejabberd\_service}\ind{modules!ejabberd\_http}\ind{protocols!XEP-0114: Jabber Component Protocol}
The available modules, their purpose and the options allowed by each one are: The available modules, their purpose and the options allowed by each one are:
\begin{description} \begin{description}
\titem{\texttt{ejabberd\_c2s}} \titem{\texttt{ejabberd\_c2s}}
Handles c2s connections.\\ Handles c2s connections.\\
Options: \texttt{access}, \texttt{certfile}, \texttt{inet6}, Options: \texttt{access}, \texttt{certfile}, \texttt{inet6},
\texttt{ip}, \texttt{max\_stanza\_size}, \texttt{shaper}, \texttt{ip}, \texttt{max\_stanza\_size}, \texttt{shaper},
@ -750,7 +750,7 @@ The available modules, their purpose and the options allowed by each one are:
Handles incoming s2s connections.\\ Handles incoming s2s connections.\\
Options: \texttt{inet6}, \texttt{ip}, \texttt{max\_stanza\_size} Options: \texttt{inet6}, \texttt{ip}, \texttt{max\_stanza\_size}
\titem{\texttt{ejabberd\_service}} \titem{\texttt{ejabberd\_service}}
Interacts with an \footahref{http://www.ejabberd.im/tutorials-transports}{external component} Interacts with an \footahref{http://www.ejabberd.im/tutorials-transports}{external component}
(as defined in the Jabber Component Protocol (\xepref{0114}).\\ (as defined in the Jabber Component Protocol (\xepref{0114}).\\
Options: \texttt{access}, \texttt{hosts}, \texttt{inet6}, Options: \texttt{access}, \texttt{hosts}, \texttt{inet6},
\texttt{ip}, \texttt{shaper}, \texttt{service\_check\_from} \texttt{ip}, \texttt{shaper}, \texttt{service\_check\_from}
@ -791,7 +791,7 @@ This is a detailed description of each option allowed by the listening modules:
\verb|http://server:port/http-bind/|. Be aware that support for HTTP Bind \verb|http://server:port/http-bind/|. Be aware that support for HTTP Bind
is also needed in the \Jabber{} client. Remark also that HTTP Bind can be is also needed in the \Jabber{} client. Remark also that HTTP Bind can be
interesting to host a web-based \Jabber{} client such as interesting to host a web-based \Jabber{} client such as
\footahref{http://jwchat.sourceforge.net/}{JWChat} \footahref{http://jwchat.sourceforge.net/}{JWChat}
(check the tutorials to install JWChat with ejabberd and an (check the tutorials to install JWChat with ejabberd and an
\footahref{http://www.ejabberd.im/jwchat-localserver}{embedded local web server} \footahref{http://www.ejabberd.im/jwchat-localserver}{embedded local web server}
or \footahref{http://www.ejabberd.im/jwchat-apache}{Apache}). or \footahref{http://www.ejabberd.im/jwchat-apache}{Apache}).
@ -807,7 +807,7 @@ This is a detailed description of each option allowed by the listening modules:
\footahref{http://jwchat.sourceforge.net/}{JWChat}. \footahref{http://jwchat.sourceforge.net/}{JWChat}.
\titem{inet6} \ind{options!inet6}\ind{IPv6}Set up the socket for IPv6 instead of IPv4. \titem{inet6} \ind{options!inet6}\ind{IPv6}Set up the socket for IPv6 instead of IPv4.
Note: this option is not required for S2S outgoing connections, Note: this option is not required for S2S outgoing connections,
because when ejabberd attempts to establish a S2S outgoing connection because when ejabberd attempts to establish a S2S outgoing connection
it first tries IPv4, and if that fails it attempts with IPv6. it first tries IPv4, and if that fails it attempts with IPv6.
\titem{\{ip, IPAddress\}} \ind{options!ip}This option specifies which network \titem{\{ip, IPAddress\}} \ind{options!ip}This option specifies which network
interface to listen for. For example \verb|{ip, {192, 168, 1, 1}}|. interface to listen for. For example \verb|{ip, {192, 168, 1, 1}}|.
@ -839,7 +839,7 @@ This is a detailed description of each option allowed by the listening modules:
You can define a certificate file for a specific domain using the global option \option{domain\_certfile}. You can define a certificate file for a specific domain using the global option \option{domain\_certfile}.
\titem{starttls\_required} \ind{options!starttls\_required}This option \titem{starttls\_required} \ind{options!starttls\_required}This option
specifies that STARTTLS encryption is required on connections to the port. specifies that STARTTLS encryption is required on connections to the port.
No unencrypted connections will be allowed. No unencrypted connections will be allowed.
You should also set the \option{certfile} option. You should also set the \option{certfile} option.
You can define a certificate file for a specific domain using the global option \option{domain\_certfile}. You can define a certificate file for a specific domain using the global option \option{domain\_certfile}.
\titem{tls} \ind{options!tls}\ind{TLS}This option specifies that traffic on \titem{tls} \ind{options!tls}\ind{TLS}This option specifies that traffic on
@ -872,7 +872,7 @@ There are some additional global options:
The default value is \term{allow}. The default value is \term{allow}.
\titem{\{\{s2s\_host, Host\}, allow|deny\}} \titem{\{\{s2s\_host, Host\}, allow|deny\}}
Defines if incoming and outgoing s2s connections with a specific remote host are allowed or denied. Defines if incoming and outgoing s2s connections with a specific remote host are allowed or denied.
This allows to restrict ejabberd to only establish s2s connections This allows to restrict ejabberd to only establish s2s connections
with a small list of trusted servers, or to block some specific servers. with a small list of trusted servers, or to block some specific servers.
\titem{\{s2s\_max\_retry\_delay, Seconds\}} \ind{options!s2s\_max\_retry\_delay} \titem{\{s2s\_max\_retry\_delay, Seconds\}} \ind{options!s2s\_max\_retry\_delay}
The maximum allowed delay for retry to connect after a failed connection attempt. The maximum allowed delay for retry to connect after a failed connection attempt.
@ -883,7 +883,7 @@ For example, the following simple configuration defines:
\begin{itemize} \begin{itemize}
\item There are three domains. The default certificate file is \term{server.pem}. \item There are three domains. The default certificate file is \term{server.pem}.
However, the c2s and s2s connections to the domain \term{example.com} use the file \term{example\_com.pem}. However, the c2s and s2s connections to the domain \term{example.com} use the file \term{example\_com.pem}.
\item Port 5222 listens for c2s connections with STARTTLS, \item Port 5222 listens for c2s connections with STARTTLS,
and also allows plain connections for old clients. and also allows plain connections for old clients.
\item Port 5223 listens for c2s connections with the old SSL. \item Port 5223 listens for c2s connections with the old SSL.
\item Port 5269 listens for s2s connections with STARTTLS. \item Port 5269 listens for s2s connections with STARTTLS.
@ -896,7 +896,7 @@ However, the c2s and s2s connections to the domain \term{example.com} use the fi
{listen, {listen,
[ [
{5222, ejabberd_c2s, [ {5222, ejabberd_c2s, [
{access, c2s}, {access, c2s},
{shaper, c2s_shaper}, {shaper, c2s_shaper},
starttls, {certfile, "/etc/ejabberd/server.pem"}, starttls, {certfile, "/etc/ejabberd/server.pem"},
{max_stanza_size, 65536} {max_stanza_size, 65536}
@ -936,7 +936,7 @@ In this example, the following configuration defines that:
\item Port 5280 is serving the Web Admin and the HTTP Polling service. Note \item Port 5280 is serving the Web Admin and the HTTP Polling service. Note
that it is also possible to serve them on different ports. The second that it is also possible to serve them on different ports. The second
example in section~\ref{webadmin} shows how exactly this can be done. example in section~\ref{webadmin} shows how exactly this can be done.
\item All users except for the administrators have a traffic of limit \item All users except for the administrators have a traffic of limit
1,000\,Bytes/second 1,000\,Bytes/second
\item \ind{transports!AIM}The \item \ind{transports!AIM}The
\footahref{http://www.ejabberd.im/pyaimt}{AIM transport} \footahref{http://www.ejabberd.im/pyaimt}{AIM transport}
@ -1380,7 +1380,7 @@ following syntax:
\end{verbatim} \end{verbatim}
where \term{<rate>} stands for the maximum allowed incoming rate in bytes per where \term{<rate>} stands for the maximum allowed incoming rate in bytes per
second. second.
When a connection exceeds this limit, \ejabberd{} stops reading from the socket When a connection exceeds this limit, \ejabberd{} stops reading from the socket
until the average rate is again below the allowed maximum. until the average rate is again below the allowed maximum.
Examples: Examples:
@ -1462,7 +1462,7 @@ The file is in a subdirectory from where the main configuration file is.
{include_config_file, "./example.org/additional_not_listen.cfg", [{disallow, [listen]}]}. {include_config_file, "./example.org/additional_not_listen.cfg", [{disallow, [listen]}]}.
\end{verbatim} \end{verbatim}
In this example, \term{ejabberd.cfg} defines some ACL and Access rules, In this example, \term{ejabberd.cfg} defines some ACL and Access rules,
and later includes another file with additional rules: and later includes another file with additional rules:
\begin{verbatim} \begin{verbatim}
{acl, admin, {user, "admin", "localhost"}}. {acl, admin, {user, "admin", "localhost"}}.
@ -1609,14 +1609,21 @@ Use this option to modify the value:
{odbc_pool_size, 10}. {odbc_pool_size, 10}.
\end{verbatim} \end{verbatim}
You can configure an interval to make a dummy SQL request You can configure an interval to make a dummy SQL request
to keep alive the connections to the database. to keep alive the connections to the database.
The default value is 'undefined', so no keepalive requests are made. The default value is 'undefined', so no keepalive requests are made.
Specify in seconds: for example 28800 means 8 hours. Specify in seconds: for example 28800 means 8 hours.
\begin{verbatim} \begin{verbatim}
{odbc_keepalive_interval, undefined}. {odbc_keepalive_interval, undefined}.
\end{verbatim} \end{verbatim}
If the connection to the database fails, \ejabberd{} waits 30 seconds before retrying.
You can modify this interval with this option:
\begin{verbatim}
{odbc_start_interval, 30}.
\end{verbatim}
\makesubsubsection{compilemysql}{Driver Compilation} \makesubsubsection{compilemysql}{Driver Compilation}
\ind{MySQL!Driver Compilation} \ind{MySQL!Driver Compilation}
@ -1706,9 +1713,9 @@ Use this option to modify the value:
{odbc_pool_size, 10}. {odbc_pool_size, 10}.
\end{verbatim} \end{verbatim}
You can configure an interval to make a dummy SQL request You can configure an interval to make a dummy SQL request
to keep alive the connections to the database. to keep alive the connections to the database.
The default value is 'undefined', so no keepalive requests are made. The default value is 'undefined', so no keepalive requests are made.
Specify in seconds: for example 28800 means 8 hours. Specify in seconds: for example 28800 means 8 hours.
\begin{verbatim} \begin{verbatim}
{odbc_keepalive_interval, undefined}. {odbc_keepalive_interval, undefined}.
@ -1766,9 +1773,9 @@ Use this option to modify the value:
{odbc_pool_size, 10}. {odbc_pool_size, 10}.
\end{verbatim} \end{verbatim}
You can configure an interval to make a dummy SQL request You can configure an interval to make a dummy SQL request
to keep alive the connections to the database. to keep alive the connections to the database.
The default value is 'undefined', so no keepalive requests are made. The default value is 'undefined', so no keepalive requests are made.
Specify in seconds: for example 28800 means 8 hours. Specify in seconds: for example 28800 means 8 hours.
\begin{verbatim} \begin{verbatim}
{odbc_keepalive_interval, undefined}. {odbc_keepalive_interval, undefined}.
@ -1783,7 +1790,7 @@ PostgreSQL.
\begin{enumerate} \begin{enumerate}
\item First, install the Erlang pgsql library from \item First, install the Erlang pgsql library from
\footahref{http://www.ejabberd.im/ejabberd-modules/}{ejabberd-modules SVN repository}. \footahref{http://www.ejabberd.im/ejabberd-modules/}{ejabberd-modules SVN repository}.
Make sure the compiled Make sure the compiled
files are in your Erlang path; you can put them for example in the same files are in your Erlang path; you can put them for example in the same
directory as your \ejabberd{} .beam files. directory as your \ejabberd{} .beam files.
@ -1860,9 +1867,9 @@ Use this option to modify the value:
{odbc_pool_size, 10}. {odbc_pool_size, 10}.
\end{verbatim} \end{verbatim}
You can configure an interval to make a dummy SQL request You can configure an interval to make a dummy SQL request
to keep alive the connections to the database. to keep alive the connections to the database.
The default value is 'undefined', so no keepalive requests are made. The default value is 'undefined', so no keepalive requests are made.
Specify in seconds: for example 28800 means 8 hours. Specify in seconds: for example 28800 means 8 hours.
\begin{verbatim} \begin{verbatim}
{odbc_keepalive_interval, undefined}. {odbc_keepalive_interval, undefined}.
@ -1924,7 +1931,7 @@ server and use LDAP directory as vCard storage. Shared rosters are not supported
yet. yet.
Note that \ejabberd{} treats LDAP as a read-only storage: Note that \ejabberd{} treats LDAP as a read-only storage:
it is possible to consult data, but not possible to it is possible to consult data, but not possible to
create accounts, change password or edit vCard that is stored in LDAP. create accounts, change password or edit vCard that is stored in LDAP.
@ -1935,10 +1942,10 @@ Parameters:
\titem{ldap\_servers} \ind{options!ldap\_server}List of IP addresses or DNS names of your \titem{ldap\_servers} \ind{options!ldap\_server}List of IP addresses or DNS names of your
LDAP servers. This option is required. LDAP servers. This option is required.
\titem{ldap\_port} \ind{options!ldap\_port}Port to connect to your LDAP server. \titem{ldap\_port} \ind{options!ldap\_port}Port to connect to your LDAP server.
The initial default value is~389, so it is used when nothing is set into the The initial default value is~389, so it is used when nothing is set into the
configuration file. configuration file.
If you configure a value, it is stored in \ejabberd{}'s database. If you configure a value, it is stored in \ejabberd{}'s database.
Then, if you remove that value from the configuration file, Then, if you remove that value from the configuration file,
the value previously stored in the database will be used instead of the default 389. the value previously stored in the database will be used instead of the default 389.
\titem{ldap\_rootdn} \ind{options!ldap\_rootdn}Bind DN. The default value \titem{ldap\_rootdn} \ind{options!ldap\_rootdn}Bind DN. The default value
is~\term{""} which means `anonymous connection'. is~\term{""} which means `anonymous connection'.
@ -2181,38 +2188,38 @@ The following table lists all modules included in \ejabberd{}.
\begin{table}[H] \begin{table}[H]
\centering \centering
\begin{tabular}{|l|l|l|} \begin{tabular}{|l|l|l|}
\hline {\bf Module} & {\bf Feature} & {\bf Dependencies} \\ \hline {\bf Module} & {\bf Feature} & {\bf Dependencies} \\
\hline \hline
\hline \modadhoc{} & Ad-Hoc Commands (\xepref{0050}) & \\ \hline \modadhoc{} & Ad-Hoc Commands (\xepref{0050}) & \\
\hline \ahrefloc{modannounce}{\modannounce{}} & Manage announcements & recommends \modadhoc{} \\ \hline \ahrefloc{modannounce}{\modannounce{}} & Manage announcements & recommends \modadhoc{} \\
\hline \modcaps{} & Entity Capabilities (\xepref{0115}) & \\ \hline \modcaps{} & Entity Capabilities (\xepref{0115}) & \\
\hline \modconfigure{} & Server configuration using Ad-Hoc & \modadhoc{} \\ \hline \modconfigure{} & Server configuration using Ad-Hoc & \modadhoc{} \\
\hline \ahrefloc{moddisco}{\moddisco{}} & Service Discovery (\xepref{0030}) & \\ \hline \ahrefloc{moddisco}{\moddisco{}} & Service Discovery (\xepref{0030}) & \\
\hline \ahrefloc{modecho}{\modecho{}} & Echoes Jabber packets & \\ \hline \ahrefloc{modecho}{\modecho{}} & Echoes Jabber packets & \\
\hline \ahrefloc{modirc}{\modirc{}} & IRC transport & \\ \hline \ahrefloc{modirc}{\modirc{}} & IRC transport & \\
\hline \ahrefloc{modlast}{\modlast{}} & Last Activity (\xepref{0012}) & \\ \hline \ahrefloc{modlast}{\modlast{}} & Last Activity (\xepref{0012}) & \\
\hline \ahrefloc{modlast}{\modlastodbc{}} & Last Activity (\xepref{0012}) & supported DB (*) \\ \hline \ahrefloc{modlast}{\modlastodbc{}} & Last Activity (\xepref{0012}) & supported DB (*) \\
\hline \ahrefloc{modmuc}{\modmuc{}} & Multi-User Chat (\xepref{0045}) & \\ \hline \ahrefloc{modmuc}{\modmuc{}} & Multi-User Chat (\xepref{0045}) & \\
\hline \ahrefloc{modmuclog}{\modmuclog{}} & Multi-User Chat room logging & \modmuc{} \\ \hline \ahrefloc{modmuclog}{\modmuclog{}} & Multi-User Chat room logging & \modmuc{} \\
\hline \ahrefloc{modoffline}{\modoffline{}} & Offline message storage (\xepref{0160}) & \\ \hline \ahrefloc{modoffline}{\modoffline{}} & Offline message storage (\xepref{0160}) & \\
\hline \ahrefloc{modoffline}{\modofflineodbc{}} & Offline message storage (\xepref{0160}) & supported DB (*) \\ \hline \ahrefloc{modoffline}{\modofflineodbc{}} & Offline message storage (\xepref{0160}) & supported DB (*) \\
\hline \ahrefloc{modprivacy}{\modprivacy{}} & Blocking Communication (XMPP IM) & \\ \hline \ahrefloc{modprivacy}{\modprivacy{}} & Blocking Communication (XMPP IM) & \\
\hline \ahrefloc{modprivacy}{\modprivacyodbc{}} & Blocking Communication (XMPP IM) & supported DB (*) \\ \hline \ahrefloc{modprivacy}{\modprivacyodbc{}} & Blocking Communication (XMPP IM) & supported DB (*) \\
\hline \ahrefloc{modprivate}{\modprivate{}} & Private XML Storage (\xepref{0049}) & \\ \hline \ahrefloc{modprivate}{\modprivate{}} & Private XML Storage (\xepref{0049}) & \\
\hline \ahrefloc{modprivate}{\modprivateodbc{}} & Private XML Storage (\xepref{0049}) & supported DB (*) \\ \hline \ahrefloc{modprivate}{\modprivateodbc{}} & Private XML Storage (\xepref{0049}) & supported DB (*) \\
\hline \ahrefloc{modproxy}{\modproxy{}} & SOCKS5 Bytestreams (\xepref{0065}) & \\ \hline \ahrefloc{modproxy}{\modproxy{}} & SOCKS5 Bytestreams (\xepref{0065}) & \\
\hline \ahrefloc{modpubsub}{\modpubsub{}} & Pub-Sub (\xepref{0060}), PEP (\xepref{0163}) & \modcaps{} \\ \hline \ahrefloc{modpubsub}{\modpubsub{}} & Pub-Sub (\xepref{0060}), PEP (\xepref{0163}) & \modcaps{} \\
\hline \ahrefloc{modregister}{\modregister{}} & In-Band Registration (\xepref{0077}) & \\ \hline \ahrefloc{modregister}{\modregister{}} & In-Band Registration (\xepref{0077}) & \\
\hline \ahrefloc{modroster}{\modroster{}} & Roster management (XMPP IM) & \\ \hline \ahrefloc{modroster}{\modroster{}} & Roster management (XMPP IM) & \\
\hline \ahrefloc{modroster}{\modrosterodbc{}} & Roster management (XMPP IM) & supported DB (*) \\ \hline \ahrefloc{modroster}{\modrosterodbc{}} & Roster management (XMPP IM) & supported DB (*) \\
\hline \ahrefloc{modservicelog}{\modservicelog{}} & Copy user messages to logger service & \\ \hline \ahrefloc{modservicelog}{\modservicelog{}} & Copy user messages to logger service & \\
\hline \ahrefloc{modsharedroster}{\modsharedroster{}} & Shared roster management & \modroster{} or \\ \hline \ahrefloc{modsharedroster}{\modsharedroster{}} & Shared roster management & \modroster{} or \\
& & \modrosterodbc\\ & & \modrosterodbc\\
\hline \ahrefloc{modstats}{\modstats{}} & Statistics Gathering (\xepref{0039}) & \\ \hline \ahrefloc{modstats}{\modstats{}} & Statistics Gathering (\xepref{0039}) & \\
\hline \ahrefloc{modtime}{\modtime{}} & Entity Time (\xepref{0090}) & \\ \hline \ahrefloc{modtime}{\modtime{}} & Entity Time (\xepref{0090}) & \\
\hline \ahrefloc{modvcard}{\modvcard{}} & vcard-temp (\xepref{0054}) & \\ \hline \ahrefloc{modvcard}{\modvcard{}} & vcard-temp (\xepref{0054}) & \\
\hline \ahrefloc{modvcardldap}{\modvcardldap{}} & vcard-temp (\xepref{0054}) & LDAP server \\ \hline \ahrefloc{modvcardldap}{\modvcardldap{}} & vcard-temp (\xepref{0054}) & LDAP server \\
\hline \ahrefloc{modvcard}{\modvcardodbc{}} & vcard-temp (\xepref{0054}) & supported DB (*) \\ \hline \ahrefloc{modvcard}{\modvcardodbc{}} & vcard-temp (\xepref{0054}) & supported DB (*) \\
\hline \ahrefloc{modversion}{\modversion{}} & Software Version (\xepref{0092}) & \\ \hline \ahrefloc{modversion}{\modversion{}} & Software Version (\xepref{0092}) & \\
\hline \hline
\end{tabular} \end{tabular}
@ -2303,7 +2310,7 @@ This option defines the Jabber ID of a service provided by an \ejabberd{} module
The keyword "@HOST@" is replaced at start time with the real virtual host string. The keyword "@HOST@" is replaced at start time with the real virtual host string.
This example configures This example configures
the \ind{modules!\modecho{}}echo module to provide its echoing service the \ind{modules!\modecho{}}echo module to provide its echoing service
in the Jabber ID \jid{mirror.example.org}: in the Jabber ID \jid{mirror.example.org}:
\begin{verbatim} \begin{verbatim}
{modules, {modules,
@ -2329,7 +2336,7 @@ the "@HOST@" keyword must be used:
\ind{modules!\modannounce{}}\ind{MOTD}\ind{message of the day}\ind{announcements} \ind{modules!\modannounce{}}\ind{MOTD}\ind{message of the day}\ind{announcements}
This module enables configured users to broadcast announcements and to set This module enables configured users to broadcast announcements and to set
the message of the day (MOTD). the message of the day (MOTD).
Configured users can perform these actions with a Configured users can perform these actions with a
\Jabber{} client either using Ad-hoc commands \Jabber{} client either using Ad-hoc commands
or sending messages to specific JIDs. or sending messages to specific JIDs.
@ -2587,7 +2594,7 @@ Some of the features of Multi-User Chat:
The MUC service allows any Jabber ID to register a nickname, The MUC service allows any Jabber ID to register a nickname,
so nobody else can use that nickname in any room in the MUC service. so nobody else can use that nickname in any room in the MUC service.
To register a nickname, open the Service Discovery in your To register a nickname, open the Service Discovery in your
Jabber client and register in the MUC service. Jabber client and register in the MUC service.
This module supports clustering and load This module supports clustering and load
@ -2665,7 +2672,7 @@ Module options:
discarded. A good value for this option is 4 seconds. discarded. A good value for this option is 4 seconds.
\titem{default\_room\_options} \ind{options!default\_room\_options} \titem{default\_room\_options} \ind{options!default\_room\_options}
This module option allows to define the desired default room options. This module option allows to define the desired default room options.
Note that the creator of a room can modify the options of his room Note that the creator of a room can modify the options of his room
at any time using a Jabber client with MUC capability. at any time using a Jabber client with MUC capability.
The available room options and the default values are: The available room options and the default values are:
\begin{description} \begin{description}
@ -2861,7 +2868,7 @@ Options:
To prevent spam, the \term{spam\_prevention} option adds a special attribute To prevent spam, the \term{spam\_prevention} option adds a special attribute
to links that prevent their indexation by search engines. The default value to links that prevent their indexation by search engines. The default value
is \term{true}, which mean that nofollow attributes will be added to user is \term{true}, which mean that nofollow attributes will be added to user
submitted links. submitted links.
\titem{timezone}\ind{options!timezone} \titem{timezone}\ind{options!timezone}
The time zone for the logs is configurable with this option. Allowed values The time zone for the logs is configurable with this option. Allowed values
are \term{local} and \term{universal}. With the first value, the local time, are \term{local} and \term{universal}. With the first value, the local time,
@ -3078,7 +3085,7 @@ Options:
pubsub plugin is always used. pubsub plugin is always used.
\titem{nodetree} To specify which nodetree to use. If not defined, the default pubsub \titem{nodetree} To specify which nodetree to use. If not defined, the default pubsub
nodetree is used. Nodetrees are default and virtual. Only one nodetree can be used nodetree is used. Nodetrees are default and virtual. Only one nodetree can be used
and is shared by all node plugins. and is shared by all node plugins.
%\titem{served\_hosts} \ind{options!served\_hosts} %\titem{served\_hosts} \ind{options!served\_hosts}
% This option allows to create additional pubsub virtual hosts in a single module instance. % This option allows to create additional pubsub virtual hosts in a single module instance.
\end{description} \end{description}
@ -3116,10 +3123,10 @@ Options:
user name, registration for that user name is denied. (there are no user name, registration for that user name is denied. (there are no
restrictions by default). restrictions by default).
\titem{welcome\_message} \ind{options!welcomem}Set a welcome message that \titem{welcome\_message} \ind{options!welcomem}Set a welcome message that
is sent to each newly registered account. The first string is the subject, and is sent to each newly registered account. The first string is the subject, and
the second string is the message body. the second string is the message body.
In the body you can set a newline with the characters: \verb|\n| In the body you can set a newline with the characters: \verb|\n|
\titem{registration\_watchers} \ind{options!rwatchers}This option defines a \titem{registration\_watchers} \ind{options!rwatchers}This option defines a
list of JIDs which will be notified each time a new account is registered. list of JIDs which will be notified each time a new account is registered.
\iqdiscitem{In-Band Registration (\ns{jabber:iq:register})} \iqdiscitem{In-Band Registration (\ns{jabber:iq:register})}
\end{description} \end{description}
@ -3223,7 +3230,7 @@ Examples:
]}. ]}.
\end{verbatim} \end{verbatim}
\item To log all end user packets to the Bandersnatch service running on \item To log all end user packets to the Bandersnatch service running on
\jid{bandersnatch.example.com} and the backup service on \jid{bandersnatch.example.com} and the backup service on
\jid{bandersnatch.example.org}: \jid{bandersnatch.example.org}:
\begin{verbatim} \begin{verbatim}
{modules, {modules,
@ -3243,9 +3250,9 @@ This module enables you to create shared roster groups. This means that you can
create groups of people that can see members from (other) groups in their create groups of people that can see members from (other) groups in their
rosters. The big advantages of this feature are that end users do not need to rosters. The big advantages of this feature are that end users do not need to
manually add all users to their rosters, and that they cannot permanently delete manually add all users to their rosters, and that they cannot permanently delete
users from the shared roster groups. users from the shared roster groups.
A shared roster group can have members from any Jabber server, A shared roster group can have members from any Jabber server,
but the presence will only be available from and to members but the presence will only be available from and to members
of the same virtual host where the group is created. of the same virtual host where the group is created.
Shared roster groups can be edited \emph{only} via the Web Admin. Each group Shared roster groups can be edited \emph{only} via the Web Admin. Each group
@ -3467,7 +3474,7 @@ implemented in the \modvcardldap{} module. This module does not depend on the
authentication method (see~\ref{ldapauth}). authentication method (see~\ref{ldapauth}).
Note that \ejabberd{} treats LDAP as a read-only storage: Note that \ejabberd{} treats LDAP as a read-only storage:
it is possible to consult data, but not possible to it is possible to consult data, but not possible to
create accounts, change password or edit vCard that is stored in LDAP. create accounts, change password or edit vCard that is stored in LDAP.
The \modvcardldap{} module has The \modvcardldap{} module has
@ -3571,7 +3578,7 @@ consists of the following \modvcardldap{}-specific options:
%TODO: this examples still should be organised better %TODO: this examples still should be organised better
Examples: Examples:
\begin{itemize} \begin{itemize}
\item \item
Let's say \term{ldap.example.org} is the name of our LDAP server. We have Let's say \term{ldap.example.org} is the name of our LDAP server. We have
users with their passwords in \term{"ou=Users,dc=example,dc=org"} directory. users with their passwords in \term{"ou=Users,dc=example,dc=org"} directory.
@ -3689,11 +3696,11 @@ Options:
\makesubsection{commands}{Commands} \makesubsection{commands}{Commands}
The \term{ejabberdctl} command line administration script allows to start, stop and perform The \term{ejabberdctl} command line administration script allows to start, stop and perform
many other administrative tasks in a local or remote \ejabberd{} server. many other administrative tasks in a local or remote \ejabberd{} server.
When \term{ejabberdctl} is executed without any parameter, When \term{ejabberdctl} is executed without any parameter,
it displays the available options. If there isn't an \ejabberd{} server running, it displays the available options. If there isn't an \ejabberd{} server running,
the available parameters are: the available parameters are:
\begin{description} \begin{description}
\titem{start} Start \ejabberd{} in background mode. This is the default method. \titem{start} Start \ejabberd{} in background mode. This is the default method.
@ -3710,7 +3717,7 @@ The more interesting ones are:
\titem{reopen-log} If you use a tool to rotate logs, you have to configure it \titem{reopen-log} If you use a tool to rotate logs, you have to configure it
so that this command is executed after each rotation. so that this command is executed after each rotation.
\titem {backup, restore, install-fallback, dump, load} You can use these \titem {backup, restore, install-fallback, dump, load} You can use these
commands to create and restore backups. commands to create and restore backups.
%%More information about backuping can %%More information about backuping can
%% be found in section~\ref{backup}. %% be found in section~\ref{backup}.
\titem{import-file, import-dir} \ind{migration from other software} \titem{import-file, import-dir} \ind{migration from other software}
@ -3741,70 +3748,70 @@ for example using: \term{echo \$?}
\ejabberd{} is an Erlang/OTP application that runs inside an Erlang runtime system. \ejabberd{} is an Erlang/OTP application that runs inside an Erlang runtime system.
This system is configured using environment variables and command line parameters. This system is configured using environment variables and command line parameters.
The \term{ejabberdctl} administration script uses many of those possibilities. The \term{ejabberdctl} administration script uses many of those possibilities.
You can configure some of them with the file \term{ejabberdctl.cfg}, You can configure some of them with the file \term{ejabberdctl.cfg},
which includes detailed description about them. which includes detailed description about them.
This section describes for reference purposes This section describes for reference purposes
all the environment variables and command line parameters. all the environment variables and command line parameters.
The environment variables: The environment variables:
\begin{description} \begin{description}
\titem{EJABBERD\_CONFIG\_PATH} \titem{EJABBERD\_CONFIG\_PATH}
Path to the ejabberd configuration file. Path to the ejabberd configuration file.
\titem{EJABBERD\_MSGS\_PATH} \titem{EJABBERD\_MSGS\_PATH}
Path to the directory with translated strings. Path to the directory with translated strings.
\titem{EJABBERD\_LOG\_PATH} \titem{EJABBERD\_LOG\_PATH}
Path to the ejabberd service log file. Path to the ejabberd service log file.
\titem{EJABBERD\_SO\_PATH} \titem{EJABBERD\_SO\_PATH}
Path to the directory with binary system libraries. Path to the directory with binary system libraries.
\titem{HOME} \titem{HOME}
Path to the directory that is considered \ejabberd{}'s home. Path to the directory that is considered \ejabberd{}'s home.
This path is used to read the file \term{.erlang.cookie}. This path is used to read the file \term{.erlang.cookie}.
\titem{ERL\_CRASH\_DUMP} \titem{ERL\_CRASH\_DUMP}
Path to the file where crash reports will be dumped. Path to the file where crash reports will be dumped.
\titem{ERL\_INETRC} \titem{ERL\_INETRC}
Indicates which IP name resolution to use. Indicates which IP name resolution to use.
If using \term{-sname}, specify either this option or \term{-kernel inetrc filepath}. If using \term{-sname}, specify either this option or \term{-kernel inetrc filepath}.
\titem{ERL\_MAX\_PORTS} \titem{ERL\_MAX\_PORTS}
Maximum number of simultaneously open Erlang ports. Maximum number of simultaneously open Erlang ports.
\titem{ERL\_MAX\_ETS\_TABLES} \titem{ERL\_MAX\_ETS\_TABLES}
Maximum number of ETS and Mnesia tables. Maximum number of ETS and Mnesia tables.
\end{description} \end{description}
The command line parameters: The command line parameters:
\begin{description} \begin{description}
\titem{-sname ejabberd} \titem{-sname ejabberd}
The Erlang node will be identified using only the first part The Erlang node will be identified using only the first part
of the host name, i.\,e. other Erlang nodes outside this domain cannot contact of the host name, i.\,e. other Erlang nodes outside this domain cannot contact
this node. This is the preferable option in most cases. this node. This is the preferable option in most cases.
\titem{-name ejabberd} \titem{-name ejabberd}
The Erlang node will be fully identified. The Erlang node will be fully identified.
This is only useful if you plan to setup an \ejabberd{} cluster with nodes in different networks. This is only useful if you plan to setup an \ejabberd{} cluster with nodes in different networks.
\titem{-kernel inetrc "/etc/ejabberd/inetrc"} \titem{-kernel inetrc "/etc/ejabberd/inetrc"}
Indicates which IP name resolution to use. Indicates which IP name resolution to use.
If using \term{-sname}, specify either this option or \term{ERL\_INETRC}. If using \term{-sname}, specify either this option or \term{ERL\_INETRC}.
\titem{-kernel inet\_dist\_listen\_min 4200 inet\_dist\_listen\_min 4210} \titem{-kernel inet\_dist\_listen\_min 4200 inet\_dist\_listen\_min 4210}
Define the first and last ports that \term{epmd} (section \ref{epmd}) can listen to. Define the first and last ports that \term{epmd} (section \ref{epmd}) can listen to.
\titem{-detached} \titem{-detached}
Starts the Erlang system detached from the system console. Starts the Erlang system detached from the system console.
Useful for running daemons and backgrounds processes. Useful for running daemons and backgrounds processes.
\titem{-noinput} \titem{-noinput}
Ensures that the Erlang system never tries to read any input. Ensures that the Erlang system never tries to read any input.
Useful for running daemons and backgrounds processes. Useful for running daemons and backgrounds processes.
\titem{-pa /var/lib/ejabberd/ebin} \titem{-pa /var/lib/ejabberd/ebin}
Specify the directory where Erlang binary files (*.beam) are located. Specify the directory where Erlang binary files (*.beam) are located.
\titem{-s ejabberd} \titem{-s ejabberd}
Tell Erlang runtime system to start the \ejabberd{} application. Tell Erlang runtime system to start the \ejabberd{} application.
\titem{-mnesia dir "/var/lib/ejabberd/"} \titem{-mnesia dir "/var/lib/ejabberd/"}
Specify the Mnesia database directory. Specify the Mnesia database directory.
\titem{-sasl sasl\_error\_logger \{file, "/var/log/ejabberd/sasl.log"\}} \titem{-sasl sasl\_error\_logger \{file, "/var/log/ejabberd/sasl.log"\}}
Path to the Erlang/OTP system log file. Path to the Erlang/OTP system log file.
\titem{+K [true|false]} \titem{+K [true|false]}
Kernel polling. Kernel polling.
\titem{-smp [auto|enable|disable]} \titem{-smp [auto|enable|disable]}
SMP support. SMP support.
\titem{+P 250000} \titem{+P 250000}
Maximum number of Erlang processes. Maximum number of Erlang processes.
\titem{-remsh ejabberd@localhost} \titem{-remsh ejabberd@localhost}
Open an Erlang shell in a remote Erlang node. Open an Erlang shell in a remote Erlang node.
\end{description} \end{description}
Note that some characters need to be escaped when used in shell scripts, for instance \verb|"| and \verb|{}|. Note that some characters need to be escaped when used in shell scripts, for instance \verb|"| and \verb|{}|.
@ -3818,7 +3825,7 @@ The \ejabberd{} Web Admin allows to administer most of \ejabberd{} using a web b
This feature is enabled by default: This feature is enabled by default:
a \term{ejabberd\_http} listener with the option \term{web\_admin} (see a \term{ejabberd\_http} listener with the option \term{web\_admin} (see
section~\ref{listened}) is included in the listening ports. Then you can open section~\ref{listened}) is included in the listening ports. Then you can open
\verb|http://server:port/admin/| in your favourite web browser. You \verb|http://server:port/admin/| in your favourite web browser. You
will be asked to enter the username (the \emph{full} \Jabber{} ID) and password will be asked to enter the username (the \emph{full} \Jabber{} ID) and password
of an \ejabberd{} user with administrator rights. After authentication of an \ejabberd{} user with administrator rights. After authentication
@ -3894,7 +3901,7 @@ an account with proper privileges.
\makesection{changeerlangnodename}{Change Computer Hostname} \makesection{changeerlangnodename}{Change Computer Hostname}
\ejabberd{} uses the distributed Mnesia database. \ejabberd{} uses the distributed Mnesia database.
Being distributed, Mnesia enforces consistency of its file, Being distributed, Mnesia enforces consistency of its file,
so it stores the name of the Erlang node in it (see section \ref{nodename}). so it stores the name of the Erlang node in it (see section \ref{nodename}).
The name of an Erlang node includes the hostname of the computer. The name of an Erlang node includes the hostname of the computer.
@ -3906,7 +3913,7 @@ So, if you want to change the computer hostname where \ejabberd{} is installed,
you must follow these instructions: you must follow these instructions:
\begin{enumerate} \begin{enumerate}
\item In the old server, backup the Mnesia database using the Web Admin or \term{ejabberdctl}. \item In the old server, backup the Mnesia database using the Web Admin or \term{ejabberdctl}.
For example: For example:
\begin{verbatim} \begin{verbatim}
ejabberdctl backup /tmp/ejabberd-oldhost.backup ejabberdctl backup /tmp/ejabberd-oldhost.backup
\end{verbatim} \end{verbatim}
@ -3940,15 +3947,15 @@ You need to take the following TCP ports in mind when configuring your firewall:
\makesection{epmd}{epmd} \makesection{epmd}{epmd}
\footahref{http://www.erlang.org/doc/man/epmd.html}{epmd (Erlang Port Mapper Daemon)} \footahref{http://www.erlang.org/doc/man/epmd.html}{epmd (Erlang Port Mapper Daemon)}
is a small name server included in Erlang/OTP is a small name server included in Erlang/OTP
and used by Erlang programs when establishing distributed Erlang communications. and used by Erlang programs when establishing distributed Erlang communications.
\ejabberd{} needs \term{epmd} to use \term{ejabberdctl} and also when clustering \ejabberd{} nodes. \ejabberd{} needs \term{epmd} to use \term{ejabberdctl} and also when clustering \ejabberd{} nodes.
This small program is automatically started by Erlang, and is never stopped. This small program is automatically started by Erlang, and is never stopped.
If \ejabberd{} is stopped, and there aren't any other Erlang programs If \ejabberd{} is stopped, and there aren't any other Erlang programs
running in the system, you can safely stop \term{epmd} if you want. running in the system, you can safely stop \term{epmd} if you want.
\ejabberd{} runs inside an Erlang node. \ejabberd{} runs inside an Erlang node.
To communicate with \ejabberd{}, the script \term{ejabberdctl} starts a new Erlang node To communicate with \ejabberd{}, the script \term{ejabberdctl} starts a new Erlang node
and connects to the Erlang node that holds \ejabberd{}. and connects to the Erlang node that holds \ejabberd{}.
In order for this communication to work, In order for this communication to work,
\term{epmd} must be running and listening for name requests in the port 4369. \term{epmd} must be running and listening for name requests in the port 4369.
@ -3965,7 +3972,7 @@ Remember to block the port so Internet doesn't have access to it.
Once an Erlang node solved the node name of another Erlang node using EPMD and port 4369, Once an Erlang node solved the node name of another Erlang node using EPMD and port 4369,
the nodes communicate directly. the nodes communicate directly.
The ports used in this case by default are random, The ports used in this case by default are random,
but can be configured in the file \term{ejabberdctl.cfg}. but can be configured in the file \term{ejabberdctl.cfg}.
The Erlang command-line parameter used internally is, for example: The Erlang command-line parameter used internally is, for example:
\begin{verbatim} \begin{verbatim}
@ -3975,12 +3982,12 @@ erl ... -kernel inet_dist_listen_min 4370 inet_dist_listen_max 4375
\makesection{cookie}{Erlang Cookie} \makesection{cookie}{Erlang Cookie}
The Erlang cookie is a string with numbers and letters. The Erlang cookie is a string with numbers and letters.
An Erlang node reads the cookie at startup from the command-line parameter \term{-setcookie}. An Erlang node reads the cookie at startup from the command-line parameter \term{-setcookie}.
If not indicated, the cookie is read from the cookie file \term{\$HOME/.erlang.cookie}. If not indicated, the cookie is read from the cookie file \term{\$HOME/.erlang.cookie}.
If this file does not exist, it is created immediately with a random cookie. If this file does not exist, it is created immediately with a random cookie.
Two Erlang nodes communicate only if they have the same cookie. Two Erlang nodes communicate only if they have the same cookie.
Setting a cookie on the Erlang node allows you to structure your Erlang network Setting a cookie on the Erlang node allows you to structure your Erlang network
and define which nodes are allowed to connect to which. and define which nodes are allowed to connect to which.
Thanks to Erlang cookies, you can prevent access to the Erlang node by mistake, Thanks to Erlang cookies, you can prevent access to the Erlang node by mistake,
@ -3988,7 +3995,7 @@ for example when there are several Erlang nodes running different programs in th
Setting a secret cookie is a simple method Setting a secret cookie is a simple method
to difficult unauthorized access to your Erlang node. to difficult unauthorized access to your Erlang node.
However, the cookie system is not ultimately effective However, the cookie system is not ultimately effective
to prevent unauthorized access or intrusion to an Erlang node. to prevent unauthorized access or intrusion to an Erlang node.
The communication between Erlang nodes are not encrypted, The communication between Erlang nodes are not encrypted,
so the cookie could be read sniffing the traffic on the network. so the cookie could be read sniffing the traffic on the network.
@ -3998,14 +4005,14 @@ The recommended way to secure the Erlang node is to block the port 4369.
\makesection{nodename}{Erlang node name} \makesection{nodename}{Erlang node name}
An Erlang node may have a node name. An Erlang node may have a node name.
The name can be short (if indicated with the command-line parameter \term{-sname}) The name can be short (if indicated with the command-line parameter \term{-sname})
or long (if indicated with the parameter \term{-name}). or long (if indicated with the parameter \term{-name}).
Starting an Erlang node with -sname limits the communication between Erlang nodes to the LAN. Starting an Erlang node with -sname limits the communication between Erlang nodes to the LAN.
Using the option \term{-sname} instead of \term{-name} is a simple method Using the option \term{-sname} instead of \term{-name} is a simple method
to difficult unauthorized access to your Erlang node. to difficult unauthorized access to your Erlang node.
However, it is not ultimately effective to prevent access to the Erlang node, However, it is not ultimately effective to prevent access to the Erlang node,
because it may be possible to fake the fact that you are on another network because it may be possible to fake the fact that you are on another network
using a modified version of Erlang \term{epmd}. using a modified version of Erlang \term{epmd}.
The recommended way to secure the Erlang node is to block the port 4369. The recommended way to secure the Erlang node is to block the port 4369.
@ -4194,7 +4201,7 @@ The default distribution algorithm try to deliver to a local instance of a compo
If you need a different behaviour, you can change the load balancing behaviour with the option \option{domain\_balancing}. The syntax of the option is the following: If you need a different behaviour, you can change the load balancing behaviour with the option \option{domain\_balancing}. The syntax of the option is the following:
\begin{verbatim} \begin{verbatim}
{domain_balancing, "component.example.com", <balancing_criterium>}. {domain_balancing, "component.example.com", <balancing_criterium>}.
\end{verbatim} \end{verbatim}
Several balancing criteria are available: Several balancing criteria are available:
@ -4281,7 +4288,7 @@ With this Erlang shell, an experienced administrator can perform complex tasks.
This shell gives complete control over the \ejabberd{} server, This shell gives complete control over the \ejabberd{} server,
so it is important to use it with extremely care. so it is important to use it with extremely care.
There are some simple and safe examples in the article There are some simple and safe examples in the article
\footahref{http://www.ejabberd.im/interconnect-erl-nodes}{Interconnecting Erlang Nodes} \footahref{http://www.ejabberd.im/interconnect-erl-nodes}{Interconnecting Erlang Nodes}
To exit the shell, close the window or press the keys: control+c control+c. To exit the shell, close the window or press the keys: control+c control+c.
@ -4293,8 +4300,8 @@ To exit the shell, close the window or press the keys: control+c control+c.
\ind{xml:lang}\ind{internationalization}\ind{localization}\ind{i18n}\ind{l10n} \ind{xml:lang}\ind{internationalization}\ind{localization}\ind{i18n}\ind{l10n}
The source code of \ejabberd{} supports localization. The source code of \ejabberd{} supports localization.
The translators can edit the The translators can edit the
\footahref{http://www.gnu.org/software/gettext/}{gettext} .po files \footahref{http://www.gnu.org/software/gettext/}{gettext} .po files
using any capable program (KBabel, Lokalize, Poedit...) or a simple text editor. using any capable program (KBabel, Lokalize, Poedit...) or a simple text editor.
Then gettext Then gettext
@ -4327,7 +4334,7 @@ The Web Admin also supports the \verb|Accept-Language| HTTP header.
\begin{figure}[htbp] \begin{figure}[htbp]
\centering \centering
\insimg{webadmmainru.png} \insimg{webadmmainru.png}
\caption{Web Admin showing a virtual host when the web browser provides the \caption{Web Admin showing a virtual host when the web browser provides the
HTTP header `Accept-Language: ru'} HTTP header `Accept-Language: ru'}
\label{fig:webadmmainru} \label{fig:webadmmainru}
\end{figure} \end{figure}
@ -4382,7 +4389,7 @@ Street, Fifth Floor, Boston, MA 02110-1301, USA.
%\ind{glossary} %\ind{glossary}
%\begin{description} %\begin{description}
%\titem{c2s} %\titem{c2s}
%\titem{s2s} %\titem{s2s}
%\titem{STARTTLS} %\titem{STARTTLS}
%\titem{XEP} (\XMPP{} Extension Protocol) %\titem{XEP} (\XMPP{} Extension Protocol)

View File

@ -16,7 +16,7 @@
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of %%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
%%% General Public License for more details. %%% General Public License for more details.
%%% %%%
%%% You should have received a copy of the GNU General Public License %%% You should have received a copy of the GNU General Public License
%%% along with this program; if not, write to the Free Software %%% along with this program; if not, write to the Free Software
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA %%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
@ -52,14 +52,21 @@ start_hosts() ->
%% Start the ODBC module on the given host %% Start the ODBC module on the given host
start_odbc(Host) -> start_odbc(Host) ->
Supervisor_name = gen_mod:get_module_proc(Host, ejabberd_odbc_sup),
ChildSpec = ChildSpec =
{gen_mod:get_module_proc(Host, ejabberd_odbc_sup), {Supervisor_name,
{ejabberd_odbc_sup, start_link, [Host]}, {ejabberd_odbc_sup, start_link, [Host]},
temporary, transient,
infinity, infinity,
supervisor, supervisor,
[ejabberd_odbc_sup]}, [ejabberd_odbc_sup]},
supervisor:start_child(ejabberd_sup, ChildSpec). case supervisor:start_child(ejabberd_sup, ChildSpec) of
{ok, _PID} ->
ok;
_Error ->
?ERROR_MSG("Start of supervisor ~p failed:~n~p~nRetrying...~n", [Supervisor_name, _Error]),
start_odbc(Host)
end.
%% Returns true if we have configured odbc_server for the given host %% Returns true if we have configured odbc_server for the given host
needs_odbc(Host) -> needs_odbc(Host) ->

View File

@ -30,7 +30,7 @@
-behaviour(gen_server). -behaviour(gen_server).
%% External exports %% External exports
-export([start/1, start_link/1, -export([start/1, start_link/2,
sql_query/2, sql_query/2,
sql_query_t/1, sql_query_t/1,
sql_transaction/2, sql_transaction/2,
@ -63,8 +63,8 @@
start(Host) -> start(Host) ->
gen_server:start(ejabberd_odbc, [Host], []). gen_server:start(ejabberd_odbc, [Host], []).
start_link(Host) -> start_link(Host, StartInterval) ->
gen_server:start_link(ejabberd_odbc, [Host], []). gen_server:start_link(ejabberd_odbc, [Host, StartInterval], []).
sql_query(Host, Query) -> sql_query(Host, Query) ->
gen_server:call(ejabberd_odbc_sup:get_random_pid(Host), gen_server:call(ejabberd_odbc_sup:get_random_pid(Host),
@ -131,10 +131,10 @@ escape_like(C) -> odbc_queries:escape(C).
%% ignore | %% ignore |
%% {stop, Reason} %% {stop, Reason}
%%---------------------------------------------------------------------- %%----------------------------------------------------------------------
init([Host]) -> init([Host, StartInterval]) ->
case ejabberd_config:get_local_option({odbc_keepalive_interval, Host}) of case ejabberd_config:get_local_option({odbc_keepalive_interval, Host}) of
Interval when is_integer(Interval) -> KeepaliveInterval when is_integer(KeepaliveInterval) ->
timer:apply_interval(Interval*1000, ?MODULE, keep_alive, [self()]); timer:apply_interval(KeepaliveInterval*1000, ?MODULE, keep_alive, [self()]);
undefined -> undefined ->
ok; ok;
_Other -> _Other ->
@ -144,16 +144,16 @@ init([Host]) ->
case SQLServer of case SQLServer of
%% Default pgsql port %% Default pgsql port
{pgsql, Server, DB, Username, Password} -> {pgsql, Server, DB, Username, Password} ->
pgsql_connect(Server, ?PGSQL_PORT, DB, Username, Password); pgsql_connect(Server, ?PGSQL_PORT, DB, Username, Password, StartInterval);
{pgsql, Server, Port, DB, Username, Password} when is_integer(Port) -> {pgsql, Server, Port, DB, Username, Password} when is_integer(Port) ->
pgsql_connect(Server, Port, DB, Username, Password); pgsql_connect(Server, Port, DB, Username, Password, StartInterval);
%% Default mysql port %% Default mysql port
{mysql, Server, DB, Username, Password} -> {mysql, Server, DB, Username, Password} ->
mysql_connect(Server, ?MYSQL_PORT, DB, Username, Password); mysql_connect(Server, ?MYSQL_PORT, DB, Username, Password, StartInterval);
{mysql, Server, Port, DB, Username, Password} when is_integer(Port) -> {mysql, Server, Port, DB, Username, Password} when is_integer(Port) ->
mysql_connect(Server, Port, DB, Username, Password); mysql_connect(Server, Port, DB, Username, Password, StartInterval);
_ when is_list(SQLServer) -> _ when is_list(SQLServer) ->
odbc_connect(SQLServer) odbc_connect(SQLServer, StartInterval)
end. end.
%%---------------------------------------------------------------------- %%----------------------------------------------------------------------
@ -259,7 +259,7 @@ execute_transaction(State, F, NRestarts) ->
%% part of init/1 %% part of init/1
%% Open an ODBC database connection %% Open an ODBC database connection
odbc_connect(SQLServer) -> odbc_connect(SQLServer, StartInterval) ->
application:start(odbc), application:start(odbc),
case odbc:connect(SQLServer,[{scrollable_cursors, off}]) of case odbc:connect(SQLServer,[{scrollable_cursors, off}]) of
{ok, Ref} -> {ok, Ref} ->
@ -268,8 +268,8 @@ odbc_connect(SQLServer) ->
{error, Reason} -> {error, Reason} ->
?ERROR_MSG("ODBC connection (~s) failed: ~p~n", ?ERROR_MSG("ODBC connection (~s) failed: ~p~n",
[SQLServer, Reason]), [SQLServer, Reason]),
%% If we can't connect we wait for 30 seconds before retrying %% If we can't connect we wait before retrying
timer:sleep(30000), timer:sleep(StartInterval),
{stop, odbc_connection_failed} {stop, odbc_connection_failed}
end. end.
@ -278,15 +278,15 @@ odbc_connect(SQLServer) ->
%% part of init/1 %% part of init/1
%% Open a database connection to PostgreSQL %% Open a database connection to PostgreSQL
pgsql_connect(Server, Port, DB, Username, Password) -> pgsql_connect(Server, Port, DB, Username, Password, StartInterval) ->
case pgsql:connect(Server, DB, Username, Password, Port) of case pgsql:connect(Server, DB, Username, Password, Port) of
{ok, Ref} -> {ok, Ref} ->
erlang:monitor(process, Ref), erlang:monitor(process, Ref),
{ok, #state{db_ref = Ref, db_type = pgsql}}; {ok, #state{db_ref = Ref, db_type = pgsql}};
{error, Reason} -> {error, Reason} ->
?ERROR_MSG("PostgreSQL connection failed: ~p~n", [Reason]), ?ERROR_MSG("PostgreSQL connection failed: ~p~n", [Reason]),
%% If we can't connect we wait for 30 seconds before retrying %% If we can't connect we wait before retrying
timer:sleep(30000), timer:sleep(StartInterval),
{stop, pgsql_connection_failed} {stop, pgsql_connection_failed}
end. end.
@ -317,7 +317,7 @@ pgsql_item_to_odbc(_) ->
%% part of init/1 %% part of init/1
%% Open a database connection to MySQL %% Open a database connection to MySQL
mysql_connect(Server, Port, DB, Username, Password) -> mysql_connect(Server, Port, DB, Username, Password, StartInterval) ->
NoLogFun = fun(_Level,_Format,_Argument) -> ok end, NoLogFun = fun(_Level,_Format,_Argument) -> ok end,
case mysql_conn:start(Server, Port, Username, Password, DB, NoLogFun) of case mysql_conn:start(Server, Port, Username, Password, DB, NoLogFun) of
{ok, Ref} -> {ok, Ref} ->
@ -330,9 +330,10 @@ mysql_connect(Server, Port, DB, Username, Password) ->
"SERIALIZABLE;"], self()), "SERIALIZABLE;"], self()),
{ok, #state{db_ref = Ref, db_type = mysql}}; {ok, #state{db_ref = Ref, db_type = mysql}};
{error, Reason} -> {error, Reason} ->
?ERROR_MSG("MySQL connection failed: ~p~n", [Reason]), ?ERROR_MSG("MySQL connection failed: ~p~nWaiting ~p seconds before retrying...~n",
%% If we can't connect we wait for 30 seconds before retrying [Reason, StartInterval div 1000]),
timer:sleep(30000), %% If we can't connect we wait before retrying
timer:sleep(StartInterval),
{stop, mysql_connection_failed} {stop, mysql_connection_failed}
end. end.

View File

@ -16,7 +16,7 @@
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of %%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
%%% General Public License for more details. %%% General Public License for more details.
%%% %%%
%%% You should have received a copy of the GNU General Public License %%% You should have received a copy of the GNU General Public License
%%% along with this program; if not, write to the Free Software %%% along with this program; if not, write to the Free Software
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA %%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
@ -37,32 +37,44 @@
-include("ejabberd.hrl"). -include("ejabberd.hrl").
-define(DEFAULT_POOL_SIZE, 10). -define(DEFAULT_POOL_SIZE, 10).
-define(DEFAULT_ODBC_START_INTERVAL, 30). % 30 seconds
start_link(Host) -> start_link(Host) ->
supervisor:start_link({local, gen_mod:get_module_proc(Host, ?MODULE)}, supervisor:start_link({local, gen_mod:get_module_proc(Host, ?MODULE)},
?MODULE, [Host]). ?MODULE, [Host]).
init([Host]) -> init([Host]) ->
N = case ejabberd_config:get_local_option({odbc_pool_size, Host}) of PoolSize = case ejabberd_config:get_local_option({odbc_pool_size, Host}) of
I when is_integer(I) -> I when is_integer(I) ->
I; I;
undefined -> undefined ->
?DEFAULT_POOL_SIZE; ?DEFAULT_POOL_SIZE;
Other -> Other ->
?ERROR_MSG("Wrong odbc_pool_size definition '~p' for host ~p, default to ~p~n", ?ERROR_MSG("Wrong odbc_pool_size definition '~p' for host ~p, default to ~p~n",
[Other, Host, ?DEFAULT_POOL_SIZE]), [Other, Host, ?DEFAULT_POOL_SIZE]),
?DEFAULT_POOL_SIZE ?DEFAULT_POOL_SIZE
end, end,
{ok, {{one_for_one, 10, 6}, StartInterval = case ejabberd_config:get_local_option({odbc_start_interval, Host}) of
Interval when is_integer(Interval) ->
Interval;
undefined ->
?DEFAULT_ODBC_START_INTERVAL;
_Other2 ->
?ERROR_MSG("Wrong odbc_start_interval definition '~p' for host ~p"
", defaulting to ~p~n",
[_Other2, Host, ?DEFAULT_ODBC_START_INTERVAL]),
?DEFAULT_ODBC_START_INTERVAL
end,
{ok, {{one_for_one, PoolSize+1, StartInterval},
lists:map( lists:map(
fun(I) -> fun(I) ->
{I, {I,
{ejabberd_odbc, start_link, [Host]}, {ejabberd_odbc, start_link, [Host, StartInterval*1000]},
transient, transient,
brutal_kill, brutal_kill,
worker, worker,
[?MODULE]} [?MODULE]}
end, lists:seq(1, N))}}. end, lists:seq(1, PoolSize))}}.
get_pids(Host) -> get_pids(Host) ->
Proc = gen_mod:get_module_proc(Host, ?MODULE), Proc = gen_mod:get_module_proc(Host, ?MODULE),