AIX 4.X Hints, Tips, and Reference

AIX 4.X Hints, Tips, and Reference

Working with /etc/inittab
Manipulating /etc/services
The RS/6000 LED
Manipulating crontab
Manipulating /etc/exports
Bos Install and NIM

Working with /etc/inittab

The inittab file provides the init program with instructions for creating and running initialization processes. The init program reads the inittab file each time init is invoked. The file typically contains instructions for the default initialization, the creation and control of processes at each run level, and the getty command, which controls the activation of terminal lines.

For more detailed information and examples, see the man pages for the appropriate commands.

There are several AIX commands to manipulate the /etc/inittab file without directly editing it. While it is possible to directly edit /etc/inittab, the supported commands for modifying the records in the file are:

It is possible to render a system inoperable and recoverable only by network boot by messing up the /etc/inittab file. Be careful!

lsitab { -a | Identifier }

The lsitab command displays a record in the /etc/inittab file. You can display all of the records in the /etc/inittab file, or use the Identifier parameter to display a specific record. The Identifier parameter is a 14-character field that uniquely identifies an object. The -a flag specifies to list all records in the /etc/inittab file.

To list entry 'hardmon' in /etc/inittab:

lsitab hardmon

chitab { [ Identifier ] : [ RunLevel ] : [ Action ] : [ Command ] }

The chitab command changes a record in the /etc/inittab file. The Identifier:Run Level:Action:Command parameter string is the new entry to the /etc/inittab file. You can search for a specific record by using fields in the Identifier portion of the parameter string. The command finds the specified Identifier and changes that record.

mkitab [ -i Identifier ] { [ Identifier ] : [ RunLevel ] : [ Action ] : [ Command ] }

The mkitab command adds a record to the /etc/inittab file. The Identifier:RunLevel:Action:Command parameter string specifies the new entry to the /etc/inittab file. You can insert a record after a specific record using the -i Identifier flag. The command finds the field specified by the Identifier parameter and inserts the new record after the one identified by the -i Identifier flag.

To create entry 'hardmon' in /etc/inittab:

mkitab "hardmon:2:once:/usr/bin/startsrc -s hardmon"

rmitab Identifier

The rmitab command removes an /etc/inittab record. You can specify a record to remove by using the Identifier parameter. The Identifier parameter specifies a field of one to fourteen characters used to uniquely identify an object. If the Identifier field is not unique, the command is unsuccessful.

To remove entry 'hardmon' in /etc/inittab:

rmitab hardmon

BOS Install and NIM tips

The BOS install scripts are found in /usr/lpp/bosinst. The more interesting script is bi_main. This controls almost all of the install process from a CD or if installing over a network, after NIM is out of the way.

One of the more useful install debugging techniques is turning on the bos install -x option so you can see the script commands as they happen. In order to do this, you will have to have access to the front panel key.

The procedure to enable the bos install debug output is as follows: Boot your system in install mode (from CD, Tape, or Network) When the 'c40' led is displayed, turn key to SECURE Wait for the led to display 'eee', then turn key to SERVICE Wait for the led to display 'ddd', then turn key to NORMAL

To do this on an SP system, a bit more setup is involved. The following procedure does not take into account the ability to have more than one version of AIX installed on the SP complex.

  1. Deallocate resources that might be in use: unallnimres

  2. Remove the /tftpboot/spot* files on the boot/install server: rm /tftpboot/spot_*

  3. Get the spot and lpp_source names:
    lnsim -t spot (SPOT_NAME) lsnim -t lpp_source (LPPSOURCE_NAME)
    Your AIX_LEVEL is everything following the '_' in the spot and lpp_source names.

  4. Edit the /spdata/sys1/install//spot//usr/lpp/bosinst/bi_main:

    • Find the '0xeee' string and change the sleep call after it from 3 seconds to 30 seconds.
    • Find the '0xddd' string and change the sleep call after it from 3 seconds to 30 seconds.
    • Find the '0xA40' string and add a line below it: 'sleep 30'.
    • Save the changes (after backing up the original, of course).

  5. Rebuild your boot images by issuing: nim -o cust -a lpp_source=

Producing Debug Output for NIM BOS Installations

Creating a debug SPOT can be very useful in debugging installation problems. In order to create a debug spot, issue the following commands:

  1. Create debug versions of the network boot images using the check operation from the VSM or the SMIT interfaces or by using the following command:

    nim -o check -a debug=yes SPOTNAME

  2. Get the address for entering the debugger using the following command:

    lsnim -l SPOTNAME

    where SPOTNAME is the name of your SPOT. Write down the enter_dbg address for the client you are going to boot.

  3. Attach a tty to the client system (port 1).
  4. Network boot the machine
  5. After loading the debug SPOT, you will be given the debugger's '>' prompt.

    st enter_dbg_value 2

  6. Type g for go and press enter to start the boot process.


  7. Use ctrl-S and ctrl-Q to stop and resume the output.
  8. To rebuild your boot images in non-debug mode, use the following command:

    nim -o check -a debug=no SPOTNAME

    You will continue to get the debugger's prompt for any client booted with this SPOT until you remove debug.

To check the psspspot after PTFs installed:

  1. nim -o sync_roots psspspot
  2. nim -Fo check psspspot

To rebuild the psspspot resource for install:

  1. set all nodes to disk boot:
    /usr/lpp/ssp/bin/SDRChangeAttrValues Node bootp_response=disk
  2. run setup_server to deallocate the spot image:
  3. remove the spot image:
    /usr/sbin/nim -o remove psspspot
  4. set node response to 'install' for desired nodes
    /usr/lpp/ssp/bin/SDRChangeAttrValues Node bootp_response=install
  5. run setup_server to recreate the spot image:

Manipulating /etc/services

The chservices command adds, deletes, or changes entries in the /etc/services file. These entries are related to known services used in the DARPA Internet and also related to information used by the inetd server. The entries for the inetd server determine how the system handles Internet service requests. It is possible to edit this file directly, but the supported commands to manipulate the file are:

For additional information, see the man page for chservices(1).

Adding or Activating an entry

chservices [ -a ] -v ServiceName -p protocol -n port [ -u "Alias ..." ]

Changing an entry

chservices -c -v ServiceName -p protocol -n port [ -V NewServiceName ] [ -P NewProtocol ] [ -N NewPort ] [ -u "Alias ..." ]

Deactivating an entry

chservices -d -v ServiceName -p protocol -n port [ -V NewServiceName ] [ -u Alias ..." ]

Manipulating the /etc/exports file

The /etc/exports file controls the access and availability for remote hosts to mount filesystems from a host. It is possible to edit this file directly, but after editing or changing /etc/exports it is necessary to run /usr/bin/exportfs to make changes effective. Supported commands for modifying /etc/exports are: