[SR-Users] Kamailio fails to start when tls module parameter 'config' contains a folder name
Leonid Fainshtein
leonid.fainshtein at xorcom.com
Wed Sep 30 18:00:59 CEST 2020
Actually, it is possible to use the libc 'P_tmpdir' macro in order to get
the temporary folder name.
Best regards,
Leonid Fainshtein
On Wed, Sep 30, 2020 at 6:35 PM Leonid Fainshtein <
leonid.fainshtein at xorcom.com> wrote:
> Hi,
> I am using Kamailio 5.4.1 installed from the packages on Ubuntu 18.04.
> When I define 'modparam("tls", "config", "<folder>")', Kamailio fails to
> start:
>
> ERROR: tls [tls_config.c:418]: tls_load_config(): cannot make tmp file
> configrcCczj
> ERROR: <core> [core/sr_module.c:849]: init_mod(): Error while initializing
> module tls (/usr/lib/x86_64-linux-gnu/kamailio/modules/tls.so)
>
> I checked the tls_load_config() function and found that when a folder is
> defined in the 'config' parameter, the function tries to open a temporary
> file in the working directory. I believe that the working directory at that
> point is the folder where Kamailio was started: /usr/sbin.
> I succeeded to launch Kamailio in two ways:
> Method 1: copy 'kamailio' to /tmp and modify kamalio.service accordingly.
> This experiment result made me think that the working folder is the folder
> where kamailio is started.
> Method 2: add Kamailio command line parameter "-w /tmp"
>
> (I also tried to define the Systemd 'WorkingDirectory' parameter but
> it didn't have any effect.)
>
> I think that the ultimate solution for this problem is to modify the
> tls_load_config() function in such a way that it will open the temporary
> file in a folder that is intended for the temporary files. For example, the
> /tmp folder in Linux and *BSD systems. I guess that /tmp is a good place in
> MacOS as well.
>
> Best regards,
> Leonid Fainshtein
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20200930/776e2a00/attachment.htm>
More information about the sr-users
mailing list