15.5. Creating and Editing RPC Programs

RPC is a protocol and data format that is the basis for other protocols like NFS and NIS. RPC clients make function calls to RPC servers, passing parameters and getting back results. To the client or server, making a remote procedure call is no more difficult than calling a normal library function, which makes writing programs that use RPC much easier than creating your own protocol from scratch.

An RPC program is a set of functions that are handled by a server. Each program has a unique number, similar to the port of an Internet service. Programs are not associated with a particular protocol, as they can generally accept connections and function calls via UDP or TCP. Nor do they have a fixed port, as they are assigned dynamically when needed.

RPC servers (like the NIS and NFS servers) that handle a large amount of traffic have their own processes that run all the time. However, some servers that need to be run only occasionally can be executed by inetd only when needed—just like infrequently used Internet services. Some of the more commonly used RPC programs are:

On some systems, these RPC programs may be handled by servers that are not run from inetd but instead as stand-alone processes. In that case, the Bootup and Shutdown module (explained in Chapter 9) is the place to activate or de-activate them. Due to the small number of common RPC programs and their limited usefulness, many Linux distributions do not have any programs enabled or disabled in the inetd configuration by default. However, this is not the case on other operating systems like Solaris.

Table 15.2. Common RPC Programs and Their Purposes
Program namePurpose
rquotadRemote disk quota retrieval. If a system is NFS-exporting a filesystem with quotas, this program can be used by the quota command on the client to display used and available blocks and files on the NFS-mounted filesystem.
rusersdRequesting the list of users logged into a system. The rusers command can be used to display users logged into one or more servers.
walldBroadcasting a message to users on a server. Like the wall command for sending a message to local users, the rwall command sends to users on another system by calling this RPC program.

If you want to make use of an RPC protocol which is not currently enabled, you can use this module to turn it on. Of course the appropriate RPC server program must be installed first, and the inetd on your system must support RPC programs. If so, the steps to follow are:

1.
On the main page of the module, click on the program name from the RPC Programs table. This will take you to the program editing form shown in Figure 15.3.

Figure 15.3. The RPC program editing form.


2.
Under the Server Program section, select the Program enabled option. If Program disabled was selected previously, then all the other settings in the section should be correct and will not need to be changed. However, if No program assigned was checked, you will need to fill in several other fields.

The RPC Versions field should be set to the range of versions that the server program supports, such as 1-3.

The Socket Type field should be set to Datagram, and the Protocol field set to only the udp option.

For the Server Program field, enter the full path to the RPC program, such as /usr/sbin/rpc.rusersd. For the Command field, enter the program name and any arguments, such as rpc.rusersd –a.

For the Wait Mode, select Don't wait.

For the Execute as User field, enter the username you want the server program to run as—usually root.

3.
When done, click the Save button. As long as there are no errors in your input, you will be returned to the main page of the module where the RPC program should appear as enabled.

4.
Click the Apply Changes button to make the program active.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.59.205.183