6.2. Uploading Packages to RHN Satellite Server

The RHN Push application allows you to serve custom packages associated with a private RHN channel through the RHN Satellite Server. If you want the RHN Satellite Server to serve only official Red Hat Enterprise Linux packages, you do not need to install RHN Push.

To use RHN Push, install the rhnpush package and its dependencies. This package is available to registered RHN Satellite Server systems and is installed by running up2date rhnpush.

RHN Push uploads RPM header information to the RHN Satellite Server database and places the RPM in the RHN Satellite Server package repository. Unlike the RHN Proxy Server's RHN Package Manager, RHN Push never distributes package information, even the headers, beyond the RHN Satellite Server database.

TipTip
 

If your Satellite installation is enabled to support Solaris OS systems, you may use RHN Push from a Solaris client to upload Solaris package content to custom Solaris channels.

6.2.1. Configuring the RHN Push Application

When RHN Push is installed, a central configuration file is installed in /etc/sysconfig/rhn/rhnpushrc. This file contains values for all the options contained in Table 6-2. In addition, the application creates ~/.rhnpushrc and ./.rhnpushrc upon its initial use.

These distinct configuration files are useful in varying your settings depending on the directory from which the rhnpush command is issued. Settings in the current directory (./.rhnpushrc) take precedent over those in the user's home directory (~/.rhnpushrc), which are used before those in the central configuration file (/etc/sysconfig/rhn/rhnpushrc).

For instance, you can use the current directory configuration file to specify the software channel to be populated, the home directory configuration file to include the username to be invoked, and the central configuration file to identify the server to receive the packages.

Table 6-2 contains all command line options for the rhnpush command:

OptionDescription
-v --verboseIncrease verbosity, option can be used multiple times, that is, -vv, -vvv, and so forth.
-d, --dir DIRECTORYProcess packages from this directory.
-c, --channel CHANNEL_LABELSpecify the channel to receive packages. Note that this is required and is not the same as the channel's name. Multiple channels may be specified using multiple instances of -c (e.g. -c=CHANNEL_ONE -c=CHANNEL_TWO).
-n, --count N_HEADERS_PER_CALLProcess this number of headers per call. Must be an integer. The default number is 25.
-l, --listList only the specified channels.
-r, --reldirRELATIVE_DIRECTORYAssociate this relative directory with each file.
-o, --orgidORGANIZATION_IDInclude your organization's ID number. Must be an integer.
-u , --username USERNAMEInclude the RHN username of the user that has administrative access to the specified channel. If not provided, rhnpush prompts for the username of a valid Channel Administrator. The username and password are cached in ~/.rhnpushcache for a limited time, five minutes being the default. Use --new-cache to force a new username and password.
-p , --password PASSWORDInclude RHN password of user that has administrative access to the specified channel. If not provided, rhnpush prompts for the password of a valid Channel Administrator. The username and password are cached in ~/.rhnpushcache for a limited time, five minutes being the default. Use --new-cache to force a new username and password.
-s, --stdinRead package list from standard input, for example from a piped ls command.
-X, --exclude GLOBExclude packages that match this glob expression.
--forceForce upload of a package, even if a package of that name and version currently exists in the channel. Without this option, uploading a pre-existing package returns an error.
--nosigDon't fail if packages are unsigned.
--new-cacheForces RHN Push to drop the username and password cache, then accept or ask for new ones. This is useful if you make a mistake entering them the first time.
--newestPush only the packages that are newer than those on the server. Note that source packages are special in that their versions are never compared to each other. Their newness is dependent on their associated binary packages. Using this option with RHN Push and just a source package does upload the package, but the source package does not appear in the RHN Web interface until the associated binary package has been uploaded. Contrast this with --source. Using --source --newest together does update the stand-alone source package with newer packages and does not require an associated binary package to be uploaded first.
--headerUpload only the headers.
--sourceUpload the indicated source packages. Doing this treats them as plain, stand-alone packages and not as special source packages associated with another, pre-existing binary package. For example, you can use this when you want to distribute application source to developers and testers outside of regular source control management.
--server SERVERSpecify the server to which packages are uploaded. Currently, a value of http://localhost/APP is necessary. This parameter is required.
--testOnly print a list of the packages to be pushed, don't actually push them.
-h, --helpBriefly describe the options.
-?, --usageView the usage summary.

Table 6-2. rhnpush options

TipTip
 

These command line options are also described in the rhnpush manual page: man rhnpush.

6.2.2. Using the RHN Push application

NoteNote
 

It is recommended that you create at least one private channel to receive custom packages prior to upload, since a channel is required for systems to obtain the packages.

The following command uploads package headers to the RHN Satellite Server and copies the packages to the RHN Satellite Server package repository:

rhnpush -c label_of_private_channel pkg-list

You can override the settings in your RHN Push configuration file(s) by specifying options and values on the command line:

rhnpush -c label_of_private_channel --server localhost pkg-list

The label_of_private_channel is the custom channel created to receive these packages. Be sure you use the precise channel label specified during its creation. If you have one or more channels specified (using -c or --channel), the uploaded package headers are linked to all the channels identified. If you do not specify a channel, the packages are deposited in the No Channels section of the Package Management page. Refer to Section 4.6 Assigning Packages to Software Channels for instructions on reassigning packages.

The --server option specifies the server to which the packages are installed, and is required. RHN Push can be installed on external systems, but running RHN Push locally on the RHN Satellite Server is recommended.

The pkg-list reference represents the list of packages to be uploaded. Alternatively, use the -d option to specify the local directory that contains the packages to be added to the channel. RHN Push can also read the list of packages from standard input (using --stdin).