Friday, September 18, 2009

How to enable kernel dumps on RH4

This was rather annoying to find, so for now, a pointer --
http://www.nocrack.fr/?p=24

Monday, June 22, 2009

Fixing X11 on Red Hat

Every time I upgrade the kernel on my Red Hat machine and reboot, startx errors out. The xorg.0.log says, "(EE) NVIDIA(0): Failed to load the NVIDIA kernel module!"

NVidia has tips here, but they are predicated on running modprobe nvidia. When I did that, modprobe and rmmod reported that the nvidia driver was not present in /proc/modules.

The fix for my machine:
  1. Run nvidia-installer --update
    • OR, Run nvidia-installer-latest to get the FTP URL for the latest nvidia driver.
    • Download same using wget. (Cut & paste may work.)

Tuesday, March 24, 2009

Extending a swap LVM in Redhat 4 or 5

This refers to a pre-production box. Note, before you start, that swapoff is involved, and consider whether you want to do that to a busy box. :)
  • lvscan
  • lvextend --size +4G /dev/someVG/someVol
  • lvscan
  • free -m
  • swapoff
  • mkswap /dev/someVG/someVol
  • swapon -va
  • free -m

Monday, March 23, 2009

Install Oracle DB 10g on RH5

N.B.: Blogger has hosed up some of the text blocks below. If you receive strange warnings about invalid options or field formats, you may need to retype some of the values here or otherwise convert them to plaintext.

Oracle Database 10g refuses to install on Redhat AS 5 because the OS is newer than the app. It's not hard to fix, especially if you have some chewing gum and baling wire on hand, but the fix is a right PITA to find.

I have some inanely long-winded docs from Metalink which (overlapping slightly with the 10g Quick Install) boil down to this:
  1. Make sure that the server's primary IP address is associated with the primary, or lowest-numbered, NIC. For example, the installer will fail obscurely if your main, named, network IP is on eth2 and your management network interface is on eth0.

    Don't be dense: ask yourself whether this requires recabling.

  2. Create oracle:oinstall and set its home directory to ORACLE_BASE (read on to see what ORACLE_BASE means.)
    • Add ORACLE_BASE and ORACLE_SID to the oracle user's shell profile; for example:
      # vi /home/oracle/.bash_profile
      export ORACLE_BASE=/u01/app/oracle
      export ORACLE_SID=orcl
      unset ORACLE_HOME
  3. Edit database/install/oraparam.ini thusly:
    [Certified Versions]
    Linux=redhat­3,SuSE­9,redhat­4,UnitedLinux­1.0,asianux­1,asianux­2,redhat­5 

  4. Edit database/stage/prereq/db/refhost.xml, inserting the following before the Operating System stanza for Redhat 9:
    <OPERATING_SYSTEM> 
    <VERSION VALUE="5"/> 
    <ARCHITECTURE VALUE="x86"/> 
    <NAME VALUE="Linux"/> 
    <VENDOR VALUE="redhat"/> 
    <GLIBC ATLEAST="2.5­12"> 
    </GLIBC> 
    <PACKAGES> 
    <PACKAGE NAME="make" VERSION="3.81" /> 
    <PACKAGE NAME="binutils" VERSION="2.17" />
    <PACKAGE NAME="gcc" VERSION="4.1" > 
    <PACKAGE NAME="libaio" VERSION="0.3.106" > 
    <KERNEL> 
    <PROPERTY NAME="semmsl" NAME2="semmsl2" VALUE="250" /> 
    <PROPERTY NAME="semmns" VALUE="32000" /> 
    <PROPERTY NAME="semopm" VALUE="100" /> 
    <PROPERTY NAME="semmni" VALUE="128" /> 
    <PROPERTY NAME="shmmax" VALUE="536870912" /> 
    <PROPERTY NAME="shmmni" VALUE="4096" /> 
    <PROPERTY NAME="shmall" VALUE="2097152" /> 
    <PROPERTY NAME="file­max" VALUE="65536" /> 
    <PROPERTY NAME="VERSION" VALUE="2.6.9" /> 
    <PROPERTY NAME="ip_local_port_range" ATLEAST="1024" ATMOST="65000" /> 
    <PROPERTY NAME="rmem_default" VALUE="262144" /> 
    <PROPERTY NAME="rmem_max" VALUE="262144" /> 
    <PROPERTY NAME="wmem_default" VALUE="262144" /> 
    <PROPERTY NAME="wmem_max" VALUE="262144" /> 
    </KERNEL> 
    </OPERATING_SYSTEM> 
    • Or use the following in the same spot for a client-only install:
      <OPERATING_SYSTEM> 
      <VERSION VALUE="5"> 
      <ARCHITECTURE VALUE="x86"> 
      <NAME VALUE="Linux"> 
      <VENDOR VALUE="redhat"> 
      <PACKAGES> 
      <PACKAGE NAME="make" VERSION="3.81" > 
      <PACKAGE NAME="binutils" VERSION="2.17" > 
      <PACKAGE NAME="gcc" VERSION="4.1" > 
      </PACKAGES> 
      </OPERATING_SYSTEM> 

  5. Use the info you added to refhost.xml to solve dependencies before running the installer. Hints from Oracle:
       
    • gcc­-4.1.1 ­52.el5.i386.rpm 
    • libstdc++­-devel­-4.1.1­52.el5.i386.rpm 
    • glibc-­devel-­2.5­12.i386.rpm 
    • glibc­-headers-­2.5­12.i386.rpm 
    • libgomp­-4.1.1­52.el5.i386.rpm 
    • gcc­-c++-­4.1.1­52.el5.i386.rpm
    • libXp-­1.0.0 ­8.i386.rpm 
    • compat-libstdc++­-33­-3.2.3­61.i386.rpm 
    • compat ­libstdc++­296­2.96­138.i386.rpm 
    • sysstat­-7.0.0­3.el5.i386.rpm

    All of these should be available on RHN.

  6. Make sure the following lines/values are in /etc/sysctl.conf, then activate them with sysctl -p:
    kernel.shmmni = 4096 
    kernel.sem = 250 32000 100 128 
    fs.file­max = 65536 
    net.ipv4.ip_local_port_range = 1024 65000 
    net.core.rmem_default = 1048576 
    net.core.rmem_max = 1048576 
    net.core.wmem_default = 262144 
    net.core.wmem_max = 262144 
    net.ipv4.tcp_wmem = 262144 262144 262144 
    net.ipv4.tcp_rmem = 4194304 4194304 4194304 
  7. More /etc edits ...
    • Add this to /etc/security/limits.conf:
      oracle soft nproc 2047 
      oracle hard nproc 16384 
      oracle soft nofile 1024 
      oracle hard nofile 65536 
    • Add to /etc/pam.d/login: session required pam_limits.so

    • Add to /etc/profile:
      if [ $USER = "oracle" ]; then 
      ulimit -­u 16384 
      ulimit -n 65536 
      fi 

  8. Now, now, only NOW may you run the installer. At. Your. Peril.
    (Don't forget to use an X-enabled session. Doh.)

Monday, October 6, 2008

Extending swap on RH LVM

Here: http://www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/Deployment_Guide-en-US/s2-swap-extending-lvm2.html

1. Disable swapping for the associated logical volume:
# swapoff -v /dev/VolGroup00/LogVol01

2. Resize the LVM2 logical volume by 256 MB:
# lvm lvresize /dev/VolGroup00/LogVol01 -L +256M

3. Format the new swap space:
# mkswap /dev/VolGroup00/LogVol01

4. Enable the extended logical volume:
# swapon -va

5. Test that the logical volume has been extended properly:
# cat /proc/swaps # free

Wednesday, August 13, 2008

Buggy ErrorDocument behavior in httpd 2.2.3

... and apparently earlier, too. I'm seeing lots of posts, and not spotting anything helpful in the documentation.

I've tried several cases for the ErrorDocument directive, and they break variously. (ETA: Actually, the http:// method works. Hooray!)

For the record, under httpd 1.3, the directive was
   ErrorDocument 404 /redirect/notfound.php
within a <VirtualHost, referring to a "redirect" subdirectory within the webroot.

  1. Put the error document outside the webroot, such as in ../error/404.html.

    Directive:
    <VirtualHost>
        ErrorDocument 404 /web/sph/error/404.html
    </VirtualHost>


    Note - all directives are within the virtualhost context. I started to experiment with the directory context, but I'm omitting that part since the results were the same.

    Result:
    A standard 404 with the note, "Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."

    Error_log:
    [Wed Aug 13 19:39:27 2008] [error] [client 10.0.0.246] File does not exist: /web/sph/html/asf
    [Wed Aug 13 19:39:27 2008] [error] [client 10.0.0.246] File does not exist: /web/sph/html/web

    Where on earth is it getting that "web" part??

  2. Okay, well, let's try putting the errordoc directly in the webroot.

    Directive:
        ErrorDocument 404 404.html

    Result:
    It actually DISPLAYS THE WORDS "404.html".

    Error_log:
    [Wed Aug 13 19:42:17 2008] [error] [client 10.0.0.246] File does not exist: /web/sph/html/asf



  3. Okay, let's put quotes around that last one.
    Directive:
        ErrorDocument 404 "404.html"

    Result:
    Same as above


  4. Fine ... try same location, full path. With and without quotes.

    Directive:
        ErrorDocument 404 /web/sph/html/404.html

    Result:
    Same as #1

    Error_log:
    [Wed Aug 13 19:46:54 2008] [error] [client 10.0.0.246] File does not exist: /web/sph/html/asf
    [Wed Aug 13 19:46:54 2008] [error] [client 10.0.0.246] File does not exist: /web/sph/html/web

  5. Screw you, httpd.

  6. Okay, obviously something different is necessary. Try it with an URL.
    Directive:
        ErrorDocument 404 http://www.whereiwork.edu/errdoc/404.html

    Result:
    If the subdirectory was named "error", I got a warning about an impossible redirect. Since that wasn't coming from anything I'd configured, I guessed "error" was reserved for something and changed it to errdoc. At that point, I got the actual contents of the doc I wanted.

I'd like to understand how this directive is supposed to work, or find the bug report thereon, but I'd like much more to go home.

Friday, July 11, 2008

Enabling NTP on Sol 10

- Create /etc/inet/ntp.conf containing
server ntp.mycompany.com
driftfile /etc/ntp.drift


- Create /etc/ntp.drift containing
0.0

- Start the NTP client
svcadm ntp enable
(Look in /etc/rc2.d on Sol 9)

I have read that Solaris NTP does not start updating until it is 10 minutes out of whack.