SysAdmin Blog, TechTips and Reviews

Unix Linux – Solaris Redhat Ubuntu – Open Source



Archives Posts

OpenLDAP Installation on Sun Blade 100

August 29th, 2007 by elizar

This is an OpenLDAP installation on the following system:

System Configuration: Sun Microsystems sun4u
Memory size:
1024 Megabytes

Sun-Blade-100 (UltraSPARC-IIe)

Prerequisites:

Depending on the requirements, there may be a need to install some third party softwares:

  • OpenSSl
  • Kerberos
  • SASL
  • Berkeley DB
  • TCP Wrappers
  • and others

Need to make sure the following variables is set:

Variable Description
CC Specify alternative C Compiler
CFLAGS Specify additional compiler flags
CPPFLAGS Specify C Preprocessor flags
LDFLAGS Specify linker flags
LIBS Specify additional libraries

(additional: Need to install gcc, ar (binutils) libiconv libintl-3.4.0-sol8-sparc-l as well as Berkeley DB on server)

With the initial installation I will set it up using

# ./configure

# make depend

# make

# make test

Finally,

# su root -c ‘make install’

That’s it, hopefully all will go well.. If it doesn’t, we’ll post the error (and hopefully solution).

Cheers!

Archives Posts

Route, Routing, Routing Table

August 18th, 2007 by elizar

Here’s some information about routing from a Unix (Solaris) box. Got this request from one of the Network people to add a static route on a server.

The command

# netstat -rn

show the routing table on a *nix machine .

The ‘route’ command manually manipulates the network routing table on a Unix box.

The add and delete sub-commands have the following syntax:

route [ -fnvq ] cmd destination gateway [metric/netmask]

So to display server1′s routing table,

 [root@server1]# netstat -rn
Routing Table: IPv4
Destination           Gateway           Flags  Ref   Use   Interface
——————– ——————– —– —– —— ———
10.122.23.0           10.122.23.32         U        11340517  ce0
224.0.0.0               10.122.23.32         U        1      0  ce0
default                    10.122.23.1          UG       1 687333
127.0.0.1                127.0.0.1             UH       1  27928  lo0

Another example:

If we wanted to reach 192.168.1.0 network passing through 10.122.23.32 we could add the network by using the ‘route’ command:

 [root@server1]# route add 192.168.1.0 10.122.23.32 1

Checking routing table:

 [root@server1]# netstat -rn
Routing Table: IPv4
Destination           Gateway           Flags  Ref   Use   Interface
——————– ——————– —– —– —— ———
10.122.23.0           10.122.23.32         U        11340517  ce0
224.0.0.0               10.122.23.32         U        1      0  ceo
192.168.1.0            10.122.23.32         UGH  1
default                    10.122.23.1          UG       1 687333
127.0.0.1                127.0.0.1             UH       1  27928  lo0

The only problem with this is that if the server is rebooted, the manually added static route will be gone. If order to retain that route, it has to be added in one of the startup script.

You could create a  script in one of the RC directory, name it something relevant like, say S90StaticRoutes or something and add the ‘route add’ line we did above.

Filed under Linux, Unix having No Comments »

Archives Posts

Soft and Hard Links… Explained

August 8th, 2007 by chelsy

A friend and I were kind of reviewing some HPUX/Solaris commands and ideas. She asked “What were the difference between hard and soft links?”. Unable to get the answer at once, I of course consulted my Solaris Administration guide. I also got curious cause I really don’t mind what their difference is, all I care about is that they were linked and that’s it. So here goes the difference between Mr Hard and Ms. Soft Link….

First, what are links? A link is a pointer to another file or directory. Links provide a mechanism for multiple file names to reference the same data on disk.

Soft (Symbolic) Links is a shortcut (like a desktop shortcut on Windows). The syntax for creating a symbolic link is as follows:

ln -s source-file link-name

Now when you list the contents of the directory you see two files:

3588 -rw-r--r--   1 chelsy staff       30 Jun 17 17:51 file1
3594 lrwxrwxrwx   1 chelsy staff       5  Jun 17 18:09 link1 -> file1

Hard link is more difficult to determine, because they are not so obvious when viewed with the ls -li command. The syntax is :

ln file1 link1 (No –s?)

What you could notice is that the inode in each file is the same when you list them. Notice the first column, all of which have 1898 value, meaning the files in the list have the same inode number, therefore, is the same file.

1898  4 -rwxr--r--   5 root   sys    3506 Jan 10  2005 /etc/init.d/init.wbem
1898  4 -rwxr--r--   5 root   sys    3506 Jan 10  2005 /etc/rc0.d/K36wbem
1898  4 -rwxr--r--   5 root   sys    3506 Jan 10  2005 /etc/rc1.d/K36wbem
1898  4 -rwxr--r--   5 root   sys    3506 Jan 10  2005 /etc/rc2.d/S90wbem

1898 4 -rwxr–r– 5 root sys 3506 Jan 10 2005 /etc/rcS.d/K36wbem

So what is the difference then? Except for the syntax with no –s in the option, try deleting the source file in the soft link.

In Soft Link, if you remove file1, the source file, link1 will still exist, but it points to a file that does not exist. So when you open link1,

cat link1

The cat command can’t print out the contents of the file, so you get this message:

cat: Cannot open link1

In Hard Link, if you remove file, the source file, link1 will still exist and you will still be able to open it. The data will not be deleted until you destroy the last file that shares this inode number. Nice huh???

Pros and Cons???

A hard link cannot span file systems; it can only point to another file located within its file system. The reason is that hard links all share an inode number. Each file system has its own set of inode numbers; therefore, a file with inode number 1234 in the /export/home file system may not even exist in the /usr file system.

An advantage of a symbolic link over a hard link is that you can create a symbolic link to a file that does not yet exist. You cannot create a hard link unless the source file already exists.

Makes sense?

Filed under Solaris, Unix having 1 Comment »

Archives Posts

from DUSK…

August 7th, 2007 by elizar

We UNIX SysAds have many many tools that can help us administer our servers. What’s great about UNIX is that you don’t have to learn the complicated commands to do what’s need to be done.


There is a saying in the UNIX world that a complex command is just a few commands used altogether. We usually apply pipes on these stuff.

Let’s take DUSK for example… or it can really be DUCKS depending on what version of DU you use.

DUSK is what I use very often every time I want to know the disk usage of the current file systems and the sub directories under that.

The command,

du -sk * | sort -n | more

does exactly that. And here’s the output when executed my home directory.

bash-2.05# du -sk * | sort -rn | more
4409 nrpe
4263 tmp
3399 xilinx
1048 dl4.files
465 unixstuff
244 scripts
30 hosts
7 doy
6 list.tqs.032206
4 LICENSE.TXT
2 help
1 netapp
1 hp84k.NIS

As you can see, it listed all the size of the files and the directories. This is a useful command specially if you’re looking for the disk space hog on you filesystem.


But why use such long command when you can use ‘dusk’ ? I don’t know about you but ‘du -sk * | sort -rn | more’ is a mouthful than ‘dusk’ right?

Here’s what you do: Simply create and alias for that command and assigned it to ‘dusk’ and you’re done.

bash:

# alias dusk=’du -sk * | sort -rn | more’

csh

% set dusk= du -sk * | sort -rn | more

Try it. It will save you tones of typing errors! ;)

Filed under Linux, Tips, Unix having No Comments »

Archives Posts

Most Common UNIX Find Command

August 5th, 2007 by elizar

The find command is the most useful command on a UNIX box. System administrators use this powerful utility frequently.

Presented here, ladies and gentlemen, are the most commonly used ‘find’ options.

(Let’s add more as time goes on, alright?)

Find a file or directory
# find . -name TEMP -print
or
# find . -name TEMP -exec echo {} \;

Find core files in this directory tree and remove them
# find . -name “core” -exec rm -f {} \;

Find junk directories and remove their contents recursively
# find . -name “junk” -exec rm -rf {} \;

Read the rest of this entry »

Filed under Solaris, Tips, Unix having No Comments »

Archives Posts

Popular Unix Flavors

August 4th, 2007 by elizar

Unlike Windows, you know that it is from Microsoft and is only one. Unix, however is not a single operating system. It has many flavors (aka. variants, types, or implementations). Although based on a core set of Unix commands, different flavors have their own unique commands and features, and designed to work with different types of hardware.

The following are some of the well-known Unix flavors. By no means this is complete. No one knows exactly how many variants UNIX has, but is surely in the hundreds, including the obsolete ones.

AIX by IBM
BSD/OS (BSDi)
by Wind River
CLIX by Intergraph Corp.
Debian GNU/Linux by Software in the Public Interest, Inc.
Tru64 Unix (formerly Digital Unix) by Compaq Computer Corp.
DYNIX/ptx by IBM (formerly by Sequent Computer Systems)
Esix Unix Esix Systems
FreeBSD by FreeBSD Group
GNU Herd by GNU Organization
HAL SPARC64/OS by HAL Computer Systems, Inc.
HP-UX by Hewlett-Packard Company
Irix by Silicon Graphics, Inc.
Linux by several groups several
LynxOS by Lynx Real-Time Systems, Inc.
MacOS X Server by Apple Computer, Inc.
NetBSD by NetBSD Group
NonStop-UX by Compaq Computer Corporation
OpenBSD by OpenBSD Group
OpenLinux by Caldera Systems, Inc.
Openstep by Apple Computer, Inc.
Red Hat Linux by Red Hat Software, Inc.
Reliant Unix by Siemens AG
SCO Unix by The Santa Cruz Operation Inc.
Solaris by Sun Microsystems
SuSE by S.u.S.E., Inc.
UNICOS by Silicon Graphics, Inc.
UTS by UTS Global, LLC

Filed under Unix having No Comments »

Next Entries »