Archive
Posts in Linux
Viewing the scripts that run when you install a Linux RPM
RPM packages contain the ability to run scripts after a package is added or removed. These scripts can perform actions like adding or removing users, cleaning up temporary files, or checking to make sure a software component that is contained within a package isn't running. To view the contents of the scripts that will be run, you can use the rpm "--scripts" option: RPM provides four types of pre and post installation scripts that can be run: preinstall scriptlet -- this will run before a package is installed * postinstall scriptlet -- this will run after a package is installed* preuninstall scriptlet -- this will run before a package is uninstalled * postuninstall scriptlet -- this will run after a package is uninstalled There are some awesome RPM options buried in the documentation, and you will definitely want to read through the various RPM resources prior to creating RPMs.
$ read more →Why isn't Oracle using huge pages on my Redhat Linux server?
I am currently working on upgrading a number of Oracle RAC nodes from RHEL4 to RHEL5. After I upgraded the first node in the cluster, my DBA contacted me because the RHEL5 node was extremely sluggish. When I looked at top, I saw that a number of kswapd processes were consuming CPU: The kswapd process is responsible for scanning memory to locate free pages, and scheduling dirty pages to be written to disk. Periodic kswapd invocations are fine, but seeing kswapd continuosly appearing in the top output is a really really bad thing…
$ read more →Using the Linux parted utility to re-create a lost partition table
I ran into an issue last week where two nodes using shared storage lost the partition table on one of the storage devices they were accessing. This was extremely evident in the output from fdisk: Fortunately the system in question still had the /proc/partition data in tact, so I stashed that in a safe location and came up with a plan to re-recreate the partition tables using this data. Given the following /proc/partitions data for the device listed above: I can see that the device had two partion table entries, and the device was approximately 100GB in size. To re-create the partition tables, I used the parted mkpart command passing it the starting and ending sector numbers I wanted written to the partition table: Now you may be asking yourself where did I get the starting and ending sectors from…
$ read more →Keeping up to date with CentOS happenings
I just found out the folks in the CentOS community have a planet feed! If you are interested in keeping up to date with all things CentOS, you should add their feed to your RSS reader.
$ read more →Watching process creation on Linux hosts
I have been debugging a problem with Redhat cluster, and was curious if a specific process was getting executed. On my Solaris 10 hosts I can run execsnoop to observe system-wide process creation, but there isn't anything comparable on my Linux hosts. The best I've found is systemtap, which provides the kprocess.exec probe to monitor exec()'s. To access this probe, you can stash the following in a file of your choosing: Once the file is created, you can execute the stap program to enable the exec probe: This will produce output similar to the following: While systemtap is missing various features that are available in DTrace, it's still a super useful tool!
$ read more →