Configuring NIS in Solaris

Notes from /usr/lib/netsvc/yp/ypstart
# When to start ypserv
#       The value of $domain is non-null *and*
#       The directory /var/yp/$domain exists *and*
#       There is an executable ypserv in $YPDIR
#
# When to start ypbind
#       The value of $domain is non-null *and*
#       There is an executable ypbind in $YPDIR *and*
#       The directory /var/yp/binding/$domain exists.
NIS client configuration
1. Run domainname to see if an NIS domainname is returned. If a value is not returned, run domainname NIS_domainname and create /etc/defaultdomain containing the name of the NIS domainname.

2. Create a directory named /var/yp/binding/`domainname` if one does not already exist.

3. If you want the NIS client to broadcast for a NIS server (Note: there must be a NIS server on your subnet), start NIS with /usr/lib/netsvc/yp/ypstart. If you want to manually specify one or more NIS server(s) to use, run ypinit -c and then /usr/lib/netsvc/yp/ypstart. Note that each manually specified NIS server must have an entry in /etc/hosts.

4. Modify the name service switch file (/etc/nsswitch.conf) to use the NIS databases. You may want to copy /etc/nsswitch.nis over /etc/nsswitch.conf. Make sure to modify the hosts: line in /etc/nsswitch.conf if you want to use DNS for hostname resolution: hosts: dns nis files

NIS slave configuration
1. Run /usr/sbin/ypinit -s NIS_master to transfer the NIS maps from the NIS master to the NIS slave. NIS_master must be present in /etc/hosts.

2. Edit /var/yp/binding/`domainname`/ypservers and add the hostname of the NIS slave to ensure that ypbind binds to the local host.

3. Stop and restart NIS services via /usr/lib/netsvc/yp/ypstop and /usr/lib/netsvc/yp/ypstart

Miscellaneous NIS notes
The NIS line length limit is 1024 characters.

Starting NIS /usr/lib/netsvc/yp/ypstart Stopping NIS /usr/lib/netsvc/yp/ypstop To stop NIS at system boot, remove the file /etc/defaultdomain.

NIS troubleshooting
If NIS appears to hang when pushing maps from the NIS master to NIS slave servers, check the contents of /var/yp/ypxfr.log. "touch" the file if it is not created.

Create clnt failure: RPC: Program not registered
If you receive this error when attempting to change a user's password, the rpc.yppasswdd daemon is not running on the NIS master server. It is located in /usr/lib/netsvc/yp
More information: http://www.netsys.com/sunmgr/1998-08/msg00030.html

passwd (NIS): Couldn't change passwd/attributes for user
The rpc.yppasswdd daemon is probably running, but it is not pointing to the directory containing the NIS maps. By default, rpc.yppasswdd looks for NIS maps in /var/yp. If NIS maps are in /var/yp/maps, for example, use the following command to start rpc.yppasswdd /usr/lib/netsvc/yp/rpc.yppasswdd -D /var/yp/maps
More information: http://aa11.cjb.net/sun_managers/2000/01/msg00160.html

No response from ypxfr on host
Check /var/yp/ypxfr.log. It is possible that the /var file system on the remote host is full. Thu May 31 10:33:16: Transferred map ypservers from host (2 entries). write: No space left on device

Maps are pushed from the master server to the slave servers via the make utility and the NIS Makefile located in /var/yp. Maps are pulled from the master server via the ypxfr utility.

Push maps from master server cd /var/ypmake

List NIS maps ypcat -x
-- or --
ypwhich -x

List of NIS servers
ypcat ypservers

Which NIS server are you bound to?
ypwhich

Forcing ypbind to use a particular NIS server
/usr/lib/netsvc/yp/ypbind -ypsetme
ypset NIS_server
ypwhich (to confirm NIS server)

Master and slave servers are distinguished by their ability to effect permanent changes to NIS maps. Changes may be made to an NIS map on a slave server, but the next map transfer from the master will overlay this change.

Source: http://www.brandonhutchinson.com/Solaris_NIS_configuration.html

Read More...
Bookmark and Share
Your Ad Here

Linux Kernel Cross-compilation

Linux Kernel can be compiled in a machine for a different architecture. This is useful in fixing compilation issues for different architectures without actually using them.

Using ARCH option, the target architecture can be specified. It is also possible to specify the cross-compile toolchain through CROSS_COMPILE and specific compiler using CC options.

Example: To compile the kernel for a 64-bit Intel platform, # make ARCH=x86_64 defconfig

To compile with ARM toolchain at /usr/local/bin, # make ARCH=arm CROSS_COMPILE=/usr/local/bin/arm-linux-

It is useful even for a non-cross-compiled kernel to change what the build system uses for the compiler. Examples of this are using the distcc or ccache programs, both of which help greatly reduce the time it takes to build a kernel. To use the ccache program as part of the build system, enter:

# make CC="ccache gcc"

Source: http://www.linuxtopia.org/online_books/linux_kernel/kernel_configuration/ch05s04.html

Read More...
Bookmark and Share
Your Ad Here

Applying patches to Solaris

Solaris
Use this procedure to download either a signed or an unsigned Solaris patch and then apply it to your system. If you want to apply signed patches, you must first set up the package keystore.
1. Gain access to the system in one of the following ways:
    a. Log in to the system where you want to apply the patch.
    b. Download the patch and use the ftp command to copy the patch to the target system.

2. Start a web browser and go to the SunSolve Online Patch Portal at http://sunsolve.Sun.COM.

3. Determine whether to download a specific patch or a patch cluster, then do one of the following.
    a. Type the patch number (patch-id) in the Find Patch search field, then click Find Patch. Entering patch-id downloads the latest patch revision. If this patch is freely available, the patch README appears. If this patch is not freely available, an ACCESS DENIED message appears.
    b. Note that patch numbers for SPARC based and x86 based systems are different. The patch IDs are listed in the patch README. Ensure that you apply the patch that matches your system architecture.
    c. Select the Recommended Patch Cluster that matches the Solaris release that is running on the system that you want to patch.

4. Download the patch by following these instructions:
    a. To download a copy of the signed patch, click the Download Signed Patch (n bytes) button.
    b. To download an unsigned patch, click the Download Patch (n bytes) button. When the patch or patches are successfully downloaded, close the web browser.

5. Change to the directory that contains the downloaded patch.

6. Become superuser or assume an equivalent role.

7. (Unsigned patch) If you downloaded an unsigned patch, unzip the patch.
# unzip patch-id

8. Apply the signed or unsigned patch.
    a. If you downloaded a signed patch, apply it.
    For example: # patchadd /tmp/111879-01.jar
    b. If you downloaded an unsigned patch, apply it.
    For example: # patchadd /tmp/111879-01

9. Verify that the patch has been successfully applied.
For example: # patchadd -p | grep 111879 Patch: 111879-01 Obsoletes: Requires: Incompatibles: Packages: SUNWwsr

Source: Sun System Administration Guide: Basic Administration

Read More...
Bookmark and Share
Your Ad Here

Adding CD/DVD drives to a running Xen domainU guest

Xen provides great flexibility in terms of dynamically adding block devices such as disk drives and CDROM/DVD drives to running domainU guest systems.
This is achieved using the xm block-attach command, the syntax for which is as follows:
xm block-attach <Domain Id> <Backend Device> <Frontend Device> <Mode>
where:

  • <Domain Id> is the id of the domainU to which the device is to be attached (this can be obtained by running xm list)
  • <Backend Device> represents the device as it is represented on the domain0 host system prefixed with the type. For example:
phy:/dev/sr0

  • <Frontend Device> is the device name for access on the domainU guest system. This name must be prefixed with xvd otherwise the device will not be visible to the domainU guest. For example:
/dev/xvda1

  • <Mode> is the read/write mode under which the device is to be attached. Options are r for read-only, w for read/write and w! for read/write with sharing.
With this information in mind we can now attach a DVD device to a running domainU guest. The first step is to identify the correct device on the domain0 host. The device name varies from one Linux distribution to another so the best way to achieve this is to insert is disk into the drive and run the mount command. For example, the following mount output shows an iso9660 format DVD disk on device /dev/sr0:

/dev/sr0 on /media/LXFDVD100A type iso9660 (ro,nosuid,nodev,uhelper=hal,uid=500)

Next we need to identify the domainU to which we wish to attach the device. A list of running running guests can be obtained using xm list:

xm list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0   875     1     r-----    574.0
XenGuest1                                    3   128     1     -b----     96.4
This shows only one guest running which is XenGuest1 with an ID of 3.
With this information we can now attach our DVD device to the domainU guest:

xm block-attach 3 phy:/dev/sr0 /dev/xvda2 r
Once the device is attached log into the domainU system and check the device is now visible:

brw-r----- 1 root disk 202, 2 2008-05-02 15:12 /dev/xvda2
Assuming the device is visible all that remain is to mount it:

mount /dev/xvda2 /mnt
mount: block device /dev/xvda2 is write-protected, mounting read-only
The device is now mounted and accessible.
To detach the device first unmount it from the domainU system:

umount /mnt
Finally, detach the device from the domain0 host using xm block-detach combined with the domainU ID and the frontend device name (in this case /dev/xvda2):

xm block-detach 3 /dev/xvda2

Source: http://www.virtuatopia.com/index.php/How_to_add_a_CDROM_or_DVD_drive_to_a_running_Xen_domainU_guest

Read More...
Bookmark and Share
Your Ad Here