<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Actually, it is possible to use the libc 'P_tmpdir' macro in order to get the temporary folder name.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div><div dir="ltr" data-smartmail="gmail_signature">Best regards,<br>Leonid Fainshtein<br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 30, 2020 at 6:35 PM Leonid Fainshtein <<a href="mailto:leonid.fainshtein@xorcom.com" target="_blank">leonid.fainshtein@xorcom.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif">Hi,<br clear="all"></div><div style="font-family:arial,helvetica,sans-serif">I am using Kamailio 5.4.1 installed from the packages on Ubuntu 18.04.</div><div style="font-family:arial,helvetica,sans-serif">When I define 'modparam("tls", "config", "<folder>")', Kamailio fails to start:</div><div style="font-family:arial,helvetica,sans-serif"><br></div><span style="font-family:monospace"><span style="color:rgb(0,0,0)">ERROR: tls [tls_config.c:418]: <span class="gmail_default" style="font-family:arial,helvetica,sans-serif"></span>tls_load_config(): cannot make tmp file configrcCczj
</span><br>ERROR: <core> [core/sr_module.c:849]: init_mod(): Error while initializing module tls (/usr/lib/x86_64-linux-gnu/kamailio/modules/tls.so)
<br><br><span class="gmail_default" style="font-family:arial,helvetica,sans-serif">I checked the </span></span><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"></span><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"></span>tls_load_config()<span class="gmail_default" style="font-family:arial,helvetica,sans-serif"> 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.</span><div><span class="gmail_default" style="font-family:arial,helvetica,sans-serif">I succeeded to launch Kamailio in two ways:</span></div><div><span style="font-family:arial,helvetica,sans-serif">Method 1<span class="gmail_default" style="font-family:arial,helvetica,sans-serif">: </span> copy <span class="gmail_default" style="font-family:arial,helvetica,sans-serif">'</span>kamailio<span class="gmail_default" style="font-family:arial,helvetica,sans-serif">'</span> to /tmp and modify </span>kamalio.service<span style="font-family:arial,helvetica,sans-serif"> accordingly<span class="gmail_default" style="font-family:arial,helvetica,sans-serif">. This experiment result made me think that the working folder is the folder where kamailio is started.</span></span></div><div><span style="font-family:arial,helvetica,sans-serif"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif">Method 2: add Kamailio command line parameter "-w /tmp"</span></span></div><div><font face="arial, helvetica, sans-serif"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></span></font></div><div><font face="arial, helvetica, sans-serif"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif">(I also tried to define the Systemd 'WorkingDirectory' parameter but it didn't have any effect.)</span></font></div><div><font face="arial, helvetica, sans-serif"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></span></font></div><div><font face="arial, helvetica, sans-serif"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif">I think that the ultimate solution for this problem is to modify the </span></font><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"></span>tls_load_config()<span class="gmail_default" style="font-family:arial,helvetica,sans-serif"> 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. </span><font face="arial, helvetica, sans-serif"><br></font><div style="font-family:arial,helvetica,sans-serif"> </div><div><div dir="ltr">Best regards,<br>Leonid Fainshtein<br><br></div></div></div></div>
</blockquote></div></div>