Bug 171639 - ypserv specific port binding fail with -p option
ypserv specific port binding fail with -p option
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: ypserv (Show other bugs)
4.0
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Chris Feist
Jay Turner
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-10-24 12:49 EDT by Zaiwen
Modified: 2015-01-07 19:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-10-31 10:43:47 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Zaiwen 2005-10-24 12:49:14 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; {E9D31537-3D39-C2E9-2A41-18C95961F70C}; .NET CLR 1.1.4322)

Description of problem:
I want to assign ypserv a specifc port when started and thus make it easier 
to use NIS in a firewalled environment. By assigning specific port, I can open this port permenently on my firewall. Otherwise, I have to add the port every time on my firewall's trusted ports after ypserv is restarted.

I tried the "-p port" option, but it failed to assign ypserv a specific port. When I run "rpcinfo -p localhost" to check, it seems ypserv always receives a random port from portmap.



Version-Release number of selected component (if applicable):
ypserv-2.13-5

How reproducible:
Always

Steps to Reproduce:
1. start ypserv with -p option at startup to specify the port:
/etc/init.d/ypserv start -p 1000

or
1. edit /etc/init.d/ypserv file and add "-p 1000" in the "start" section.

 

Actual Results:  run "rpcinfo -p localhost" to check, it seems ypserv always receives a random port from portmap:
#rpcinfo -p localhost |grep ypserv
    100004    2   udp    798  ypserv
    100004    1   udp    798  ypserv   


Expected Results:  "rpcinfo -p localhost" should show ypserv with the port I started with (for example, in my case here, 1000).

Additional info:
Comment 1 Chris Feist 2005-10-25 15:04:55 EDT
Can you provide the output of 'ps -eaf  | grep ypserv' & 'netstat -tnlp'.
Comment 2 Zaiwen 2005-10-26 20:11:27 EDT
(In reply to comment #1)
> Can you provide the output of 'ps -eaf  | grep ypserv' & 'netstat -tnlp'.

first run: /etc/init.d/ypserv start -p 1000
 
#ps -eaf |grep ypserv
root      7753     1  0 20:07 ?        00:00:00 ypserv
root      7757  7691  0 20:08 pts/4    00:00:00 grep ypserv

#netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             
State       PID/Program name
tcp   0      0 0.0.0.0:2049     0.0.0.0:*         LISTEN      -
tcp   0      0 0.0.0.0:32769    0.0.0.0:*         LISTEN 1718/rpc.statd
tcp   0      0 0.0.0.0:32770    0.0.0.0:*         LISTEN      -
tcp   0      0 0.0.0.0:111      0.0.0.0:*         LISTEN 1698/portmap
tcp   0      0 0.0.0.0:6000     0.0.0.0:*         LISTEN 7520/X
tcp   0      0 0.0.0.0:21       0.0.0.0:*         LISTEN 1960/vsftpd
tcp   0      0 0.0.0.0:726      0.0.0.0:*         LISTEN 7753/ypserv
tcp   0      0 0.0.0.0:950      0.0.0.0:*         LISTEN 1911/rpc.rquotad
tcp   0      0 0.0.0.0:951      0.0.0.0:*         LISTEN 1933/rpc.mountd
tcp   0      0 0.0.0.0:23       0.0.0.0:*         LISTEN 1897/xinetd
tcp   0      0 127.0.0.1:631    0.0.0.0:*         LISTEN 1846/cupsd
tcp   0      0 0.0.0.0:3128     0.0.0.0:*         LISTEN 2035/(squid)
tcp   0      0 0.0.0.0:25       0.0.0.0:*         LISTEN 1979/sendmail: acce
tcp   0      0 :::6000          :::*              LISTEN 7520/X
tcp   0      0 :::80            :::*              LISTEN 2009/httpd
tcp   0      0 :::22            :::*              LISTEN 1882/sshd
tcp   0      0 :::443           :::*              LISTEN 2009/httpd
Comment 3 Chris Feist 2005-10-27 11:17:53 EDT
The problem you're having is that ypserv is not being run with the '-p 1000' option.

Running '/etc/init.d/ypserv start -p 1000' will not run 'ypserv -p 1000' it will
only run the ypserv init script (with the options specified there).

The best thing to do is add the following line to /etc/sysconfig/network
YPSERV_ARGS=-p 1000

Then run 'service ypserv stop', then 'service ypserv start'.

Let me know how that works.
Comment 4 Zaiwen 2005-10-27 19:22:54 EDT
(In reply to comment #3)
> The problem you're having is that ypserv is not being run with the '-p 1000' 
option.
> Running '/etc/init.d/ypserv start -p 1000' will not run 'ypserv -p 1000' it 
will
> only run the ypserv init script (with the options specified there).
> The best thing to do is add the following line to /etc/sysconfig/network
> YPSERV_ARGS=-p 1000
> Then run 'service ypserv stop', then 'service ypserv start'.
> Let me know how that works.

Yes, it is working now!!!!

Two points
1. The line you give won't work until double quote is added to "-p 1000":
   YPSERV_ARGS="-p 1000"

2. So the man page of ypserv should be updated :)

Thank you very much!!! You are great! This issue can be closed.
Comment 5 Zaiwen 2005-10-29 10:32:37 EDT
(In reply to comment #4)
> (In reply to comment #3)
> > The problem you're having is that ypserv is not being run with the '-p 
1000' 
> option.
> > Running '/etc/init.d/ypserv start -p 1000' will not run 'ypserv -p 1000' 
it 
> will
> > only run the ypserv init script (with the options specified there).
> > The best thing to do is add the following line to /etc/sysconfig/network
> > YPSERV_ARGS=-p 1000
> > Then run 'service ypserv stop', then 'service ypserv start'.
> > Let me know how that works.
> Yes, it is working now!!!!
> Two points
> 1. The line you give won't work until double quote is added to "-p 1000":
>    YPSERV_ARGS="-p 1000"
> 2. So the man page of ypserv should be updated :)
> Thank you very much!!! You are great! This issue can be closed.

I would like to know the solution to "ypbind": how to bind ypbind to a 
specific port? I tried with this line in /etc/sysconfig/network (change your 
YPSERV variable to YPBIND), but it doesn't work:
YPBIND_ARGS="-p 1001"

On my NIS client machines, I also need to filter the ypbind port through my 
firewall to allow nis client connection to nis server, right? Correct me if I 
am wrong :)

Thanks a lot.....

Comment 6 Chris Feist 2005-10-31 10:43:47 EST
ypserv & ypbind use rpc (port 111), so there is no need to specify a port for
ypbind.

Note You need to log in before you can comment on or make changes to this bug.