<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">are you sure to know how to configure
sudo?<br>
please post the user used by openSIPS and sudo configuration
(sudoers)<br>
<br>
<br>
<br>
Il 20/09/2013 19.11, Dragomir Haralambiev ha scritto:<br>
</div>
<blockquote
cite="mid:CADzurO+RDVZy6=jMrGty6e_vDu00bfiAy_Jn7AZJ_Ov5BEHhPA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>Hello everyone,</div>
<div> </div>
<div>I am trying to execute 'iptables' from opensips in
the script, which works if opensips runs as root. However if
opensips is configured to run as non-privileged user, in order
to control iptables, I have to call iptables via sudo. Command
works on the command prompt when executed manually under the
user opensips run as, but does not seem to execute if run by
opensips itself.</div>
<div> </div>
<div>This is how I try to call it:</div>
<div> </div>
<div>exec_msg("/usr/bin/sudo /sbin/iptables -A INPUT -s $si -p
udp -j DROP"); </div>
<div> </div>
<div>log file says command is executed, but the firewall rules
do not get updated.</div>
<div> </div>
<div>Any idea why?</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>