SUSE Conversations


Configuring Custom Partition for Proxy Logging



By: bajesh

November 19, 2007 10:25 am

Reads:166

Comments:0

Rating:0

By B Ajesh

Introduction

If you create a custom partition or a directory for logging other than /var, the Linux Access Gateway does not mount the newly added partition, because it is not listed in novell-vmc script. This article describes steps to create partition, edit the novell-vmc script and associate the new partition.

Problem: If you create a partition named /ProxyLog and assign it for extended or common logging, Linux Access Gateway will not use this partition for logging.

Cause: The Linux Access Gateway loads with chroot permissions, and will not mount any partition that is not specified in the novell-vmc script. The newly added partition is not specified in the novell-vmc script and cannot be used for logging as it will not be mounted.

Solution: You must edit the novell-vmc script and associate the partition in the Administration Console.

Creating Log Partition on a New Disk or Free Space

To create a log partition on a new disk or a free space, and associate the new partition to the proxy, follow the steps given below:

  1. Creating a partition
  2. Creating the directories
  3. Editing the novell-vmc script
  4. Restarting proxy
  5. Associating the partition in Administration Console

Step 1: Creating a Partition

You can create partition in one of the following phases:

  1. 1.During manual or advanced Installation of Linux Access Gateway. For more information on how to create partition during installation, refer to the Novell Access Manager Documentation.
  2. 2.Using YaST after the installation of Linux Access Gateway. On another HDD Using Partitioner in YaST

To create partition using YaST:

  1. Login as root.
  2. Enter the following command on the system console:
    yast disk
  3. A warning message is displayed. Accept the warning message.
  4. The Expert Partitioner window is displayed as shown in the figure.
  1. You can create by clicking create, On which disk you want to create, Then give the mount point as the partition-nameEg: /ProxyLog
  2. Click Apply to complete the configuration,Partition will be formated and mounted.

To confirm if the newly added partition is mounted, specify the following command:

df -m
linpxy-27:~ # df -m
The following details are displayed:
Filesystem           1M-blocks     Used  Available    Use%    Mounted on
/dev/sda3                6054       2959      2787     52%    /
tmpfs                    1013          1      1013      1%    /dev/shm
/dev/sda1                  69          7        59     10%    /boot
/dev/sdb8                2056         33      2023      2%    /ProxyLog

Note: Make sure you create the partition on the free space available in the existing disk or on an another disk. Deleting or resizing the existing partition can lead to loss of data.

Step 2: Creating the Directories

Create the directory named the mount point of the newly added partition on /chroot/lag and /chroot/lag-debug
Eg: Login as root and type

mkdir /chroot/lag/ProxyLog
mkdir /chroot/lag-debug/ProxyLog

Step 3: Restarting Proxy

You can restart the proxy using the command:

/etc/init.d/novell-vmc restart

Step 4: Editing the novell-vmc Script

You can use any text editor to edit the script /etc/init.d/novell-vmc

Log in to Linux Access Gateway as a root user and add the below line,in the section setupLagDir() of the script as follows:

mount -n -o bind <partition-name>       $LAG_DIR/<partition-name> 2>&1 > /dev/null

For Eg:

1. echo "setupLagDir" >> /var/log/lag-flow.log
2.    if [ "$1" = "debug-start" ]; then
3.        LAG_DIR="/chroot/lag-debug"
4.    else
5.        LAG_DIR="/chroot/lag"
6.    fi
7.   echo "mounting starts" >> /var/log/lag-flow.log
8.mount -n -o bind <partition-name>  $LAG_DIR/<partition-name> 2>&1 > /dev/null
9.mount -n -o bind /bin        $LAG_DIR/bin 2>&1 > /dev/null
10.mount -n -o bind /sbin $LAG_DIR/sbin 2>&1 > /dev/null
11.mount -n -o bind /usr        $LAG_DIR/usr 2>&1 > /dev/null
12.mount -n -o bind /dev        $LAG_DIR/dev 2>&1 > /dev/null

For our example, line 8 of the above script would be:

mount -n -o bind /ProxyLog        $LAG_DIR/ProxyLog 2>&1 > /dev/null

Add the below line, in the section cleanupLagDir of the script as follows

umount $LAG_DIR/<partition-name>  2>&1 > /dev/null
13.echo "unmounting start" >> /var/log/lag-flow.log
14.        #umount if they are still mounted. Checking for /var/novell alone.
15.        if [ -d "$LAG_DIR/var/novell" ]; then
16.umount $LAG_DIR/<partition-name>  2>&1 > /dev/null
17.umount $LAG_DIR/bin  2>&1 > /dev/null
18.umount $LAG_DIR/sbin 2>&1 > /dev/null
19.umount $LAG_DIR/usr 2>&1 > /dev/null
20.umount $LAG_DIR/dev 2>&1 > /dev/null

In the script, replace <partition-name> with the name of the partition that you have created.

For our example, line 16 of the above script would be:

umount $LAG_DIR/ProxyLog  2>&1 > /dev/null

Step 5: Associating the Partition in the Administration Console

  1. In Administration Console, select Access Gateways > Servers > Configuration > Reverse Proxy.
  2. Click Proxy Service List , then select the Logging tab to enable Common/Extended Logging,
  1. Change the path in Log Directory.
  2. Update the configuration changes.

For more information, refer to the Novell Access Manager Documentation.

Creating Log Directory on an Existing Partition

If you want to log on a directory other than /var, on an existing partition, then you have to first create a directory.

For example, to create a directory and log in to a directory named NewLogDir on / partition, You can do the following:

mkdir /NewLogDir

Follow step 2 to step 5 in the Creating Log Partition on a New Disk or Free Space section.

Replace <Partition Name> in above steps to <Newly Created Log Directory>. For example, in the above case, Replace /ProxyLog with /NewLogDir

Note:

When you upgrade the machine to a new patch or support pack, the novell-vmc script will be overwritten. You can either back up the novell-vmc script before the upgrade and copy the script back to the location after the upgrade, or modify the script again after the upgrade.

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)

Tags: , , ,
Categories: SUSE Linux Enterprise Server, Technical Solutions

Disclaimer: As with everything else at SUSE Conversations, this content is definitely not supported by SUSE (so don't even think of calling Support if you try something and it blows up).  It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.

Comment

RSS