Analytics


Google
Showing posts with label Solaris. Show all posts
Showing posts with label Solaris. Show all posts

Wednesday, October 20, 2010

Compiling Samba on Sun Solaris

This is a bookmark for my personal reference to this site.   I searched other sites and this is the one that works.

Main content that is important is as follow:


  1. Download and compile Samba from http://www.samba.org.
    Here Kerberos, OpenLDAP, and Samba will be downloaded and compiled.
    Samba will use the idmap_rid facility to map a single ADS domain SIDs to Solaris UIDs and GIDs. You should determine what idmap is suitable for your installation.
    Within this example the samba-highly-available-local-file-system is /local/samba, where the software is installed into /local/samba/software and compiled into /opt/samba.
    For more information using these filenames refer to the following deployment example in Deployment Example: Installing Samba from http://www.samba.org where these commands have been has been taken.
    1. Download, Extract and Install Kerberos.

      Vigor5# cd /local/samba/software
      Vigor5# wget http://web.mit.edu/kerberos/dist/krb5/1.4/krb5-1.4.3-signed.tar
      Vigor5# tar -xfBp krb5*tar
      Vigor5# gunzip -c krb5*.tar.gz | tar -xfBp -
      Vigor5# rm krb5*tar*
      Vigor5# cd krb5*/src
      Vigor5# CC=/opt/SUNWspro/bin/cc ./configure --prefix=/opt/samba \
      > --enable-dns-for-realm
      Vigor5# make
      Vigor5# make install
      
    2. Download, Extract and Install OpenLDAP.

      Note –
      You must obtain a fix for Bug ID: 6419029 which describes a problem when compiling OpenLDAP before proceeding with this step.


      Vigor5# cd /local/samba/software
      Vigor5# wget \
      > ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/openldap-2.3.24.tgz
      Vigor5# gunzip -c openldap-2.3.24.tgz | tar -xfBp -
      Vigor5# rm openldap-2.3.24.tgz
      Vigor5# cd openldap*
      Vigor5# CC=/opt/SUNWspro/bin/cc \
      > CPPFLAGS="-I/opt/samba/include" \
      > LDFLAGS="-L/opt/samba/lib -R/opt/samba/lib" ./configure --prefix=/opt/samba \
      > --disable-slapd --disable-slurpd
      Vigor5# make depend
      Vigor5# make
      Vigor5# make install
      
    3. Download, Extract and Install Samba.

      Vigor5# cd /local/samba/software
      Vigor5# wget http://us3.samba.org/samba/ftp/old-versions/samba-3.0.22.tar.gz
      Vigor5# gunzip -c samba-3.0.22.tar.gz | tar -xfBp -
      Vigor5# rm samba-3.0.22.tar.gz
      Vigor5# cd samba*/source
      Vigor5# CC=/opt/SUNWspro/bin/cc \
      > CFLAGS=-I/opt/samba/include \
      > LDFLAGS="-L/opt/samba/lib -R/opt/samba/lib" ./configure --prefix=/opt/samba \
      > --with-ads --with-krb5=/opt/samba --with-shared-modules=idmap_rid
      Vigor5# make
      Vigor5# make install
      
  2. Copy winbind libnss_winbind.so to /usr/lib.

    # cd /local/samba/software/samba*/source
    #
    # cp nsswitch/libnss_winbind.so /usr/lib
    # ln -s /usr/lib/libnss_winbind.so /usr/lib/libnss_winbind.so.1
    # ln -s /usr/lib/libnss_winbind.so /usr/lib/nss_winbind.so.1

Friday, October 2, 2009

Mounting a new drive in Sun Solaris

If you are creating a new virtual drive in VMWare or installing a new disk, you need to first detech the disk. This can be done with the command:

#devfsadm -v

Once you detect the disk you can then format the disk using the format command:

#format

Screen example shown below:



# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
0. c1t0d0

/pci@0,0/pci15ad,1976@10/sd@0,0
1. c1t1d0
testVol
/pci@0,0/pci15ad,1976@10/sd@1,0
Specify disk (enter its number):
1
selecting c1t1d0:
testVol
[disk formatted]


FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
fdisk - run the fdisk program
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
volname - set 8-character volume name
!
- execute , then return
quit

format> partition


PARTITION MENU:
0 - change `0' partition
1 - change `1' partition
2 - change `2' partition
3 - change `3' partition
4 - change `4' partition
5 - change `5' partition
6 - change `6' partition
7 - change `7' partition
select - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
!
- execute , then return
quit

partition> modify
Select partitioning base:
0. Current partition table (original)
1. All Free Hog
Choose base (enter number) [0]?
1

Part Tag Flag Cylinders Size Blocks
0 root wm 0 0 (0/0/0) 0
1 swap wu 0 0 (0/0/0) 0
2 backup wu 0 - 1301 9.97GB (1302/0/0) 20916630
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 usr wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 - 0 7.84MB (1/0/0) 16065
9 alternates wm 0 0 (0/0/0) 0

Do you wish to continue creating a new partition
table based on above table[yes]?

Free Hog partition[6]?
Enter size of partition '0' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '1' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '3' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '4' [0b, 0c, 0.00mb, 0.00gb]:
9.9gb
Enter size of partition '5' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '7' [0b, 0c, 0.00mb, 0.00gb]:

Part Tag Flag Cylinders Size Blocks
0 root wm 0 0 (0/0/0) 0
1 swap wu 0 0 (0/0/0) 0
2 backup wu 0 - 1301 9.97GB (1302/0/0) 20916630
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 1 - 1293 9.90GB (1293/0/0) 20772045
5 unassigned wm 0 0 (0/0/0) 0
6 usr wm 1294 - 1301 62.75MB (8/0/0) 128520
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 - 0 7.84MB (1/0/0) 16065
9 alternates wm 0 0 (0/0/0) 0

Okay to make this the current partition table[yes]?
Enter table name (remember quotes):
"testDisk"

Ready to label disk, continue? yes

partition> quit


FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
fdisk - run the fdisk program
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
volname - set 8-character volume name
!
- execute , then return
quit
format>
save
Saving new disk and partition definitions
Enter file name["./format.dat"]:

format> quit


Next create a file system:

# newfs c1t1d0s4

note that you use the device name you see in the format screen and add s4 for the slice 4 (or partition 4).

Screenshot below:



newfs: /dev/rdsk/c1t1d0s4 last mounted as
newfs: construct a new file system /dev/rdsk/c1t1d0s4: (y/n)? y
Warning: 820 sector(s) in last cylinder unallocated
/dev/rdsk/c1t1d0s4: 20772044 sectors in 3381 cylinders of 48 tracks, 128 sectors
10142.6MB in 212 cyl groups (16 c/g, 48.00MB/g, 5824 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 98464, 196896, 295328, 393760, 492192, 590624, 689056, 787488, 885920,
19858720, 19957152, 20055584, 20154016, 20252448, 20350880, 20449312,
20547744, 20646176, 20744608






checking the disk is optional:

# fsck /dev/rdsk/c1t1d0s4


** /dev/rdsk/c1t1d0s4
** Last Mounted on
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3a - Check Connectivity
** Phase 3b - Verify Shadows/ACLs
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cylinder Groups
2 files, 9 used, 10228265 free (17 frags, 1278531 blocks, 0.0% fragmentation)




Next make the mount mount - using mkdir
# mkdir tmpMount

Finally, mount the new disk

# mount /dev/dsk/c1t1d0s4 /tmpMount





Configuring Sun Solaris x86 in vmware for 64 bit

By default when you install SunSolaris x86 both 32 bit and 64 bit is provided. When configuring it within VMWare we can also select whether we want to have 32 bit or 64 bit.

However, even after selecting that we sometimes end up with 32 bit. The reason is the BIOS setting, we need to go into the bios of the computer and enable Virtual Machine support. Only after that will the Solaris run in 64 bit. Even if you have installed it previously when the bios Virtual machine support is not turned on.

To check if it is running 64 bit, just type:

/usr/bin/isainfo -kv

If it is 64 bit, you will see the output as follows:

64-bit amd64 kernel modules

Friday, September 25, 2009

Daemonize a process in Unix

In unix when we run a command, it will usually run in the foreground and take over our terminal.

For long running processes, we can add & to create a child process to run the background. This will allow you to continue to use the terminal while waiting for the process to finish. However, for that process is still tied to the parent process and will terminate if you exit from your terminal.

Sometimes we want to start a process and let it continue to run even after we exit out of our terminal. This can be done using the nohup command.

For example, if we want to start the WebLogic server and have it continue serving out our web application even after we log out of the server. To do that just type:

nohup ./startWebLogic.sh &

All output will be redirected to a file called nohup.out but the WebLogic server process will continue to run even after we have logged out of the server.

Friday, September 18, 2009

Sun companion CD

The sun companion CD contains many useful software and is listed here.

Thursday, September 17, 2009

Installing WebLogic server on Sun Solaris x86

In order to install Weblogic server on Sun Solaris x86, you need to first upgrade the JDK to at least version 1.6. The instruction on how to do that is found here.

Sun Solaris u6 still has JDK version 1.5.

Next download the generic installer from the Oracle website.

To install go to the folder than contains the jar file downloaded (in this example server103_generic.jar and type:

java -jar server103_generic.jar

You can actually decide where you want to install it. By default, it will attempt to install it in /usr/local/bea folder.

In order to install the Workshop, you need to have Eclipse and WTP. I have not successfully done that so far. I tried to use the base Eclipse 3.5 but it still won't let me install. So I excluded that in my test installation.

After install, if you want access the console, you need to first start the server. This is found under:

/usr/local/bea/wlserver_10.3/samples/domains/wl_server/bin

Just type

./startWeblogic.sh

add & if you don't want to lock up your terminal. You can then access the console using

http://localhost:7001

You can then click on Start Administration Console to initiate and get into the Console.

Tuesday, September 15, 2009

Upgrading JDK in Sun Solaris

First go to Javasoft to download the software. In this example, I will use the j2se version 6 for Solaris x86. After you confirm all the selection, you have an option to select from 2 versions, one is .sh another is .Z. You only need the .sh version (which only contains the binaries).

The various versions Java is stored in /usr/jdk folder.

After downloading the .sh file to your folder run the following:

chmod +x jdk-6-solaris-i586.sh

to make the file executable.

change to root, then change directory to /usr/jdk

After that, run the script. so assuming the file is in /export/home/strovek/, type

/export/home/strovek/jdk-6u16-solaris-i586.sh

This will extract the every to the folder, in this case to /usr/jdk/jdk1.6.0_16

Then remove the existing symbolic link /usr/java and replace it with the new link

Just type:

ln -s jdk/jdk1.6.0_16 /usr/java

To verify, just type

java -version


Note that there is already symbolic link in /usr/sbin for java, javac etc that points to /usr/java.

Wednesday, July 8, 2009

Source for Sudo

To download sudo for Solaris, this is the source:


http://www.courtesan.com/sudo/download.html

Excerpt from the following site, on what is sudo:


sudo stands for "su do", and means "do something as the supervisor". `sudo` is an enhanced alternative to the Unix `su` command.

The `su` command allows any user to obtain superuser privileges, if they know the root password:
bash-2.05a$ su -
Password:
#

The Impact of sudo on Unix System Security
`sudo` improves on `su` in several ways:
`sudo` allows you to give privileged access to only some commands, instead of all commands.
`sudo` allows you to log all commands (and their arguments) executed as the privileged user.
`sudo` does not require the administrator to share the root password.
`sudo` allows you to limit the users who can use it by editing the sudoers file.
`sudo` times out after 5 minutes (by default).

Adding user in Sun Solaris

If you want to create a new group, use the groupadd command, eg, if you want to create a group call user, then just type

groupadd user

The above command will automatically create a group called "user" and assign a group id (gid) to it.

To create a user, use the command useradd, so for example you want to create a user call strovek, then just type:

useradd strovek

This will automatically create a user, assign and user id (uid) to it. You can alternatively assign the userid and the group id to it by use -g to assign a gid to the assign a uid by use -u parameter and -d to assign a home folder to it.

Next create a folder (or can be created earlier), using mkdir:

mkdir /export/home/strovek

Then change the owner of the folder using chown:

chown strovek:user /export/home/strovek

If you had not set the home folder earlier, you can do that using usermod, as in

usermod -d /export/home/strovek strovek

Set the password for the user using passwd, as in

passwd strovek

When you type the above, it will prompt you for the new password and then a confirmation.

To remove the account, just type userdel, as in

userdel strovek

The Solaris Administrator guide can be found here.

Monday, July 6, 2009

Downloading Firefox 3.5 for Sun Solaris

The following is a good source for download firefox for both Open Solaris and Sun Solaris:

http://ftp.spnet.net/mozilla/firefox/releases/3.5/contrib/solaris_pkgadd/

The instruction of how to install is available from the sunfreeware site but I had difficulty downloading the actual software:

http://sunfreeware.com/mozilla.html

Note:

Additional instruction found here:

The following is quoted from the entry

first, dont use the tar.gz build, use this instead:
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.5/contrib/solaris_pkgadd/firefox-3.5.en-US.opensolaris-i386-pkg.bz2

then bunzip2 it, pkgadd it, and then,

pkgadd command is as follows:

pkgadd -d firefox-3.5.en-US.solaris-10-fcs-i386-pkg


to make it kindof replace the default firefox, do this:

pfexec mv /usr/bin/firefox /usr/bin/firefox-old
pfexec ln -s /opt/sfw/bin/firefox /usr/bin/firefox


i just did this a couple minutes ago and it worked almost perfectly! i say 'almost' because i lost the java plugin in the process. not hard to fix that though, just make a new symlink. not that ive ever used the java plugin lol.

hope this helps
--joe

Wednesday, February 25, 2009

List for Unix Commands (Solaris and AIX)

There is a page which provides a nice guide on Solaris here. Here is a sample info:

df -n (or fstyp device) show type of file system (ufs/vxfs)
fuser and pfiles open files
prtconf -V OBP level
pgrep, pkill, prstat -a process info and manipulation
logins -p|-d local users without passwords | duplicate uids
mpstat, prtdiag, psrinfo -v processor information and more
traceroute since Solaris 7
troff -man man.1 | dpost | lp print old style man pages
sgml2roff lpfilter.1m | troff -man | dpost | lp print sgml (new) man pages
fstyp -v list superblock including minfree %
tput nice screen output
what, ldd, strings information about binaries
ctrl-V in vi insert control character
ftp> get README | more
ufsdump 0f - /filesystem | (cd /mnt; ufsrestore rf -); rm /mnt/restoresymtable dump restore pipe
echo \007 get bell to ring
comm common (non-common) lines from two files
pkgchk -lp /usr/bin/ls which package does ls belong to?
df -oi -F ufs free inodes
icheck -b blockno filesystem block to file mapping
dircmp, rsync, filesync compare directories, sync utilities
nohup /var/tmp/myscript.ksh > /var/tmp/myscript.out & for things which have to complete (no risk of terminal being logged out)
netstat -pn arp like output when name services are down
pwdx, pldd, ptree and more in /usr/proc/bin
uname -X basic system information - one item on each line (useful for scripts)
read read a line
listusers another way of listing users
tcopy copy tape
nfsstat -m (or check /etc/rmtab) current nfs mount
clear_locks clear nfs locks
df -h, du -h, ls -lh since Solaris 9 - output in powers of 1024

There is also another site which allows you to search various commands within different operating system. Unfortunately, you need to know the key word to search.

Here is another reference useful for Solaris.

This one is not as good but have some information I did not see above.

Here is a quick Reference for AIX.

A similar list for AIX so there might some overlap here.

Alternatively, you can refer to the AIX 4.3 reference book here.

Another good source for AIX information is from IBM's own System Magazine.

Finally, here is a chart of the various commands in different Unix platforms: