Sun Microsystems - Solaris Support website.

Wednesday, December 14, 2005

Backup, Restore, and Disaster Recovery on a System With Zones Installed

Penny Cotten, November 2005

Backup, restore, and disaster recovery are critical elements of data management. When you use zones, the requirements of your organization will dictate the solution you choose to back up your system running the Solaris Operating System (OS).

Backing up file systems means copying file systems to removable media, such as tape, to safeguard against loss, damage, or corruption. Restoring file systems means copying current backup files from removable media to a working directory.

This document discusses various methods for backing up zone configurations and data on your system, and provides recommendations on the different methodologies that can be used.


Determining Where to Perform the Backup

You can perform backups in individual non-global zones, or you can back up non-global zones from the global zone.

Backing Up LOFS Directories

Because many non-global zones share files with the global zone through the use of loopback file system read-only mounts (usually /usr, /lib, /sbin, and /platform), it is important to use a global zone backup strategy to back up LOFS directories. Backing up the LOFS file systems in non-global zones is not advisable. Restoring in this situation will be impossible, and any attempt by the non-global administrator to do so could cause a serious problem.

Backing Up Your System From the Global Zone

You might choose to perform your backups from the global zone if:

  • You have network backup software such as Symantec/VERITAS NetBackup.

  • You want to back up the configurations of your non-global zones as well as your application data.

  • Your primary concern is disaster recovery. If you need to restore everything or almost everything on your system, including the root file systems of your zones and their configuration data as well as the data in your global zone, it is best to use the global zone as the point where the backup takes place.

  • You want to use ufsdump to perform a data backup. Because importing a physical disk device into a non-global zone would change the security profile of the zone, ufsdump should only be used from the global zone.

Backing Up Individual Non-Global Zones on Your System

You might decide to perform your backups within the non-global zones if:

  • Non-global zone administrators want to back up the data in the zones they administer so that they can recover from less serious failures or restore application or user data specific to a zone.

  • You want to use programs that back up on a file-by-file basis, such as tar(1) or cpio(1).

  • You use the backup software of a particular application or service running in a zone. It might be difficult to execute the backup software from the global zone because application environments, such as directory path and installed software, would be different between the global zone and the non-global zone.

    If the application can perform a snapshot on its own backup schedule in each non-global zone and store those backups in a writable directory exported from the global zone, the global zone administrator can pick up those individual backups as part of the backup strategy from the global zone.


Summary of Zone Backup Methods

The following sections summarize methods that can be used to back up files in zones.

Using ufsdump to Perform Backups

You can perform full or incremental backups using the ufsdump command. This procedure backs up the zone /export/zone1 to /backup/zone1.ufsdump, where "zone1" is replaced with the name of a zone on your system.

1. (Optional) You can shut down the zone before using the ufsdump command, to put the zone in a quiescent state and avoid backing up shared file systems.

global# zlogin -S zone1 init 0 

2. (Optional) Check the zone's status.

global# zoneadm list -cv

ID NAME STATUS PATH
0 global running /
- zone1 installed /export/zone1

3. Perform the backup.

global# ufsdump 0f /backup/zone1.ufsdump /export/zone1

DUMP: Date of this level 0 dump: Wed Aug 10 16:13:52 2005
DUMP: Date of last level 0 dump: the epoch
DUMP: Dumping /dev/rdsk/c0t0d0s0 (bird:/) to /backup/zone1.ufsdump.
DUMP: Mapping (Pass I) [regular files]
DUMP: Mapping (Pass II) [directories]
DUMP: Writing 63 Kilobyte records
DUMP: Estimated 363468 blocks (174.47MB).
DUMP: Dumping (Pass III) [directories]
DUMP: Dumping (Pass IV) [regular files]
DUMP: 369934 blocks (180.63MB) on 1 volume at 432 KB/sec
DUMP: DUMP IS DONE

4. Boot the zone.

global# zoneadm -z zone1 boot 

Creating a UFS Snapshot Using fssnap

This approach uses the fssnap command, which creates a temporary image of a file system intended for backup operations.

This method can be used to provide a clean, consistent backup of the zone files only, and it can be executed while zones are running. However, it is a good idea to suspend or checkpoint active applications that are updating files when the snapshot is created. An application updating files when the snapshot is created might leave these files in an internally inconsistent, truncated, or otherwise unusable state.

In the example procedure below:

  • There is a zone named zone1 under /export/home.
  • /export/home is a separate file system.
  • The destination backup is /backup/zone1.ufsdump. You must create /backup before you begin.

1. Create the snapshot:

global# fssnap -o bs=/export /export/home

/dev/fssnap/0

2. Mount the snapshot.

global# mount -o ro /dev/fssnap/0 /mnt 

3. Back up zone1 from the snapshot.

global# ufsdump 0f /backup/zone1.ufsdump /mnt/zone1

DUMP: Date of this level 0 dump: Thu Oct 06 15:13:07 2005
DUMP: Date of last level 0 dump: the epoch
DUMP: Dumping /dev/rfssnap/0 (bird:/mnt) to /backup/zone1.ufsdump.
DUMP: Mapping (Pass I) [regular files]
DUMP: Mapping (Pass II) [directories]
DUMP: Writing 32 Kilobyte records
DUMP: Estimated 176028 blocks (85.95MB).
DUMP: Dumping (Pass III) [directories]
DUMP: Dumping (Pass IV) [regular files]
DUMP: 175614 blocks (85.75MB) on 1 volume at 2731 KB/sec
DUMP: DUMP IS DONE

4. Unmount the snapshot.

global# umount /mnt 

5. Delete the snapshot.

global# fssnap -d /dev/fssnap/0 

Note that the snapshot is also removed when the system is rebooted.

Using find and cpio to Perform Backups

The following method uses find and cpio on a running zone.

1. Change directories to the / directory:

global# cd / 

2. Back up zone1 files that are not loopback mounted to /backup/zone1.cpio.

global# find export/zone1 -fstype lofs -prune -o -local |
cpio -oc -O /backup/zone1.cpio

3. Verify the results.

global# ls -l backup/zone1.cpio

-rwxr-xr-x 1 root root 99680256 Aug 10 16:13 backup/zone1.cpio

Using Network Backup Software to Back Up and Restore Your System

You can use a product such as Symantec/VERITAS NetBackup to back up or restore your Solaris system. Symantec/VERITAS NetBackup enables enterprise-wide coordination of backups, archives, and restores. A description of NetBackup support for Solaris 10 systems with installed zones is available at http://seer.support.veritas.com/docs/275107.htm.

The NetBackup client software is supported in a non-global zone. The NetBackup master server and media server are supported in the global zone. The NetBackup master server manages backups, archives, and restores. Media servers provide additional storage by allowing NetBackup to use the storage devices that they control, such as 4-mm tape drives.

You can restore entire systems or specific files and directories. NetBackup locates the selected files and directories and restores them to the disk on the client.

You do not have to change standard NetBackup architecture to apply it to a system with zones installed. You can treat each non-global zone as though it is a standalone server running the NetBackup client software.

The backup should be performed when the zone and its applications have quiesced the data to be backed up.

Note: Your network backup software should be configured to skip all inherited LOFS file systems if possible.

Tip: If you would like to consolidate servers or take advantage of the higher-network bandwidth between non-global zones on the same system as compared to wired networks, you can also co-locate the media server on the same system. The connection between the server and the storage device must have sufficient bandwidth for all backup streams.

Complete documentation for Symantec/VERITAS NetBackup products is available at:
http://www.sun.com/products-n-solutions/hardware/docs/Software/Storage_Software/VERITAS_NetBackup/index.html


Determining What to Back Up

You can back up everything in the non-global zone, or, because a zone's configuration changes less frequently, you can perform backups of the application data only.

Backing Up Application Data Only

If application data is kept in a particular part of the file system, you might want to perform regular backups of this data only. The zone's root file system might not have to be backed up as often because it changes less frequently.

Determining where an application places its files might prove more difficult than it would appear. Some files are stored in each user's home directory, some files are stored under /etc (mostly configuration data), and other files are kept under /var.

Assuming the application administrator knows where the data is stored, it might be possible to create a system in which a per-zone writable directory is made available to each zone. Each zone can then store its own backups, and this location can be used by the global administrator as one of the places on the system to back up.

General Database Backup Operations

If the database application data is not under its own directory, the following rules apply.

  • Ensure that the databases are in a consistent state first. Databases must be quiesced because they have internal buffers to flush to disk. Make sure the databases in non-global zones have come down before starting the backup from the global zone.
  • Within each zone, use file system features to make a snapshot of the data. Back up the snapshots directly from the global zone. This will minimize elapsed time for the backup window and remove the need for backup clients/modules in all of the zones.

Tape Backups

Each non-global zone can snapshot its private file systems when it is convenient for that zone, when the application has been briefly quiesced. Later, the global zone can back up each of the snapshots and put them on tape after the application is back in service.

This method has the following advantages:

  • It minimizes the number of tape devices needed.
  • There is no need for coordination between the non-global zones.
  • It doesn't require assigning devices directly to zones, which improves security.
  • Generally, it leaves system management in the global zone, which is preferred.

About Restoring Non-Global Zones

In the case of a restore where the backups were done from the global zone, the global administrator can reinstall the affected zones and then restore that zone's files. Note that this assumes:

  • The zone being restored has the same configuration as it did when the backup was done.
  • The global zone has not been upgraded or patched between the time when the backup was done and the time when the zone is restored.

Otherwise, the restore could overwrite some files that should be merged by hand.

For example, there could be a need to merge files by hand in the case of a global zone that has been subsequently patched after the backup, but prior to the restore of the non-global zone. In this case, you would have to be careful when restoring a zone's files that were backed up since a backed up file might not be compatible with the newly installed zone that was built after the patches were applied to the global zone. In this case, you would have to examine the files individually and compare them to the copies in the newly installed zone. In most cases, you will find that the file can be copied directly in, but in some cases, you must merge the changes originally made to the file into the newly installed or patched copy in the zone.

Note: In the case of a catastrophic loss of all file systems in the global zone, restoring everything in the global zone restores the non-global zones as well, as long as the respective root file systems of the non-global zones were included in the backup.

Backing Up Individual Zone Configurations for Future Use

You should make copies of your non-global zones' configurations in case you have to recreate the zones at some point in the future. You should create the copy of the zone's configuration after you have logged into the zone for the first time and responded to the sysidtool questions.

You can print the configuration of each zone to a file as shown below.

1. Become superuser, or assume the Primary Administrator role.

2. Print the zone configuration for a zone named zone1 to a file named zone1.config.

global# zonecfg -z zone1 export > zone1.config 

How to Restore Individual Non-Global Zones

To restore a non-global zone from a file created with the zonecfg export command, use the following procedure.

1. Become superuser, or assume the Primary Administrator role.

2. Specify that zone1.config be used as the zonecfg command file when recreating the zone:

global# zonecfg -z zone1 -f zone1.config 

3. Install the zone:

global# zoneadm -z zone1 install 

4. To prevent the system from displaying the sysidtool questions asked upon initial zone log in, delete the file zonepath/root/etc/.UNCONFIGURED. For example:

global# rm /export/home/zone1/root/etc/.UNCONFIGURED 

For more information about the sysidconfig(1M) questions asked the first time you log in to a non-global zone, see "Performing the Initial Internal Zone Configuration" in System Administration Guide: Solaris Containers-Resource Management and Solaris Zones.

5. (Optional) Manually restore (and possibly hand-merge) files such as application data backups into the newly created zone's file system.

Thursday, December 01, 2005

Duplex Printing in Solaris 10

Duplex Printing in Solaris 10

Introduction

I recently upgraded my system to the Solaris 10 OS and was faced with trying to get my printer configured so that I could print two-sided output to it.

The printer I'm using is a Brother HL-5170DN, and it works great with the Solaris OS, as it supports PostScript emulation natively, is networked, and even has support for two-sided output. All these features are provided at a price point that makes the device competitive with other personal laser printers.

The Solaris 10 OS has nice support for setting this up, but it is, unfortunately, not documented anywhere that I could find. (Fortunately for me, the filters involved were all in readable shell script form, so I could figure this out and pass it on to you.)

Initial Setup
First, you have to configure the print queue to use a PostScript Printer Description (PPD), by means of the Solaris OS lpadmin command. The Solaris 10 OS ships with PPDs for a bunch of printers, which are located in subdirectories organized as /usr/lib/lp/model/ppd. However, your printer, like mine, may not be listed. Generally you can get PPDs for the printer from the manufacturer.

If the printer does not support PostScript, it will probably not have a PPD from the manufacturer. Then the problem becomes a bit harder, particularly if a PPD for the printer, or a model very close to your printer, is not available. For the moment I'll assume that you have a PPD that works with your printer, either from the Solaris OS installation or from the printer manufacturer.

You will use the lpadmin utility to set up the print queue. Here is an example for my printer, which is on the network as the host name laser:

# lpadmin -p myprinter -v /dev/null -m netstandard_foomatic -o protocol=bsd,dest=laser -T PS -I postscript -n /usr/local/ppds/br_5170_2.ppd

In the above, -T PS and -I postscript indicate that this is a PostScript-capable printer; you need this to prevent the printing subsystem from trying to send ASCII banner pages to it.
The -n option indicates the location of my PPD file. Obviously, you will use the real location of your file, which might be a file in /usr/lib/lp/model/ppd, or it may be somewhere else on the system.

The -m, -v, and -o options basically configure access to the printer itself. If your printer is locally attached you might have something like this instead:

# lpadmin -p myprinter -T PS -I postcript -v /dev/ecpp0 -m standard_foomatic -n /usr/local/ppds/br_5170_2.ppd

You also need to configure lpsched, to enable the queue and printer, with these commands:

# accept myprinter
# enable myprinter

Testing
Having done this, you have a printer that is using the PPD, and you can now print duplex pages using the following command syntax:

% lp -d myprinter -o sides=two-sided-long-edge somefile.ps
You can use short-edge binding as well:
% lp -d myprinter -o sides=two-sided-short-edge somefile.ps
Finally, you can force single-sided printing:
% lp -d myprinter -o sides=one-sided somefile.ps

Setting Default Queue Options
OK, all that is nice, but having to specify those options is pretty annoying if you do this very often. A much simpler solution is to set the default for this queue, using the lpadmin command:

% lp -p myprinter -o sides=two-sided-long-edge
Voila! Now you can print just using normal lp commands and it will default to two-sided printing.

If your printer is networked, you can use this technique to set up different queues with different default options, which I find quite useful:

# lpadmin -p laser -v /dev/null -m netstandard_foomatic -o protocol=bsd,dest=laser -T PS -I postscript -n /usr/local/ppds/br_5170_2.ppd

# lpadmin -p lduplex -v /dev/null -m netstandard_foomatic -o protocol=bsd,dest=laser -T PS -I postscript -n /usr/local/ppds/br_5170_2.ppd -o sides=two-sided-long-edge

# lpadmin -p sduplex -v /dev/null -m netstandard_foomatic -o protocol=bsd,dest=laser -T PS -I postscript -n /usr/local/ppds/br_5170_2.ppd -o sides=two-sided-short-edge

All of the other ordinary printer administration commands work with these queues, too. For example, I have disabled banner pages with this command:

# lpadmin -p myprinter -o banner=never

Other Options
The foomatic filters also have support for other options, which I have not fully explored yet. For example, this foomatic-rip option can select the type, size, and location of print media:

-o media=x,y,z

This option can specify the paper size, tray, and type of paper.

-o media=Letter
-o media=Letter,MultiPurpose
-o media=Letter,Transparency
-o media=Letter,MultiPurpose,Transparency

Paper sizes can be one of the following:

Letter, Legal, A4, COM10, DL
Trays are defined by the PPD, but examples might be:
Upper, Lower, MultiPurpose, LargeCapacity

I want to thank Garrett D'Amore, and the contribution of the opensolaris community of IRC. They have help me all the way in my learning path of the Solaris 10 OS.

Sendmail Configuration for Solaris 10

Sendmail Configuration for Solaris 10

This document is a quick reference for those who already know about sendmail. Before you configure sendmail, you must configure the DNS server.

Step 1. Check that the necessary packages are installed to configure the mail server.

Step 2. Install the SFWimap package:
pkgadd -d SFWimap

Step 3. To edit the /etc/mail/sendmail.cf file, open it with vi editor.
Find the word CW and then replace it with CWexample.com.

Step 4. Add the following three lines in the /etc/inetd.conf file:
map stream tcp nowait root /opt/sfw/sbin/imapd imapd
pop2 stream tcp nowait root /opt/sfw/sbin/ipop2d ipop2d
pop3 stream tcp nowait root /opt/sfw/sbin/ipop3d ipop3d

Step 5. Add this line in the DNS forward zone file:
mail IN A 192.168.1.1

Step 6. Reboot the machine.

Step 7. Now test the mail.

I want to thank Mohammad Shafiuddin Sharif, and the contribution of the opensolaris community of IRC. They have help me all the way in my learning path of the Solaris 10 OS.

FTP Server Configuration

FTP Server Configuration

This tech tip can help users access a server from a remote location, and they can upload and download files from this server using FTP.

This document is a quick reference for those who already know about using FTP.

Step 1. Check that the daemon is located in /usr/sbin/in.ftpd.

Step 2. Edit the /etc/inetd.conf file:
ftp stream tcp6 nowait root /usr/sbin/in.ftpd in.ftpd

Make sure you perform inetconv after all so SMF get the conversion.

Step 3. If you put the # sign before the line of code in Step 2, and reboot the machine, the ftp daemon will not work.

Step 4. Restrict the user from the /etc/ftpusers file, as per your requirements.

I want to thank Mohammad Shafiuddin Sharif, and the contribution of the opensolaris community of IRC. They have help me all the way in my learning path of the Solaris 10 OS.

DNS CONFIGURATION IN SOLARIS 10

DNS CONFIGURATION IN SOLARIS 10

This community-submitted tech tip can serve as a quick reference for configuring DNS servers in a Solaris environment. The document is for readers who already know about DNS servers and how they work, and it may be useful for those who want to configure their ISPs (Internet service providers).

Step 1. First check that the necessary packages are installed to configure DNS.

Step 2. Configure the IP address and check IP with the ifconfig -a command.

Step 3. Enter host name and IP address in the /etc/hosts file.

127.0.0.0 localhost
192.168.1.1 sun.example.com loghost

Step 4. Enter nameserver IP address and domain name in the /etc/resolv.conf file. If the file is not present, then create it.

domain example.com
search example.com
nameserver 192.168.1.1

Step 5. Configure the /etc/named.conf file for the forward and reverse zone files. If this file does not exist, then create it.

options {
DIRECTORY "/var/named";
};

zone " example.com" in {
type master;
file " example.com.zone";
};
zone "1.168.192.in-addr.arpa" in {
type master;
file " example.com.rev";
};
zone "0.0.127.in-addr.arpa" in {
type master;
file "loopback";
};

Step 6. Configure the forward zone and reverse zone files in the /var/named directory. If named directory is not there, create it.

Step 6a. Create a file example.com.zone under the /var/named directory.
// example.com.zone (forward zone file)


@ IN SOA sun.example.com. root.sun.example.com. (
2; Serial number
5; Refresh timer
3600; Retry timer- 1h
604800; Expire timer-1w
86400; Minimum timer -1d
)

IN NS sun.example.com.


sun IN A 192.168.1.1

example.com. IN A 192.168.1.1


localhost IN A 127.0.0.1

Step 6b. Create a file example.com.rev under /var/named directory.
// example.com.rev (reverse zone file)

@ IN SOA sun.example.com. root.sun.example.com. (
1; Serial no:
5; Refresh timer 12 hrs
3600; retry timer 1-hrs
604800; Expire timer -1 week
86400; Minimum timer - 1day
)


IN NS sun.example.com. ; Primary


1 IN PTR sun.example.com.

Step 6c. Create a file loopback under the /var/named directory.
loopback

@ IN SOA sun.example.com. root.sun.example.com. (

1; serial no
5; Refresh timer -12 hours
3600; retry timer -1 hrs
604800; Expire timer - 1 week
86400; Minimum timer - 1 day
)

IN NS sun.example.com.

1.0.0 IN PTR localhost.example.com.

Step 7. Copy /etc/nsswitch.dns to /etc/nsswitch.conf.

Step 8. Now reboot the machine or use this:
/etc/init.d/inetinit restart

Step 9. Check the configuration with this command:
nslookup <domainname>

I want to thank Mohammad Shafiuddin Sharif, and the contribution of the opensolaris community of IRC. They have help me all the way in my learning path of the Solaris 10 OS.

Configuring a VIA Rhine-Based NIC

Configuring a VIA Rhine-Based NIC

This Tech Tip shows how to configure a VIA Rhine chipset-based network interface card, using the Solaris 10 OS for x86 platforms.

1. Download and Unpack the Driver
The first task in this how-to is to download the driver for the VIA Rhine chipset. It can be downloaded from the Free NIC drivers for Solaris site:

http://homepage2.nifty.com/mrym3/taiyodo/rh-1.0.17.tar.gz

This package provides the source code to build the driver. It was tested on the following operating systems:
  1. Solaris 10 12/04 x86 with AMD64 architecture

  2. Solaris 9 SPARC

  3. Solaris 9 12/02 x86

  4. Solaris 8 SPARC

  5. Solaris 8 10/00 x86
Download the package and save it (for example, on a floppy disk) and then copy it to your box running the Solaris 10 OS.

The next step is to unpack the package. The friendly bunzip2 command will do it for us.
bash-3.00$ cd /export/home/flazcano/
bash-3.00$ ls -la rh*
-rw-r--r-- 1 flazcano other 144815 abr 13 10:08 rh-1.0.17.tar.gzbash-3.00$
bash-3.00$ gunzip rh-1.0.17.tar.gz
bash-3.00$ ls -l *.tar
-rw-r--r-- 1 flazcano other 461312 abr 13 10:08 rh-1.0.17.tar
bash-3.00$ tar xf rh-1.0.17.tar
bash-3.00$ cd rh-1.0.17

2. Build and Install
The default choice is to compile the driver for the Solaris OS, 32 bits on x86 architecture, using the GNU C Compiler (gcc). If you need to change any of these parameters, simply remove the symbolic link and create a new one named Makefile pointing to your architecture/compiler. We used the driver with the default settings, Solaris 10 for x86 with gcc.

bash-3.00$ pwd
/export/home/flazcano/rh-1.0.17
bash-3.00$ ls -la Makefile
lrwxrwxrwx 1 flazcano other 17 abr 13 10:11 Makefile -> Makefile.i386_gcc
For our architecture, the driver is already compiled; we just need to install it in the kernel directory. We need administrative privileges to do it.
bash-3.00$ su
Password:
# /usr/ccs/bin/make install
# ./adddrv.sh
# devfsadm -i rh

3. Configure (1)
The next step is to create and edit configuration files. First, we need to create a /etc/hostname.interface file, and add the IP address of the interface.

# touch /etc/hostname.rh0
# echo 192.168.1.54 > /etc/hostname.rh0
Then we need to edit the following files:
# echo "192.168.1.52 set set.kit.com.ar" >> /etc/inet/hosts

# echo 192.168.1.0 255.255.255.0 >> /etc/netmasks
and plumb the interface:
# ifconfig rh0 plumb up

4. Reboot and Verify
To apply changes we need to reboot our operating system.
# shutdown -y -i6 -g0

When the system comes up, we test the interface with ifconfig:
# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
rh0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 192.168.1.54 netmask ffffff00 broadcast 192.168.1.255
ether 0:c:76:96:d2:93
And we execute a ping to our default gateway.
# ping 192.168.1.1
192.168.1.1 is alive

5. Configure (2)
To obtain a fully functional system we have to configure the files that manage the network behavior. Edit /etc/resolv.conf to add your name server and network search.
# cat resolv.conf
domain kit.com.ar
nameserver 192.168.1.1
search kit.com.ar
Search in /etc/nsswitch.conf for the parameters' hosts and ipnodes, and edit to add DNS servers to resolve the external hosts.
hosts: files dns
ipnodes: files dns

Then we need to configure the default gateway for our network:
# echo "192.168.1.1" > /etc/defaultrouter
# route add default 192.168.1.1
Now we can use our VIA Rhine-based NIC on the Solaris 10 OS for x86 platforms.

I want to thank Federico Lazcano and the contribution of the opensolaris community of IRC. They have help me all the way in my learning path of the Solaris 10 OS.

CONFIGURING JBOSS WITH SMF

CONFIGURING JBOSS WITH SMF

The Solaris 10 OS uses the Service Management Facility (SMF) to handle services.

Traditional means like /etc/rc?.d scripts still work, but as a legacy means. (For more information on SMF, see the References section.)

To take advantage of the SMF in the Solaris 10 OS using JBoss, do the following.
Note: Read the scripts and "change" the paths of jboss and your version of jboss accordingly! This does work for JBoss 3.x.x branches too!

Create a service manifest file:
/var/svc/manifest/network/jboss4.xml

This contains the following:

<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM
'/usr/share/lib/xml/dtd/service_bundle.dtd.1'>

<!--
William Pool (Puddle) 01/05
Service manifest for JBoss
E-mail: puddle@flipmotion.com
-->

<service_bundle type='manifest' name='JBoss4:jboss'>

<service
name='network/jboss'
type='service'
version='1'>
<create_default_instance enabled='false' />
<single_instance />

<dependency name='fs'
grouping='require_all'
restart_on='none'
type='service'>
<service_fmri
value='svc:/system/filesystem/local' />
</dependency>

<!-- DATABASE NOTES

UnComment this block if you use MySQL/PostgreSQL. This will make sure
that MySQL/PostgreSQL is started before you start JBoss. This is an
example for MySQL.

Please create an SMF service for MySQL / PostgreSQL.

<dependency name='mysql'
grouping='require_all'
restart_on='none'
type='service'>
<service_fmri
value='svc:/network/mysql' />
</dependency>

-->

<dependency name='net'
grouping='require_all'
restart_on='none'
type='service'>
<service_fmri value='svc:/network/loopback' />
</dependency>

<dependent
name='ssh_multi-user-server'
grouping='optional_all'
restart_on='none'>
<service_fmri
value='svc:/milestone/multi-user-server' />
</dependent>

<exec_method
type='method'
name='start'
exec='/lib/svc/method/svc-jboss4 start'
timeout_seconds='-1'>
<method_context>
<method_credential user='jboss' group='jboss' />
</method_context>
</exec_method>

<exec_method
type='method'
name='stop'
exec=':kill'
timeout_seconds='-1'>
</exec_method>

<exec_method
type='method'
name='restart'
exec='/lib/svc/method/svc-jboss4 restart'
timeout_seconds='-1'>
</exec_method>

<stability value='Unstable' />

<template>
<common_name>
<loctext xml:lang='C'>
JBoss
</loctext>
</common_name>
<documentation>
<manpage title='jboss' section='1M'
manpath='/usr/share/man' />
</documentation>
</template>
</service>
</service_bundle>

Now create your "Service Method File" in /lib/svc/method called svc-jboss4:

#!/usr/bin/sh
# William Pool (Puddle) 01/05
# SMF Method file for JBoss
# E-mail: puddle@flipmotion.com
#
# NOTE: If you start JBoss with su -c 'cmds' instead
# You "will" be able to start and stop it via root using the method file
# itself. However, it "does" confuse SMF. It's best to have the straight
# commands and let the actual SMF service do the user rights and permissions
# of execution. You've been WARNED! Use su -c 'cmds' at your own risk!
#

. /lib/svc/share/smf_include.sh

case $1 in
'start')
echo "starting jboss.."
/opt/software/jboss-4.0.1/bin/run.sh & >/dev/null 2> /dev/null
;;

'stop')
echo "stopping jboss.."
/opt/software/jboss-4.0.1/bin/shutdown.sh -S &
pkill java
;;

'restart')
stop
# give stuff some time to stop before we restart
sleep 35
# protect against any services that can't stop before we restart (warning
this kills all Java instances running as 'jboss' user)
pkill java
start
;;
*)
echo "Usage: $0 { start | stop | restart }"
exit 1
;;
esac

#---EOF

Now fix the permissions for the two files created:
chown root:bin /lib/svc/method/svc-jboss4
chmod 555 /lib/svc/method/svc-jboss4
chown root:sys /var/svc/manifest/network/jboss4.xml
chmod 444 /var/svc/manifest/network/jboss4.xml

Import the service into the service repository:

# svccfg import /var/svc/manifest/network/jboss4.xml

Enable the service:
# svcadm -v enable jboss

I want to thank William Pool and the contribution of the opensolaris community of IRC. They have help me all the way in my learning path of the Solaris 10 OS.

CONFIGURING MYSQL AND SMF

CONFIGURING MYSQL AND SMF

The Solaris 10 OS uses the Service Management Facility (SMF) to handle services. Traditional means like /etc/rc?.d scripts still work, but as a legacy means. (For more information on SMF, see the References section.)

To take advantage of the SMF in the Solaris 10 OS using MySQL, follow these steps.

Note: Read the scripts and "change" the path of MySQL or MySQL's data-directory accordingly!

If you haven't initialized the MySQL database, do that first:
/opt/sfw/bin/mysql_install_db

This will install the database into /var/mysql to override that use:
/opt/sfw/bin/mysql_install_db -ldata=/opt/sfw/var/mysql

Note: If you change the location, change the information below!

First create a mysql group:
/usr/sbin/groupadd mysql

Then create the mysql user:
/usr/sbin/useradd -s /bin/false -g mysql -d /var/mysql -c "MySQL User" mysql

Create a service manifest file:
/var/svc/manifest/network/mysql.xml

This contains the following:
<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<!--

William Pool (Puddle) 02/05
Service manifest for MySQL
E-mail: puddle@flipmotion.com
-->

<service_bundle type='manifest' name='mysql:mysql'>

<service
name='network/mysql'
type='service'
version='1'>
<create_default_instance enabled='false' />
<single_instance />


<dependency name='fs'
grouping='require_all'
restart_on='none'
type='service'>
<service_fmri value='svc:/system/filesystem/local' />
</dependency>

<dependency name='net'
grouping='require_all'
restart_on='none'
type='service'>
<service_fmri value='svc:/network/loopback' />
</dependency>

<exec_method
type='method'
name='start'
exec='/lib/svc/method/svc-mysql start'
timeout_seconds='-1'>
<method_context>
<method_credential user='mysql' group='mysql' />
</method_context>
</exec_method>

<exec_method
type='method'
name='stop'
exec=':kill'
timeout_seconds='-1'>
</exec_method>

<exec_method
type='method'
name='restart'
exec='/lib/svc/method/svc-mysql restart'
timeout_seconds='-1'>
</exec_method>



</service>

</service_bundle>

Now create your "Service Method File" in /lib/svc/method called svc-mysql:
#!/usr/bin/sh
#
# William Pool (Puddle) 01/05
# SMF Method file for MySQL
# E-mail: puddle@flipmotion.com
#
# This uses Sun's default MySQL packages
# SUNWmysqlu SUNWmysqlr
#
# Modify accordingly!
#
# NOTE: Make sure DB_DIR is owned BY the mysql user and group and chmod
# 700.
#

.. /lib/svc/share/smf_include.sh

DB_DIR=/var/mysql
PIDFILE=${DB_DIR}/`/usr/bin/uname -n`.pid

case "$1" in
start)
/usr/sfw/sbin/mysqld_safe --user=mysql --datadir=${DB_DIR} --pid-file=${PIDFILE} > /dev/null &
;;
stop)
if [ -f ${PIDFILE} ]; then
/usr/bin/pkill mysqld_safe >/dev/null 2>&1
/usr/bin/kill `cat ${PIDFILE}` > /dev/null 2>&1 && echo -n ' mysqld'
fi
;;
'restart')
stop
while pgrep mysqld > /dev/null
do
sleep 1
done
start
;;
*)
echo ""
echo "Usage: `basename $0` { start | stop | restart }"
echo ""
exit 64
;;
esac

#---EOF
Now fix the permissions for the two files created:
chown root:bin /lib/svc/method/svc-mysql
chmod 555 /lib/svc/method/svc-mysql
chown root:sys /var/svc/manifest/network/mysql.xml
chmod 444 /var/svc/manifest/network/mysql.xml

Fix permissions on the MySQL data directory:
chown -R mysql:mysql /var/mysql
chmod -R 700 /var/mysql

Import the service into the service repository:
# svccfg import /var/svc/manifest/network/mysql.xml

Enable the service:
# svcadm -v enable mysql

I want to thank William Pool and the contribution of the opensolaris community of IRC. They have help me all the way in my learning path of the Solaris 10 OS.

CONFIGURING YOUR NIC IN SOALRIS 10

CONFIGURING YOUR NIC IN SOLARIS 10

Many times configuring our Ethernet or NIC has become a pain a remember when I started learning the road of Solaris 10, fortunately hopefully this little HOW-TO will showed you how to assign an IP to your Network Adaptec.

Configuring for IPv4 with Fixed Address
To configure for a fixed IPv4 address, you must place the IP address of your network in /etc/hostname. interface, where interface is the name of the interface to use, such as afe0. The following example shows this, for a system that wishes to use the IP address 192.168.128.101. (Replace with your real IP address.)

# echo 192.168.128.101 > /etc/hostname.afe0

The interface will now automatically be configured the next time the system boots. To configure the interface for immediate use, without rebooting, the the ifconfig(1M) command can be used. Note that you must first "plumb" the interface using a command of the following form:

# ifconfig interface plumb

Until the interface is plumbed in this fashion, it will not display in the list of available interfaces (with the ifconfig -a command.)

Note that this is only the first part of network configuration. You may have to edit several other files, such as /etc/hosts, /etc/resolv.conf, /etc/netmasks, and /etc/defaultrouter to properly configure your network.

The generalities of network configuration on Solaris are well documented in the Solaris 8 System Administration Guide, Volume 3 , which can be accessed on-line at http://docs.sun.com/.

Configuring for IPv4 with DHCP

To set up your ethernet device to act as a client for DHCP (Dynamic Host Configuration Protocol) you must create a file /etc/dhcp. interface. This file should contain the word primary if the interface is your primary (or only) network interface. This will cause DHCP to be used to set the hostname, default route, and other global parameters for the system, in addition to the interface-specific configuration.

If the file is empty, then DHCP is only used to configure the interface and global parameters such as the hostname will not be adjusted.

The following example shows how to enable the interface mxfe0 as the primary (and only) interface, using DHCP.

# echo primary > /etc/dhcp.mxfe0

Note that the configuration does not take effect until the next time the system is rebooted. The auto-dhcp sub-command of ifconfig can be used to configure the interface from DHCP without rebooting. (The interface must first be "plumbed" though.) The following example demonstrates use of ifconfig to configure afe1 via DHCP for temporary use without rebooting.

# ifconfig afe1 plumb auto-dhcp

See the ifconfig(1M) manual page for more information.

Configuring for IPv6 with Autoconfiguration

In IPv6, address autoconfiguration is commonly used to configure the address(es) that are used on a network interface. In most cases, static addresses will not be used with IPv6. To configure the device to use address autoconfiguration (for example, via the neighbor discovery protocol), all one needs to do is create an empty /etc/hostname6. interface file. For example, the following command enables IPv6 to be used with address autoconfiguration on the mxfe0 interface.

# touch /etc/hostname6.mxfe0

Similar to the IPv4 case, this does not take effect until the machine is rebooted. To configure an interface for IPv6 autoconfiguration temporarily, without rebooting, use a command similar to the following:


Configuring for IPv6 with Static Addressing

Static addressing is much less likely to be used with IPv6, but it can still be done. With static IP addressing, one just needs to put the hostname or IPv6 address in the /etc/hostname6. interface file.

Again, a reboot is required for this to take effect. There is also an ifconfig command that can be used for this as well. It typically takes the form:

# ifconfig afe0 inet6 plumb addif 1234::5678/64 up

In the above address the address 1234::5678/64 was added to the afe0 interface. Please refer to the Solaris 8 System Administration Guide, Volume 3 for more information about IPv6 addressing.

Configuring for Use with Other Protocols

There are protocols besides IPv4 and IPv6 that can be used with ethernet. Some examples of these are Apple's AppleTalk and Novell's IPX/SPX protocols. These protocols should work fine with your new ethernet device. The details of configuring such protocols to use the ethernet device should be documented in your network protocol software documentation. You should be able to just replace the name of your interface (for example afe0) for the name of any other "standard" interface (for example hme0) to which the documentation might refer.

Note however while all this should work, it has not be tested for use with these drivers, so your results may vary. But it is hoped and believed that these drivers will function properly with any other Solaris networking software. I would like to give special thanks to Jamesd and the many other member of the opensolaris channel at IRC who encourage new member to keep on. Thank you Guys.

INSTALLING SOLARIS 10 INSIDE VMware 5.5

INSTALLING SOLARIS10 INSIDE VMWARE 5.5

In the community there are a few fanatics for VMware and its usage in Solaris 10, so I put together this HOW-TO to show how to accomplish this task. IN this particular case we will be using VMware 5.5 RTM (build 18463) and Sun Solaris 10 Release 03/05 x86/x64 DVD ISO Image, if you are planning to use the Sparc version don’t even try it I am almost certain it won’t work.

The result of the HOW-TO is so you are able to run Sun Solaris 10 virtual machine also inside VMware Player 1.0 and use it without any licensing cost. The following 3 steps need to be cover.

Part 1 - Preparing your virtual machine hardware

Part 2 – Installing the Sun Solaris 10 operating system

Part 3 (optional) – Running virtual machine inside VMware Player

Part 1 - Preparing your virtual machine hardware

First of all grab your evaluation copy of VMware Workstation 5.5 and your copy of Sun Solaris
10 DVD image:

VMware Workstation 5.5 - http://www.vmware.com/download/ws/eval.html

Sun Solaris 10 - http://www.sun.com/software/solaris/get.jsp

Be sure to check the Solaris DVD image CRC before starting because the image parts can be
downloaded corrupted. You don't need to burn the DVD image since we'll map it directly inside our virtual machine.

Create a new virtual machine with Typical configuration.

Then be sure to choose Solaris 10 (experimental) Guest operating system.

Name the virtual machine as you like and choose your preferred locations for files.
I usually put virtual machines in a VMs directory excluded from antivirus real-time check.

Configure your network connection with Use bridged networking only if there sure there is
no way to arrive on the virtual machine from Internet: immediately after the initial installation
any guest OS could be feasible of attacks since unpatched. Patch it, eventually configure a
firewall and then permit it to connect to Internet.

Configure your disk capacity to 4 GB Disk Size (you can check the Allocate all disk space
now box if you have enough space, a fully defragmented hard disk and want to have better
performances for guest OS).

Now you should have finished and a virtual machine summary will appear.

You can change some settings seconding your needs simply clicking on Edit virtual machine
settings.

Two virtual components are very important: RAM and Processors.

If you have at least 768MB physical RAM increase your virtual machine memory from 256 MB
to 512MB (this will greatly speed up the installation process).

If you have an Intel CPU with HyperThreading enabled or an AMD64 Dual Core CPU you could
choose to assign two virtual processors to this virtual machine.

Be sure to choose the correct number of virtual processors before starting the Solaris
Installation. Passing from one virtual processor to two virtual processors (or vice versa) will
require reinstalling the whole operating system.

You can also choose to delete the virtual sound card (Audio device) if you don't plan to use
Solaris 10 as a desktop operating system.

Now change the virtual device CD-ROM Connection from Use physical drive to Use ISO
image and browse for your Sun Solaris 10 DVD ISO image previously downloaded. We are finally ready now.

Part 2 – Installing the Sun Solaris 10 operating system

Launch the just prepared virtual machine and let the DVD ISO image boot.
When required press 1 for Solaris Interactive.

Choose your preferred language.

Now choose Networked Connectivity. Then specify if your virtual network interface card
(recognized as pcn0) will grab an IP address by DHCP or not.
If you chosen not detail your virtual machine hostname, IP address, subnet mask, IPv6
support and default route.

Enable or not Kerberos, detail your eventual name service system.
If you chosen DNS as name service system detail your domain name and at least one DNS
server IP address.

Choose your Time Zone and Date & Time.

Choose your Root password.

Finally accept your summary settings page.

Say yes to both Reboot automatically after software installation and Eject additional
CDs/DVDs automatically after software installation.

Before saying OK on the final Notice window be sure to modify your VMware virtual CD-ROM
device to have checked Connected and unchecked Connect at power on checkboxes.

Now let’s start the software packages installation.

Let unmodified to CD/DVD as Media.

Accept the License Agreement and choose Custom Install.
Select your Software Localizations region only if you want Solaris 10 in your national
language. English will be installed by default.

Select Products to install as you need. Remember we set up a small 4GB virtual disk so you
couldn’t be able to install everything now.

Select None as Additional Product to install.
Now you need to select how many Solaris software packages install. I personally suggest
choosing End User Group (2141.4 GB occupied).

On Disk Selection just hit Next since our virtual disk (recognized as c0d0 (bootdisk)) is
already selected.
On fdisk Partition Customization hit Next as well.

On Customize fdisk Partitions you’ll see a single Solaris partition of 4095 MB size. If you are
unsure on how to partition your virtual hard disk just hit Next.
If you hit Next on the previous screen a default File System Lay Out will appear. Just hit
Next.

Now the packages installation starts. It will take some time.

At the end Solaris Installer will inform you the system is configured to run NFS v4 asking if you
need to override default settings. Say No and let the OS restart.

After reboot Sun Solaris 10 will arrive at console login asking for name login and password.

After logging in launch kdmconfig from the shell.
At the X Server Selection be sure to choose Xsun server.
On the next screen the system will have already recognized your VMware virtual video card
with a default resolution of 1024x768 and 256 colors @ 70 Hz.
If you want different settings move on Change Video Device/Monitor and press Space.
Then hit F2 and arrive at the Video Device Selection: be sure to untouch XF86-VMware
VMware Inc vmware0405. Press F2 again.

On Monitor Type Selection be sure to choose a Multifrequency Monitory with no more
resolution of your physical monitor.
On the Screen Size Selection choose 17-inch.
On the Resolution/Colors Selection I suggest you to choose a resolution a bit smaller than
your physical maximum (I personally run every VM on 1024x768 with a physical resolution of
1400x1050) and your preferred amount of colors.

Now you’re back to kdmconfig system configuration summary.

Hit F2 to test the configuration, save and exit to the console (if something goes wrong simply
relaunch kdmconfig and start over).
Now write Exit on the console and, if you did a correct configuration, the system will
automatically launch the graphical login screen (it could take some seconds).

Now, from the Options menu, you can choose if run a Common Desktop Environment
(CDE) or Java Desktop System 3 graphical session (I strongly recommend the last one).
Login and enjoy your Sun Solaris 10 virtual machine.

Part 3 (optional) – Running virtual machine inside VMware Player

As you probably know Sun Solaris 10 is free to use even for commercial environments.
So you could want to have a virtual machine of it for any case.

Since some times VMware offers everybody the possibility to use its virtualization technology
for free anywhere with the new VMware Player.
So you could want to have a Solaris 10 virtual machine with a copy of VMware Player for any
case.

First of all download VMware Player here:
http://www.vmware.com/download/player/

Now burn it with your whole Sun Solaris 10 virtual machine directory in a DVD.

Copy Sun Solaris 10 virtual machine directory on the new hard disk of a different computer
and install VMware Player: VMware Player cannot be installed on the same machine where is
VMware Workstation.

Start your VMware Player and point to the directory where you copied your Sun Solaris 10
virtual machine.

At the warning about creating a new UUID answer Create.

Done! You have a free fully working virtual machine with a free fully working enterprise
operating system inside.

I hope this HOW-TO allows you to install the OS using VMware. If you have any comments or encounter any issues following it, don’t hesitate to join the opensolaris channel at IRC. Thanks to Jamesd and the many other members of the channel who have encourage me to keep learning the OS.

Firefox 15 Ready for Solaris

Firefox 1.5 Ready for Solaris

I just wanted to inform everyone that the new release of Firebox 1.5 has been release for the Solaris 10 platform and it is available at your disposal at

ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/1.5/contrib/

I am encouraging everyone that will try it out to read the read me file before using it. Bellow I layout some of the improve features of this new version.

A Better Web Experience
Firefox 1.5 has an intuitive interface and blocks viruses, spyware, and popup ads. It delivers web pages faster than ever. And it’s easy to install and import your favorites. Packed with useful features like tabbed browsing, Live Bookmarks, and an integrated Search bar, Firefox will change the way you experience the Web, for the better.

Faster Browsing
Enjoy quick page loading as you navigate back and forward in a browsing session. Improvements to the engine that powers Firefox deliver more accurate display of complex web sites, support for new Web standards, and better overall performance.

Automatic Updates
The new Software Update feature makes it easy to get the latest security and feature updates to Firefox. Firefox automatically downloads these small updates in the background and prompts you when they are ready to be installed.

Tabbed Browsing
Use tabbed browsing to open multiple web pages in a single browser window, and quickly flip back and forth. Drag and drop open tabs to keep related pages together.

Improved Pop-up Blocking
Firefox’s built-in pop-up blocker has been enhanced to block more unwanted pop-up and pop-under ads.

Integrated Search
Tap into the power of the Web’s most popular search engines with the built-in Search bar, and easily add new engines.

Stronger Security
Firefox keeps you secure when you’re browsing the Web, closing the door on spyware, worms, and viruses. The Firefox community of developers and security experts works around the clock to monitor security issues and release updates to better protect you.

Clear Private Data
Protect your privacy with the new Clear Private Data tool. With a single click, you can delete all personal data, including browsing history, cookies, web form entries and passwords.

Live Bookmarks
Stay up to date with your favorite Web sites and blogs. Use Live Bookmarks that update themselves automatically with the latest content from the Web.

Accessibility
Firefox 1.5 delivers easier navigation for everyone, including those who are visually or motor-impaired. Firefox is the first browser to support DHTML accessibility, which, when enabled by Web authors, allows rich Web applications to be read aloud. Users may navigate with keystrokes rather than mouse clicks, reducing the tabbing required to navigate documents such as spreadsheets. Firefox 1.5 (Windows version) is also the first browser to meet US federal government requirements that software be easily accessible to users with physical impairments.

Customize Firefox
Select new button controls for your toolbars, install extensions to add new features, or change the look of your browser with themes - the way Firefox looks and works is under your control.

Next Generation Web Support
Innovative new Web applications and services deliver a richer Web experience. Support for open Web standards in Firefox ensures you can get the most out of this emerging class of Web-based tools.

Managing Solaris Packages

MANAGING SOLARIS PACKAGES.

I have been asked several times “how do I find out which packages are installed in my box” well, the answer is using the pkginfo command.

# pkginfo | more
system CADP160 Adaptec Ultra160 SCSI Host Adapter Driver
system HPFC Agilent Fibre Channel HBA Driver
system NCRos86r NCR Platform Support, OS Functionality (Root)
system SK98sol SysKonnect SK-NET Gigabit Ethernet Adapter SK-98xx
system SKfp SysKonnect PCI-FDDI Host Adapter
application SMCbind bind
application SMCgcc gcc
application SMCiconv libiconv
application SMCncurs ncurses
application SMCosslg openssl
application SMCpopt popt
application SMCreadl readline
application SMCsamba samba


As you can see the more option give you a list of everything that is install in a screen by screen basic. If you type the pkginfo command by itself, you probably won’t b able to see each one of the package that is install as the list runs by so fast. Now let’s said we want to find out information about a specific package that is already install in our system as an example I will pick SMCsamba.

# pkginfo -l SMCsamba
PKGINST: SMCsamba
NAME: samba
CATEGORY: application
ARCH: intel
VERSION: 3.0.10
BASEDIR: /usr/local/samba
VENDOR: The Samba Group
PSTAMP: Steve Christensen
INSTDATE: Nov 30 2005 22:29
EMAIL: steve@smc.vnet.net
STATUS: completely installed
FILES: 1171 installed pathnames
79 directories
41 executables
104086 blocks used (approx)

You can also determine how many packages are install in your system by issuing the following command:

# pkginfo | wc -l
925

In my case it showing that I have 925 ( a lot). In your case might be more or less depending in what you have installed/removed after OS installation. If we were to add new packages to the things will be a little different, we will use the following to accomplish such:

# pkgadd -d <pkgname>

The above step is performed to install a package that has been downloaded locally. If you want to install a package from a remote location you would use something very similar to this:

# pkgadd -d http://URL/packages/SUNWrsc.pkg all

Similarly to pkgadd to add new packages there is another utility to check the integrity or components of a package, the utility is call pkgchk and it is use in the following format.

# pkgchk –v SUNWladm

The –v option allows you to see the files that are contained within the software.

Another of the command use is the pkgrm command and this one is use to remove package that has been install in the system. In this particular instance I have to emphasize to be very cautious of the dependency warnings you will received when removing a package. The system will allow you to remove the package though the package may be required by another package.

# pkgrm SUNWapchr

The following package is currently installed:
SUNWapchr Apache Web Server (root)
(sparc) 11.10.0,REV=2004.08.20.02.37

Do you want to remove this package? [y,n,?,q] y

## Removing installed package instance <SUNWapchr>
## Verifying package dependencies.
WARNING:
The <SUNWapchu> package depends on the package
currently being removed.
WARNING:
The <SUNWapchd> package depends on the package
currently being removed.
WARNING:
The <SUNWipplr> package depends on the package
currently being removed.
WARNING:
The <SUNWserweb> package depends on the package
currently being removed.
Dependency checking failed.

Do you want to continue with the removal of this package [y,n,?,q] y
## Processing package information.
## Removing pathnames in class <initd>
/etc/rcS.d/K16apache
/etc/rc3.d/S50apache
/etc/rc2.d/K16apache

(output ommited for brevity)

/etc/apache/httpd.conf-example
/etc/apache/README.Solaris
/etc/apache <shared pathname not removed>
/etc <shared pathname not removed>
## Updating system information.

Removal of <SUNWapchr> was successful.

Sometimes I think is very convenient to copy package from the Solaris 10 CDROM into what is call the spool directory (/var/spool/pkg), this method allows you to install the packages you use more frequently in a easier way. To copy packages from the solaris 10 CDROM into the spool directory we do the following:

# pkgadd -d /cdrom/cdrom0/s0/Solaris_10/Product -s spool SUNWauda
Transferring <SUNWauda> package instance

In the above scenario I am coping the SUNWauda package into the spool, you can do the same for all the packages you most frequently use. Now let’s check that the package was transfer to the spool using the ls –al command into that directory as follow:

# ls -al /var/spool/pkg
total 6
drwxrwxrwt 3 root bin 512 Oct 1 14:26 .
drwxr-xr-x 12 root bin 512 Sep 30 20:03 ..
drwxrwxr-x 5 root root 512 Oct 1 14:26 SUNWauda

After adding all the packages you want, installing them becomes easier, in this particular example I will install the package I just transfer to the spool which is SUNWauda doing the following:

# pkgadd SUNWauda

You can always remove software package from the spool that you will not longer use using:

# pkgrm -s spool SUNWauda
The following package is currently spooled:
SUNWauda Audio Applications
(sparc) 11.10.0,REV=2004.09.03.08.15

Do you want to remove this package? [y,n,?,q] y

Removing spooled package instance <SUNWauda>

We are not force to use the spool (/var/spool/pkg); however, Solaris 10 uses that one as the default directory for spooling. If you want to define your own spooling directory you can do so doing the following.

# pkgadd -d /cdrom/cdrom0/s0/Solaris_10/Product -s /export/pkg SUNWauda

# pkgrm -s /export/pkg SUNWauda

As you can see I have define my spooling directory as /export/pkg rather than the default one.

Hopefully this gives you a brief idea about package management. As you practice the various commands you will become more familiar with installation and deletion of your packages. I want to thanks the opensolaris community at IRC who has help me in so many ways to continue learning the OS.