Process States in UNIX and Linux

 How can a parent and child process communicate?
A parent and child can communicate through any of the normal inter-process communication schemes (pipes, sockets, message queues, shared memory), but also have some special ways to communicate that take advantage of their relationship as a parent and child. One of the most obvious is that the parent can get the exit status of the child.
What is a zombie?

System File Checker ( SFC) at Windows

SFC is System File Checker. SFC is running in system to protect system files. All the system files are located in C:\Windows and C:\Windows\System32 folders. These files are important for Windows Operating to work effeciently. If any of the files is deleted accidently the file gets restored from the DLLCache folder automatically with the help of SFC. 


Sometimes, you might need to disable the SFC for development and testing purpose. This article explains the registry keys you can play with to disable the SFC and various options.



  • KEY Name:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon
  • Entry Name: SFCDisable
  • Date Type: REG_DWORD

Online Data Relocation to another disk in Linux


You can move data while the system is in use with the pvmove command in Linux server. This will be helpfull if you want to take the disk out from the linux server. After pvmove, you have to remove the PV from volume group to take out from the server.


The pvmove command breaks up the data to be moved into sections and creates a temporary mirror to move each section. 


The following command moves all allocated space off the physical volume /dev/sdb1 to other free physical volumes in the volume group:


pvmove /dev/sdb1


The following command moves just the extents of the logical volume MyLVOL1.

Configuring Network Bonding in Linux

This is an Nice Article which I found on Web..

Bonding is creation of a single bonded interface by combining 2 or more ethernet interfaces. This helps in high availability and performance improvement.

Here is the steps for creating a network bonding in Fedora Core and Redhat Linux

Step 1:

Create the file ifcfg-bond0 with the IP address, netmask and gateway. Shown below is my test bonding configuration file.

$ cat /etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE=bond0
IPADDR=192.168. 1.100
NETMASK=255. 255.255.0
GATEWAY=192. 168.1.1
USERCTL=no
BOOTPROTO=none
ONBOOT=yes

Find RPM packages installed on particular date

To find all the RPM packages which were installed on a particular date in a Linux Server:

# rpm -qa --queryformat "%{NAME}-%{VERSION}.%{RELEASE} (%{ARCH}) INSTALLED: %{INSTALLTIME:date}\n" | grep my_date 


Example:


rpm -qa --queryformat "%{NAME}-%{VERSION}.%{RELEASE} (%{ARCH}) INSTALLED: %{INSTALLTIME:date}\n" | grep "21 Sep 2009"

To find the install date and time of a particular RPM package in a Linux Server:

Automatic reboot after Kernel Panic in Linux

In Linux, By default after kernel panic, Linux waits for a system admin to restart or power cycle server.. We can change this behavior and set to reboot automatically when a kernel panic occurs.. For that, we have to change the value set on "kernel.panic" kernel parameter.


Now we have to check the current value on this kernel parameter in Linux server:

[root@myserver ~]# cat /proc/sys/kernel/panic
0
[root@myserver ~]# sysctl -a | grep kernel.panic
kernel.panic = 0

Find WWN Address in AIX

Here is the steps to find the WWN Address of Fiber channel Adapter in AIX Server.


First We will find out all the installed FC (Fiber channel) Adapters in AIX Server.


To do, type the following command:


# lsdev -Cc adapter | grep fcs
fcs0 Available 01-10 FC Adapter
fcs1 Available 01-11 FC Adapter


The above output shows all the FC Adapters installed on the AIX server.


Now to Find out the WWN Number (Address) of each Adapter, type the following command:

Temporarily Stop or Pause Process in Linux Server

Some times we may need to pause a particular process or service in Linux Servers.


We may need to stop a particular process without killing it for certain period of time and resume it again.


This can be done with KILL Command.


Most of us familiar with KILL comman. But this is the another feature of KILL command, which helps to achieve this:




To Stop a Process or Job: 

PAM Authentication for Squid Proxy Server

Here the steps to PAM Authentication for squid proxy server. We are going to use the pam_auth module. 
This will allow anyone who has a Linux or Unix shell account, will be able to use the Squid server


To configure PAM Authentication, Edit the /etc/squid/squid.conf file:


Search for the auth_param section in the config file and add or uncomment these lines:



auth_param basic program /usr/lib/squid/pam_auth
auth_param basic children 5
auth_param basic realm Squid proxy-caching
web server
auth_param basic credentialsttl 2 hours


Next, search for the following line and uncomment it:


acl password proxy_auth REQUIRED

Recover Bad Superblock in Linux Filesystem

If  you get a ¨Damaged Superblock¨ error message at filesystem (fsck) check in Linux Server, Usually fsck will not be able to repair the file system due to bad super block. In these situations, we can recover the damaged super block from the backup. 

Solution:


There are backups of the Superblock located on several positions and we can restore them with a simple command in a Linux server



By default in Linux, the file system creates the backup of  super block in the following locations:


8193, 32768, 98304, 163840, 229376 and 294912.