Ahoy there! This is my personal blog which I use as my memory extension and a medium to share stuff that could be useful to others.

Systems Archives

Red Hat Enterprise Linux (RHEL) cluster configuration file is /etc/cluster/cluster.conf

NOTE: Red Hat discourages direct editing of the cluster configuration file and recommends using the system-config-cluster GUI.

However, if you need to edit the file, here’s a method that works:

STEP 1: Edit the  Cluster Configuration file on any one node in the cluster

  • Open /etc/cluster/cluster.conf using your favourite editor amd make your required changes.
  • Ensure that you increment the config_version (in line 2) by 1. For example, if the config_version is 45, then make it 46.
  • Save and close the file

STEP 2: Update the cluster

Execute the following command (with root privileges) on the same node used in STEP 1:

ccs_tool update /etc/cluster/cluster.conf

The above command will display output similar to the following:

Config file updated from version 45 to 46

Update complete.

VN:F [1.6.5_908]
Rating: 0 (from 0 votes)

At times, to meet performance requirements, you would want to disable file system journaling. Given below are steps to do so for an ext4 file system (e.g. /dev/sda1). These steps have been tested on RHEL 5.7). All commands are to be executed with root privileges:

STEP 1: Unmount the file system partition whose journaling you wish to disable

Use the following command to unmount the partition on /dev/sda1 (let’s say it’s /opt):

umount /opt

NOTE: The command used above is umount and not unmount.

STEP 2: Disable journaling for the file system

Use the following command to disable journaling for an ext4 file system:

tune4fs -O ^has_journal /dev/sda1

 

STEP 3: Perform a file system check

Use the following command to perform a file system check. This is not strictly required, but is recommended for checking file system integrity after disabling journaling:

e4fsck –f /dev/sda1

 

STEP 4: Reboot

You may use the following command to reboot the Linux OS:

shutdown –r now

 

STEP 5: Verify that the file system has journaling disabled and the partition is mounted

After the host has rebooted, you may use the following commands to check if journaling is disabled for the filesystem and the partition is mounted:

dmesg | grep EXT4

Expected output similar to: EXT4-fs (dm-3): mounted filesystem without journal

df -h

 

In order to re-enable journaling, repeat all the STEPS above, but without the ‘^’ in STEP 2.

VN:F [1.6.5_908]
Rating: +2 (from 2 votes)

How PAM works

Pluggable Authentication Modules (PAM) is a framework used for authentication. Typically, most Linux distros come with PAM installed by default. PAM can be powerful if used well and it’s important to understand how PAM works. PAM has its criticisms, but is quite adequate for most purposes.

Refer this LINUX FORMAT article for a good introduction to PAM.

For easy reference, I’ve stitched together an image of important PAM concepts (shown below) taken from the LINUX FORMAT article.

PAM

 

                 First published in lxf

VN:F [1.6.5_908]
Rating: 0 (from 0 votes)

Problem:

When changes are made to /etc/security/limits.conf to apply limits for resources (e.g. file descriptors, processes), the changes are not visible in my Shell (SSH Session). However, when using programs such as su, the changes are visible.

Background:

/etc/security/limits.conf is the configuration file for the pam_limits PAM module. By default, the pam_limits module is used in ssh policies in /etc/pam.d. However, the SSH server must be configured to use PAM.

Solution:

  • Make your SSH server PAM-aware by setting one or both of the following in the SSH configuration file:
  • UsePamSessions=yes
    
          or
    
    UsePAM=yes
    
  • Restart the SSH server

Root Cause:

The SSH server was not configured to use PAM.

 

NOTE:

(1) The solution above describes a successful problem-solving experience and may not be applicable to other problems with similar symptoms.

(2) Your rating of this post will be much appreciated. Also, feel free to leave comments.

 

VN:F [1.6.5_908]
Rating: +3 (from 3 votes)

Sendmail is a popular Mail Transfer Agent (MTA) and it is the default MTA on Red hat Linux Enterprise (RHEL). Typically, within enterprises, you will need a Mail User Agent (MUA), an MTA and an SMTP Relay to send emails (outbound) from the Linux command-line or shell scripts.

So, let’s assume that your Mail Administrator provides you IP addresses of primary (192.168.1.1) and secondary (192.168.2.2) SMTP Relay hosts. Given below are steps to configure sendmail (on RHEL 4) to use the SMTP relays to send email (you must use root user’s privileges):

STEP 1: Verify sendmail packages

In order to configure sendmail, you will require the sendmail and sendmail-cf packages. Given below is an example of how to check for these packages:

rpm -qa | grep sendmail

sendmail-8.13.1-3.3.el4
sendmail-cf-8.13.1-3.3.el4

STEP 2: Modify sendmail.mc

Do not edit /etc/mail/sendmail.cf. Instead, you must edit /etc/mail/sendmail.mc (more readable than sendmail.cf) and use the m4 macro processor to generate sendmail.cf.

Edit /etc/mail/sendmail.mc and add the following line:

define(`SMART_HOST',`[192.168.1.1]:[192.168.2.2]')

Note:

(1) Pay attention to the quotes. Do not prefix the above by the letters dnl as dnl (delete to new line) denotes a comment in sendmail.mc

(2) If you wish to configure only 1 SMTP relay host (e.g. 192.168.1.1), then add the following:

define(`SMART_HOST',`192.168.1.1')

STEP 3: Start/Restart sendmail

When sendmail is started (if not running) or restarted (if running), then the sendmail.mc file will be processed by the m4 macro processor and a corresponding sendmail.cf will be generated. On RHEL, you may start sendmail as follows:

/sbin/service sendmail start

STEP 4: Use an MUA to test outbound mail

In order to test your sendmail configuration and the SMTP relays, use an MUA to send emails. Given below is an example that uses mutt to send emails:

mutt -s "test email" test@abc.com < /dev/null
VN:F [1.6.5_908]
Rating: +7 (from 7 votes)