setuid is a library function, I think you are looking for sudo or su -c.
g-)

Alberto Cruz wrote:
Hi I don't know how to use the setuid command.

I were trying to find some documentation or tutorial and BTW I red the manual information for the setuid function.

I tried to add the following line at the rtpproxy init script but I only got an error:
setuid ser

Could anybody give me a hand?

Regards

Alberto Cruz

Greger V. Teigre wrote:
Alberto,
Typically, you will run rtpproxy with the same user (or at least group) as ser or you can change permission on the socket file after starting rtpproxy in your init script (chmod to be more targeted).
g-)

Alberto Cruz wrote:
I found the problem. As Samuel have said the problem is with socket permissions.

When the RTPProxy is already running and I modified the permissions or owner to the rtpproxy.sock file it works but as soon as I restart the deamon the permissions
go back again to the original permissions.

This is something to do with how the rtproxy is creating the .socket file at the time it starts and it defines the permissions to srwxr-xr-x for the user and group equal to root.

So as I have been running SER with user and group as ser, SER can't talk to the socket.

I need to modify the way like RTPROXY runs in other to start the daemon with another user or with different permissions for the socket file.

In the meantime I applied the "umask 000" command at the "/etc/init.d/rtproxy" file and it works but it modifies the .pid file too.

Is there a way to tell rtpproxy daemon to run with a different user for example user ser ?

Regards

Alberto Cruz

Alberto Cruz wrote:
RTPROXY is running as it default:
root      2332     1  0 Jul09 ?        00:00:00 /usr/sbin/rtpproxy

And SER is running as follow:
ser       4612  4575  0 Jul09 ?        00:00:00 /usr/sbin/ser -P /var/run/ser/ser.pid -u ser -g ser

And the socket File is like this:
-rw-r--r--   1 root        root           5 2006-07-09 02:45 rtpproxy.pid
srwxr-xr-x   1 root        root           0 2006-07-09 02:45 rtpproxy.sock

I already tried changing the owner and group for the rtpproxy.sock but it didn't work

Regards

Acruz
samuel wrote:
Maybe something's wrong with the socket permissions.... which are the owner/group which SER and rtproxy are running??

Check wether SER user has permissions wnough to access the rtproxy socket.

Hope it helps,
Samuel.


2006/7/10, Alberto Cruz <acruz@tekbrain.com>:
Hi Jan and Maxim:
Maybe you can help me with this.
I'm using Debian sarge r3.0 and SER apt packages (0.9.6)

I was looking at the CVS Repository if there was something related to this behavior with RTPPROXY and I found the following annotation for ser/rtpproxy/main.c on July 4:
Since we are now opening control socket in non-blocking mode, there is race condition between accepting stream connection on unix domain socket and availability of data on the socket. Patch it by doing read() in a loop until we actually get the data. While I am here, allow V command to take extra argument, which we don't process but put into the log file. This allows to pass some extra information from the client (SER in this case) such as PID number for example.  
    
Does it have something to do with my problem? BTW I found a bug posted too at the lists.debian.org:
Bug#356721: ITP: rtpproxy -- RTP proxy for SER

Am I doing something wrong with my installation/configuration or is it a bug?


Regards

Alberto Cruz

Andres wrote:
Alberto Cruz wrote:

I tried but I'm still receiving the same messages:
Jul  9 17:51:58 sermex02 /usr/sbin/ser[3902]: DEBUG: init_mod_child (-4): nathelper
Jul  9 17:51:58 sermex02 /usr/sbin/ser[3902]: ERROR: send_rtpp_command: can't connect to RTP proxy
Jul  9 17:51:58 sermex02 /usr/sbin/ser[3902]: WARNING: rtpp_test: can't get version of the RTP proxy
Jul  9 17:51:58 sermex02 /usr/sbin/ser[3902]: WARNING: rtpp_test: support for RTP proxy has been disabled temporarily

Does anybody else have seen this behavior?

Yes, that happens when the nathelper module is unable to contact the rtppoxy either because it is not running or it is an old version and is incompatible with your nathelper.


Regards

Alberto Cruz

Andres wrote:

Alberto Cruz wrote:

I have checked and the RTPProxy is running and listening:

Active UNIX domain sockets (servers and established)
Proto RefCnt Flags       Type       State         I-Node Path
unix  2      [ ACC ]     STREAM     LISTENING     3121     /tmp/.gdm_socket
unix  2      [ ACC ]     STREAM     LISTENING     1765     /var/run/dirmngr/socket
unix  2      [ ACC ]     STREAM     LISTENING     20376    /var/run/rtpproxy.sock
unix  2      [ ACC ]     STREAM     LISTENING     2029     /var/run/mysqld/mysqld.sock

And the rtpproxy socket configuration at ser.cfg is ok too:
# -- nathelper params --
modparam("nathelper", "natping_interval", 30)
modparam("nathelper", "ping_nated_only", 1)
modparam("nathelper", "rtpproxy_sock", "unix:/var/run/rtpproxy.sock")

Try this instead:
modparam("nathelper", "rtpproxy_sock", "/var/run/rtpproxy.sock")







_______________________________________________
Serusers mailing list
Serusers@lists.iptel.org
http://lists.iptel.org/mailman/listinfo/serusers




_______________________________________________ Serusers mailing list Serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers