LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   xinetd - RPC based server (https://www.linuxquestions.org/questions/linux-server-73/xinetd-rpc-based-server-4175419210/)

linuxxer 07-29-2012 12:03 PM

xinetd - RPC based server
 
Hi guys,

Is it possible to start RPC based server by using xinetd?

If yes, then please give me some example of xinetd configuration.

Is it possible to start ANY server, using xinetd?
Any support required within server to work with xinetd?


Thanks

chrism01 07-29-2012 07:10 PM

xinetd exists to ctrl nominated servers...
Start reading here and come back if you have specific qns http://www.linuxtopia.org/online_boo...rappers-xinetd

linuxxer 07-30-2012 05:02 AM

Thanks for your reply.

Quote:

Originally Posted by chrism01 (Post 4740867)

This link is really helpful.


But I have a doubt.

Quote:

Originally Posted by chrism01 (Post 4740867)
xinetd exists to ctrl nominated servers...

When I read xinetd.conf(5) man page, xinetd support following configuration options :
type = RPC
rpc_version =
rpc_number =
This man page having sample configuration for rpc.rstatd.

This means, It is possible to manage RPC based servers (like NFS) using xinetd.
I tried to configure, but NOTHING work.

chrism01 07-31-2012 09:08 PM

Quote:

I tried to configure, but NOTHING work.
I'm afraid that's uninformative.
We need to see what you did ie cfgs, cmds, error msgs etc.
Check the logs.

linuxxer 08-01-2012 02:54 PM

Yes, Thats my mistake.

I am using Debian 6.0.5. It uses kernel based NFS server
And My configuration:

Code:

##  /etc/hosts.allow  ##
sshd    : 127.0.0.1 192.168.10.0/255.255.255.0
xinetd  : 127.0.0.1 192.168.10.0/255.255.255.0
portmap : 127.0.0.1 192.168.10.0/255.255.255.0
mountd  : 127.0.0.1 192.168.10.0/255.255.255.0
statd  : 127.0.0.1 192.168.10.0/255.255.255.0

##  /etc/hosts.deny  ##
sshd    : ALL
xinetd  : ALL
portmap : ALL
mountd  : ALL
statd  : ALL

Code:

##  /etc/xinetd.d/sunrpc  ##
service sunrpc
{
    id                        = sunrpc-tcp
    disable            = no
    type                = RPC
    socket_type                = stream
    protocol                = tcp
#    port                = 111
    rpc_version                = 2-4
#    interface                = 192.168.10.10
    server                = /sbin/portmap
    wait                = no
    user                = root
    log_type                = SYSLOG daemon crit
    log_on_success        = HOST USERID PID
    log_on_failure        = HOST USERID ATTEMPT
}

service sunrpc
{
    id                        = sunrpc-udp
    disable            = no
    type                = RPC
    socket_type                = dgram
    protocol                = udp
#    port                = 111
    rpc_version                = 2-4
#    interface                = 192.168.10.10
    server                = /sbin/portmap
    wait                = no
    user                = root
    log_type                = SYSLOG daemon crit
    log_on_success        = HOST USERID PID
    log_on_failure        = HOST USERID ATTEMPT
}

When I start portmap with type = RPC service
rsyslog says:
Code:

Aug  1 20:29:30 debian xinetd[1039]: Reading included configuration file: /etc/xinetd.d/sunrpc [file=/etc/xinetd.d/sunrpc] [line=19]
.....
.....
Aug  1 20:29:30 debian xinetd[1039]: pmap_set failed. service=sunrpc program=100000 version=2

But When I start portmapper as normal TCP/UDP service, by commenting "type = RPC", then
rsyslog says:
Code:

Aug  1 20:57:07 debian xinetd[1039]: Reading included configuration file: /etc/xinetd.d/sunrpc [file=/etc/xinetd.d/sunrpc] [line=19]
.....
.....
Aug  1 20:57:07 debian xinetd[1039]: readjusting service sunrpc
Aug  1 20:57:07 debian xinetd[1039]: Reconfigured: new=0 old=2 dropped=0 (services)

At client side, when I run command
Code:

$ rpcinfo -p debian
At server side, rsyslog entry :
Code:

Aug  1 20:57:40 debian xinetd[1039]: START: sunrpc pid=1533 from=192.168.10.20
Aug  1 20:58:01 debian portmap[1534]: cannot bind tcp: Address already in use

After that I remove /etc/xinetd.d/sunrpc,
and I start portmap in normalway,
i.e. NOT as xinetd manage service.

And I try to configure other RPC services.
Code:

##  /etc/xinetd.d/mountd  ##
service mountd
{
    id                        = mountd-tcp
    type                = RPC
    socket_type                = stream
    protocol                = tcp
    port                = 2050
    rpc_version                = 3
#    interface                = 192.168.10.10
    server                = /usr/sbin/rpc.mountd
    server_args        = --manage-gids --port 2050 --nfs-version 3
    wait                = no
    user                = root
    log_type                = SYSLOG daemon crit
    log_on_success        = HOST USERID PID
    log_on_failure        = HOST USERID ATTEMPT
}

service mountd
{
    id                        = mountd-udp
    type                = RPC
    socket_type                = dgram
    protocol                = udp
    port                = 2050
    rpc_version                = 3
#    interface                = 192.168.10.10
    server                = /usr/sbin/rpc.mountd
    server_args        = --manage-gids --port 2050 --nfs-version 3
    wait                = no
    user                = root
    log_type                = SYSLOG daemon crit
    log_on_success        = HOST USERID PID
    log_on_failure        = HOST USERID ATTEMPT
}


##  /etc/xinetd.d/nfsd  ##
service nfs
{
    id                        = nfs-tcp
    type                = RPC
    socket_type                = stream
    protocol                = tcp
    port                = 2049
    rpc_version                = 3
#    interface                = 192.168.10.10
    server                = /usr/sbin/rpc.nfsd
    server_args        = 1 --no-nfs-version=2,4
    wait                = no
    user                = root
    log_type                = SYSLOG daemon crit
    log_on_success        = HOST USERID PID
    log_on_failure        = HOST USERID ATTEMPT
}

service nfs
{
    id                        = nfs-udp
    type                = RPC
    socket_type                = dgram
    protocol                = udp
    port                = 2049
    rpc_version                = 3
#    interface                = 192.168.10.10
    server                = /usr/sbin/rpc.nfsd
    server_args        = 1 --no-nfs-version=2,4
    wait                = no
    user                = root
    log_type                = SYSLOG daemon crit
    log_on_success        = HOST USERID PID
    log_on_failure        = HOST USERID ATTEMPT
}

rsyslog says:
Code:

Aug  1 23:32:20 debian xinetd[4384]: Reading included configuration file: /etc/xinetd.d/mountd [file=/etc/xinetd.d/mountd] [line=26]
Aug  1 23:32:20 debian xinetd[4384]: Reading included configuration file: /etc/xinetd.d/nfsd [file=/etc/xinetd.d/nfsd] [line=35]
......
......
Aug  1 23:27:56 debian xinetd[3822]: readjusting service mountd-tcp
Aug  1 23:27:56 debian xinetd[3822]: readjusting service mountd-udp
Aug  1 23:27:56 debian xinetd[3822]: readjusting service ssh
Aug  1 23:27:56 debian xinetd[3822]: pmap_set failed. service=nfs-tcp program=100003 version=3
Aug  1 23:27:57 debian xinetd[3822]: Service nfs-tcp failed to start and is deactivated.
Aug  1 23:27:57 debian xinetd[3822]: pmap_set failed. service=nfs-udp program=100003 version=3
Aug  1 23:27:58 debian xinetd[3822]: Service nfs-udp failed to start and is deactivated.

I also tried this with:
rpc_version = 2-4


All times are GMT -5. The time now is 07:02 PM.