<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Hi,<br clear="all"></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I am using Kamailio 5.4.1 installed from the packages on Ubuntu 18.04.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">When I define 'modparam("tls", "config", "<folder>")', Kamailio fails to start:</div><div class="gmail_default" 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 class="gmail_default" style="font-family:arial,helvetica,sans-serif"> </div><div><div dir="ltr" data-smartmail="gmail_signature">Best regards,<br>Leonid Fainshtein<br><br></div></div></div></div>