Florida web design - Inside Linux The following dialog demonstrates two techniques

Inside Linux The following dialog demonstrates two techniques to use ps to discover the existence of the portmapper. stimpy $ ps ax … 359 tty1 SN 0:05 kscd -caption CD Player -icon kscd.xpm 3348 tty1 SN 0:04 kvt -T ption Terminal -icon kvt.xpm -miniicon kvt.xpm 3349 pts/0 SN 0:00 bash 3475 ? SN 0:00 portmap 3476 pts/0 RN 0:00 ps ax … stimpy $ # ps ax | grep portmap 3475 ? SN 0:00 portmap 3480 pts/0 SN 0:00 grep portmap stimpy $ In the first example, the ps command is executed, listing all processes. You will have to look through all the entries to find the portmapper entry. In the second example, the grep command is utilized to ferret out the portmapper entry from the process listing; sometimes it is worth the extra keystrokes. The second technique to check for the existence of the portmapper is to use the rpcinfo command. This command is used to report RPC information. The following dialog demonstrates the use of the rpcinfo command to discover the existence of available RPC services. stimpy $ stimpy $ rpcinfo -p program vers proto port 100000 2 tcp 111 portmapper 100000 2 udp 111 portmapper stimpy $ As you can see, the portmapper is running on this system. Both the ps command and rpcinfo command confirm the portmapper’s existence. If the portmapper is not running, the output from rpcinfo will resemble the following dialog. stimpy $ rpcinfo -p rpcinfo: can’t contact portmapper: RPC: Remote system error - Connection refused stimpy $ For now, you started the portmapper by hand, but you will want to automate this task whenever the system boots. You can adapt the rc scripts to invoke the RPC portmapper at system start up. Your Linux distribution determines the directory location of the rc files. Some of the well-known locations are the /etc/init.d, /etc/rc.d/init.d, or /etc/rc.d directories. If the rpcinfo -p failed to report successfully, but the portmapper exists in the ps ax listing, you need to consult the /etc/hosts.allow and /etc /hosts.deny files. The reason that rpcinfo might be reporting failure is because all access to the portmapper is governed by the entries in the /etc/hosts.allow and /etc/hosts.deny files. For a more detailed explanation, you should check out the man page for the tcpd daemon command. A man page may also exist on your distribution for hosts_access(5) (man 5 hosts_access). This man page goes into great detail about the two files previously mentioned. Another option for invoking the portmapper is to use the rpc command, if available. Normally, this file is found in the /etc/rc.d/init.d directory. Some Linux distributions may locate the file in the /etc/init.d directory. If you do not have a man entry for the rpc command, and the which command does not reveal the file, you can execute find to locate the command. The following dialog demonstrates the use of the rcp command: stimpy $ rpcinfo -p program vers proto port 100000 2 tcp 111 portmapper 100000 2 udp 111 portmapper stimpy $ ./rpc stop Shutting down RPC services done stimpy $ rpcinfo -p rpcinfo: can’t contact portmapper: RPC: Remote system error - Connection refused stimpy $ ./rcp start stimpy $ Starting RPC portmap daemon done stimpy $ rpcinfo -p program vers proto port 100000 2 tcp 111 portmapper 100000 2 udp 111 portmapper stimpy $ page 216
Searching for affordable and reliable webhost to host and run your web applications? Go to our java web server services and you will be pleased.

Leave a Reply