Solaris Transition Guide

Chapter 6 User Environment Administration

This chapter describes differences in tasks you may perform to set up the local user environment after installing the Solaris 7 software.

Selecting a Default Shell

The login shell is the command interpreter that runs when you are logged in. The Solaris 7 operating environment offers three shells:

If you use the shell often, you may prefer to use the C shell or the Korn shell because of their interactive capabilities. Table 6-1 lists the features of all three shells.

Table 6-1 Basic Features of the Bourne, C, and Korn Shells

Feature 

Bourne 

Korn 

Syntax compatible with sh

Yes 

No 

Yes 

Job control 

Yes 

Yes 

Yes 

History list 

No 

Yes 

Yes 

Command-line editing 

No 

Yes 

Yes 

Aliases 

No 

Yes 

Yes 

Single-character abbreviation for login directory 

No 

Yes 

Yes 

Protect files from overwriting (noclobber) 

No 

Yes 

Yes 

Ignore Control-D (ignoreeof)

No 

Yes 

Yes 

Enhanced cd

No 

Yes 

Yes 

Initialization file separate from .profile

No 

Yes 

Yes 

Logout file 

No 

Yes 

No 

To change from one shell to another, use one of the following methods:

After you change to a new shell, log out and log in again to activate the shell.

Customizing User Environments

This section describes how to determine which initialization files you can edit to customize the local environment based on your choice of login shell, and where to find them in the SunOS release 5.7 file systems. Set up your environment by editing the variables in the initialization files. The default shell determines which files you need to edit: .profile, .login, or .cshrc. Table 6-2 shows the initialization files for the Bourne, C, and Korn shells.

Table 6-2 Initialization Files for Bourne, C, and Korn Shells

Shell 

Initialization File 

Purpose 

Bourne

/etc/profile

Defines system profile at login 

 

$HOME/.profile

Defines user's profile at login 

C

/etc/.login

Defines system environment at login 

 

$HOME/.cshrc

Defines user's environment at login 

 

$HOME/.login

Defines user's profile at login 

Korn 

/etc/profile

Defines system profile at login 

 

$HOME/.profile

Defines user's profile at login 

 

$HOME/ksh_env

Defines user's environment at login in the file specified by the ksh_env variable

In this release, the shell initialization-file templates have moved to the /etc/skel directory from /usr/lib, where they were in the SunOS release 4.x software. The template file locations are shown in Table 6-3. Copy the template file (or files) for the appropriate default shell to your home directory before you modify it.

Table 6-3 Default Home Directory Startup Files

Shell 

File 

Bourne

/etc/skel/local.profile

C

/etc/skel/local.login

/etc/skel/local.cshrc

Korn

/etc/skel/local.profile

For information on setting up initialization files, see System Administration Guide, Volume I.

Using the SunOS 4.x Work Environment With the Solaris Software

The SunOS release 5.7 software can use the old SunOS release 4.x system files and initialization files such as .login, .cshrc, and.profile to re-create the look and feel of the SunOS release 4.x work environment. Many of these SunOS release 4.x files can be converted, or used as they are, and executed easily.

The installation process in Chapter 3, Converting a SunOS 4.x System to the Solaris 7 Environment, explains how to re-create the SunOS release 4.x environment within the Solaris 7 operating environment.

Window Systems

The Common Desktop Environment (CDE) is the default Solaris 7 windowing environment and offers a simple and intuitive interface. See Chapter 14, Solaris Common Desktop Environment, for more information about CDE.

The OpenWindows 3.1 software can also be used as your preferred desktop with the Solaris 7 environment. If you have been using the OpenWindows 2.0 environment, you will notice that the OpenWindows 3.1 icons have changed and some applications are not compatible with the OpenWindows 3.1 platform.

The OpenWindows Developer's Guide File Chooser (gfm) regular-expression file-pattern matching code (filter_pat) is slightly different from the regular-expression file-pattern matching code in the XView(TM) File Chooser object. This could result in the same regular expression matching slightly different sets of files in the two different choosers. The XView File Chooser uses /usr/include/reexp.h in the SunOS release 5.7 software and its usage is correct.

SunView(TM) software is not part of the Solaris 7 operating environment. SunView applications are incompatible with the OpenWindows environment and must be converted.

See OpenWindows Version 3.1 User's Guide for information about:

User and Group Administration

This section describes your options for performing user and group administration.

User and Group Administration Choices

You can add, modify, and remove users and groups through the command-line interface using useradd, userdel, and usermod. Although these commands are not as robust as Admintool, they do enable you to do most of the tasks supported by Admintool from the command line without running the OpenWindows or CDE software.

The useradd, userdel, and usermod commands are similar to editing the /etc files in that they also affect only the local system. These commands cannot be used to change any information in the network naming service. However, you can use useradd to verify the uniqueness of the user name and user ID and the existence of group names in the network naming service.

Adding User Accounts

This section describes changes to the general procedure for adding user accounts.

The general procedure for adding new users to a SunOS release 4.x system was:

  1. Edit the /etc/passwd file and add an entry for the new user.

  2. Create a home directory and set the permissions for the new user.

  3. Set up skeletal files for the new user (.cshrc, .login, .profile, and so on).

  4. Add the new user to the naming service (NIS).

In the Solaris 7 operating environment, there are three ways to add (and maintain) user accounts:


Note -

Because the SunOS release 5.7 software uses a shadow password file, simply editing the /etc/passwd file is no longer sufficient. You should not attempt this method unless you have ample experience with this type of administration.


System Administration Guide, Volume I describes in detail the policy decisions you should consider before you begin to set up accounts. It also explains security considerations for controlling user access to systems and networks.

Using Mail

The SunOS release 4.x mail programs are different in the Solaris 7 operating environment; however, procedures for setting up mail are still the same. The SunOS release 4.x version of mail is included in the SunOS/BSD Source Compatibility Package. Its user interface is different from the Solaris 7 operating environment's version of mail. Additionally, some useful mail facilities are included for compatibility.

In the Solaris 7 operating environment, there are three programs for sending and retrieving your mail. All three are backward compatible and can be used to read your SunOS release 4.x mail. They are:

For a complete discussion of all Solaris 7 mail programs, see Mail Administration Guide.

Using Document Tools

This section outlines the main differences in using document tools between SunOS release 4.x and the Solaris 7 operating environment.

Man Page Organization Differences

Man page organization has changed to be compatible with SVR4 organization. As a result, some sections have been renamed. For example, man(8) is now man(1M).

Table 6-4 shows SunOS release 5.7 man page directories.

Table 6-4 SunOS release 5.7 man Page Directories

/man Directory

Contents 

Suffixes 

man1

User commands 

1B - SunOS/BSD compatibility commands 

 

 

1C - Communication commands 

 

 

1F - FMLI commands 

 

 

1S - SunOS commands 

man1M

System administration commands 

 

man2

System calls 

 

man3

Library functions 

3B - SunOS/BSD compatibility libraries 

 

 

3C - C library functions 

 

 

3E - ELF library functions 

 

 

3G - C library functions 

 

 

3I - Wide Character functions 

 

 

3K - Kernel VM library functions 

 

 

3M - Math library 

 

 

3N - Network functions 

 

 

3R - RPC services library 

 

 

3S - Standard I/O functions 

 

 

3T - Threads library functions 

 

 

3X - Miscellaneous library functions 

man4

File formats 

4B - SunOS/BSD compatibility file formats 

man5

Headers, tables, and macros 

 

man7

Special files 

 

man9

DDI/DKI 

 

man9E

DDI/DKI entry points 

 

man9F

DDI/DKI kernel functions 

 

man9S

DDI/DKI data structures 

Customizing the man Command Search Path

Unlike in the SunOS release 4.x software, which searched the individual man directories according to a predetermined order, the SunOS release 5.7 software lets you determine the search path. The man command uses the path set in the man page configuration file, man.cf.

Each component of the MANPATH environment variable can contain a different man.cf file. You can modify man.cf to change the order of the search; for example, to search 3b before 3c. The configuration file for the /usr/share/man directory follows.

#
# Default configuration file for the on-line manual pages.
#

MANSECTS=1,1m,1c,1f,1s,1b,2,3,3c,3s,3x,3i,3t,3r,3n,3m,3k,3g, \
3e,3b,9f,9s,9e,9,4,5,7,4b,6,l,n

The arguments to MANSECTS are derived from the man subdirectories available. The number of subdirectories has increased dramatically in this release because each subsection has its own directory. This new structure improves the performance of the man command and gives you finer control over the search path. The next two figures compare the man directories for the two releases.

sunos4.1% ls /usr/share/man
man1/   man2/   man3/   man4/   man5/   man6/   man7/   man8/  
manl/   mann/

sunos5.6% ls /usr/share/man
man.cf  man1f/  man3/   man3g/  man3n/  man3x/  man6/   man9f/
man1/   man1m/  man3b/  man3i/  man3r/  man4/   man7/   man9s/
man1b/  man1s/  man3c/  man3k/  man3s/  man4b/  man9/   manl/
man1c/  man2/   man3e/  man3m/  man3t/  man5/   man9e/  mann/

whatis and windex Databases

The SunOS release 4.x man page table of contents and keyword database is called whatis. In the SunOS release 5.7 software, this information is in the windex file. In both releases, the database is created by the catman command, and is used by the man, apropos, and whatis commands.

The windex file also has a slightly different format than the whatis file, as you can see from the following comparison of the two release versions.

sunos4.1% man -k tset
tset, reset (1)    - establish or restore terminal characteristics

sunos5.6% man -k tset
reset  tset (1b)   - establish or restore terminal characteristics
tset   tset (1b)   - establish or restore terminal characteristics

Using the man Command

Table 6-5 shows that SunOS release 5.7 version of the man command has additional search options.

Table 6-5 New man Command Options

Option 

Description 

-a

Displays all man pages that match file name. The pages are displayed sequentially in the order they are found.

-l

Lists all man pages that match file name. You can use the output of this command to specify a section number with the -s option.

-s section-number

Searches section-number for file name. In the SunOS release 4.x software, the man command accepted the section number as an option; in this release, the section number must be preceded by -s.

-F

Forces the man command to search all directories until file name is found. This option overrides the windex database and the man.cf file.

See the man(1) man page for a complete description of the SunOS release 5.7 man command.