[comp.bugs.sys5] Adding lp service via pmadm

knightp@liberty.rtp.dg.com (Philip Knight) (04/16/91)

I'm on a V.4 system and am attempting to add the lp service to the listen(1M)
port monitor via the pmadm(1M) command.  Page 9-14 of the V.4 System
Administrator's Guide gives the following syntax:

   pmadm -a -p tcp -s lp -i root -V `nlsadmin -V` \
   -m `nlsadmin -o /var/spool/lp/fifos/listenS5`

I get no errors when I execute this command and pmadm -l indicates that the
service has been added successfully.  What I don't understand, however, is
why there is no private address (provided via -A option of the nlsadmin
command) associated with the service.  Does listen moditor a default address
if neither a private address nor dynamic addressing (via the -D option to
nlsadmin) is specified?  Is this an error in the documentation?

davidm@cbmvax.commodore.com (David Miller - CATS) (04/16/91)

In article <1991Apr15.193742.8575@dg-rtp.dg.com> knightp@liberty.rtp.dg.com (Philip Knight) writes:
|I'm on a V.4 system and am attempting to add the lp service to the listen(1M)
|port monitor via the pmadm(1M) command.  Page 9-14 of the V.4 System
|Administrator's Guide gives the following syntax:
|
|   pmadm -a -p tcp -s lp -i root -V `nlsadmin -V` \
|   -m `nlsadmin -o /var/spool/lp/fifos/listenS5`
|
|I get no errors when I execute this command and pmadm -l indicates that the
|service has been added successfully.  What I don't understand, however, is
|why there is no private address (provided via -A option of the nlsadmin
|command) associated with the service.  Does listen moditor a default address
|if neither a private address nor dynamic addressing (via the -D option to
|nlsadmin) is specified?  Is this an error in the documentation?

No, no error, there is no address for the lp service.  The address
used is that of the listener service.  The remote system asks the
listener for a connection to the lp service.  The listener has a "well
know address" that other systems will use to connect to the local
system, then request a local service; in this case lp.

If you look a little further in the SAG, you'll see the entry for
accepting connections from systems using the lpr/lpd service.  Lpd
expects to connect to a specific address, so the -A option is used to
provide the address that lpd wants.

DavidM
davidm@commodore.cbm.com

lars@iclswe.icl.se (Lars Tunkrans) (04/17/91)

knightp@liberty.rtp.dg.com (Philip Knight) writes:

>I'm on a V.4 system and am attempting to add the lp service to the listen(1M)
>port monitor via the pmadm(1M) command.  Page 9-14 of the V.4 System
>Administrator's Guide gives the following syntax:

>   pmadm -a -p tcp -s lp -i root -V `nlsadmin -V` \
>   -m `nlsadmin -o /var/spool/lp/fifos/listenS5`

>I get no errors when I execute this command and pmadm -l indicates that the
>service has been added successfully.  What I don't understand, however, is
>why there is no private address (provided via -A option of the nlsadmin
>command) associated with the service.  Does listen moditor a default address
>if neither a private address nor dynamic addressing (via the -D option to
>nlsadmin) is specified?  Is this an error in the documentation?

I am at the moment investigating this area of SVR4. I would'nt say there
is an error in the documentation, but there is huge large holes in it.
( assuming we are talking of the AT&T system admin guide ) 
I'm not using TCP/IP I'm using OSI protocols so I dont have a tcp port-
monitor...  I give you the theory as I have understood it.

First you need an entry in /etc/netconfig for your network (tcp) cots in my
case: 

/etc/netconfig:

rawip	tpi_raw  	-	inet	-	/dev/rawip	/usr/lib/tcpip.so,/usr/lib/resolv.so
ticlts	   tpi_clts	  v	loopback	-	/dev/ticlts	/usr/lib/straddr.so
ticots	   tpi_cots	  v	loopback	-	/dev/ticots	/usr/lib/straddr.so
ticotsord  tpi_cots_ord	  v	loopback	-	/dev/ticotsord	/usr/lib/straddr.so
tcp	tpi_cots_ord	v	inet	tcp	/dev/tcp	/usr/lib/tcpip.so,/usr/lib/resolv.so
udp	tpi_clts  	bv	inet	udp	/dev/udp	/usr/lib/tcpip.so,/usr/lib/resolv.so
icmp	tpi_raw  	-	inet	icmp	/dev/icmp	/usr/lib/tcpip.so,/usr/lib/resolv.so
osl	tpi_cots	v	iso	osl	/dev/cots	/usr/lib/osladdr.so
oslc	tpi_clts	v	iso	oslc	/dev/clts	/usr/lib/osladdr.so
x25	tpi_cots	v	iso	x25	/dev/cots	/usr/lib/x25addr.so
cots	tpi_cots	v	osinet	-	/dev/cots	/usr/lib/ipaaddr.so
-------------
Then you need to add your hosts to the /etc/net/PORTMONITORNAME/hosts file.

/etc/net/cots/hosts

sw0104	sw0104
unicorn	unicorn
-------------
Yuo need to set up the network servicename in /etc/net/PORTMONITORNAME/services
the host and services files will be used to form the network path adress(name)
sw0104_serve in my case.  Read chapter 17 in sysadmin guide, "Network services"

/etc/net/cots/services

listen	serve
-------------
I have then a portmonitor configured  , cots below. The _sactab file is the
same as doing sacadm -l.

/etc/saf/_sactab

# VERSION=1

inetd:inetd::0:/usr/sbin/inetd	#internet daemon
mklisten:listen::0:/usr/lib/saf/listen cots	#
ttymon1:ttymon::0:/usr/lib/saf/ttymon	#
cots:listen::0:/usr/lib/saf/listen cots	#
pv0:ttymon::0:/usr/lib/saf/ttymon	#
--------------
The listing of the cots _pmtab below shows that there is a Network listener 
process ( the nlps_server ) which is really the answer to you question, that 
shedules service requests according to their service tags ,the first field 
in the file below, ofcourse this file comes from the system sending the 
lp-requests so you dont have your "lp" service tag here but I got it on
receiving system which you see one step further down. 

/etc/saf/cots/_pmtab

# VERSION=4
105::root:reserved:reserved:reserved:::c::/usr/net/servers/rfs/rfsetup#
0::root:reserved:reserved:reserved:unicor_serve::c::/usr/lib/saf/nlps_server#
-------------
This is the _pmtab for my cots portmonitor on the SVR4 system reciving lp-
requests. The lpNet process on the sending system is supposed to send a 
request to the receiving nlps_server asking it to invoke the "lp" service
which the puts the print request on the /var/spool/lp/fifos/listenS5 pipe.
from there the remote lpNet picks up the lp-request.

/etc/saf/cots/_pmtab

# VERSION=4
105::root:reserved:reserved:reserved:::c::/usr/net/servers/rfs/rfsetup#
0::root:reserved:reserved:reserved:sw0104_serve::c::/usr/lib/saf/nlps_server#
lp::root:reserved:reserved:reserved:::p::/var/spool/lp/fifos/listenS5#

I'm not saying this works for TCP/IP there might very well be additional 
tcp portadresses you need to set up. Anyway the AT&T documents gives you  
the info but its scatterd in several places, we would all have saved several
days of detective work if they'd put it all in the LP-admin chapter.

Hope this gives you some clues.
-- 
Lars Tunkrans  Phone +46 (0)76096368. |                 I C L 
      DRS Systems Support.            |    
UUCP: uunet!mcsun!sunic!iclswe!lars   |   The leading UNIX System V Release 4.0
DOMAIN Address : lars@iclswe.icl.se   |              integrator.