Skip to main content

Posts

Showing posts from November, 2013

Core dump ignores facl (setfacl) in RHEL

I had been tasked with figuring out how to have an environment that would allow multiple users to access core files.  I thought: simple enough, I'll just have to mess around with the facl for the directory, specifically the "default" entry. Well, I was wrong.  I had attempted: # remount filesystem and enable acl chmod 775 /u01/core chmod g+s /u01/core chgrp smsvcs /u01/core setfacl -m g::rwx,o:rwx,d:o::r-x /u01/core It turns out that the coredump function (do_coredump) creates the file 0600 int do_coredump (long signr, struct pt_regs * regs ) 919 { 920 struct linux_binfmt * binfmt; 921 char corename[6+sizeof( current -> comm )]; 922 struct file * file ; 923 struct inode * inode ; 924 925 lock_kernel (); 926 binfmt = current ->binfmt; 927 if (!binfmt || !binfmt->core_dump) 928 goto fail; 929 if (! current ->dumpable || atomic_read (& current ->...

HBA card report

Found a cool script that I wanted to "archive" http://yenonn.blogspot.com/2013/10/script-to-report-hba-cards-status.html Author: yenonn@gmail.com function check_hba () {         # Checking Emulex HBA cards status         if grep -q -i "online" /sys/class/fc_host/host*/port_state 2>/dev/null         then                  num_online_hba=`grep -i "online" /sys/class/fc_host/host*/port_state | wc -l`                 total_hbas=`ls -1 /sys/class/fc_host/host*/node_name | wc -l`                 echo "Linux discovered $num_online_hba HBAs is online out of $total_hbas cards."                 for h in `ls -1 /sys/class/fc_host/host*/node_name | awk -F/ '{print $5}'`                 do         ...

Repo Sync to non-current CentOS release

WARNING:  This might actually screw up your Spacewalk system :-(  I think the correct path would be to sync 6.3 first, then 6.4, etc... Feel free to attempt it though. I'm attempting to build out a FOSS (emphasis on FREE ;-) replica of my RHEL environment at work in my home.  Seems simple enough.  One significant difference is how Satellite varies from Spacewalk in initial sync. My goal is to use spacewalk-clone-by-date to show how you can utilize "rolling" channel release dates and use the clone to bring the channel up to a date that you would like all your hosts patched "current" to.  The problem is: I built my spacewalk server in November of 2013 and the only release it seems to have grabbed is 6.4.  So, any arbitrary date I select, simply defaults back to 6.4 as that is all I have. So - I don't want to get terribly in-depth, but I decided I can conclude my testing if I had two minor-release versions - 6.4 and 6.3. My spacewalk repo for "b...

Kickstart Failure on dbus

Summary:  if you see "a fatal error occurred when installing dbus" during kickstart, remove the Updates Channel from your available repos for that kickstart. I am trying to replicate my Satellite environment from work at home using Spacewalk.  Granted, paying for support on Red Hat affords you a number of advantages, and the RHN Tools channel is one of them.  I like to automate everything as much as possible, but also have it straight-forward and simple, that way when I upgrade/migrate/whatever - I am not spending time trying to determine what I had originally intended to do and then how to make it work again. Anyhow.. the issue was that I was unable to get my system to register to the Spacewalk system during kickstart (rhnreg_ks, etc.. was not there).  I was unsure which channel contained the necessary pieces, so I updated my kickstart image to simply use ALL the Channels I had.  After which I received the following error during install: a fatal error o...

Add Puppet Labs Repo to Satellite/Spacewalk

I specifically did this on my Spacewalk system (not Satellite) but I assume the procedure is the same. NOTE: If someone feels this is not a valid approach to this, please let me know and I will update the approach or take it down. - You do NOT need to do this part - I downloaded and installed the Puppet RPM to gather info regarding their public repo sudo rpm -ivh http://yum-enterprise.puppetlabs.com/el/6/extras/x86_64/puppetlabs-enterprise-release-extras-6-2.noarch.rpm  - You do NOT need to do this part -       I only imported that RPM to get the following info (/etc/yum.repos.d/puppetlabs.repo)   [puppetlabs-products] name=Puppet Labs Products El 6 - $basearch baseurl=http://yum.puppetlabs.com/el/6/products/$basearch gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs enabled=1 gpgcheck=1 I also used the name of the repo they have chosen. Then login to your Spacewalk admin portal, click on  Channels | Manage Software Channels | Man...

Update or Install DRAC license from OS

I had a motherboard replaced due a DRAC failure.  Once the system came back up, I noticed the DRAC was still offline... ugg... After further digging and several reboots, I determined that the DRAC was not a viable option to configure.  More digging indicated that my Enterprise DRAC license was not present.  Unfortunately this was hours after my change window expired.  So - now that I have a DRAC license, how do I get it on my system without a reboot. ~~~ [root@server ~]# ls /opt/dell/srvadmin/bin/idracadm && myRACADM="/opt/dell/srvadmin/bin/idracadm" [root@server ~]# ls /opt/dell/srvadmin/bin/idracadm7 && myRACADM="/opt/dell/srvadmin/bin/idracadm7" [root@server ~]# $myRACADM config -g cfgLanNetworking -o cfgNicSelection 1 ERROR: SWC0242 : A required license is missing or expired. Obtain an appropriate license and try again, or contact your service provider for additional details. Required License -- Dedicated NIC ~~~ After...

Backup and Restore Kickstart Profiles

We had an issue which was the result of our "Organization" changing when we renewed our Certificate (to add entitlements).  It was a seemingly harmless change, which caused some huge issues.  Basically the person that created our Certificate capitalized all of the letters in our Organization name, whereas everything had been originally created with mixed-case letters. I.e. What a Bummer != WHAT A BUMMER Anyhow - I recommend doing this as part of your daily backup procedure regardless... tar -cvf ${BACKUPDIR}/var_lib_rhn_kickstarts_upload.tar /var/lib/rhn/kickstarts/upload/ You will know that kickstart profiles are screwed up when you attempt to modify them and you get an error, followed by a blank profile the next time you attempt to modify it. The recovery: rhn-satellite stop cp  var_lib_rhn_kickstarts_upload.tar / tar -xvf var_lib_rhn_kickstarts_upload.tar rm /var/lib/cobbler/config/profiles.d/ rhn-satellite start

3rd party Reposync - RHN Satellite

We import a number of packages from 3rd party repos (Oracle, EPEL, Nginx) in to our Satellite. Here is a script I created which manages our 3rd-party-reposync #!/bin/sh ## ## THIS SCRIPT RELIES ON THE RHNSAT HOST HAVING A YUM REPO DEFINED FOR THE ## VENDOR SUPPLIED REPO ## ## YOU WILL NEED TO ENABLE THE PUBLIC ORACLE REPO FOR ##   el5_latest ##   ol6_latest ## NOTE: You definitely need to include/exclude packages specific to oracleasm NOTIFICATION=0 CONFIG=/etc/yum.conf.reposync EMAIL=james.radtke@blah.com LOGFILE=/tmp/3rd-party-reposync.out LOCKFILE=/var/run/3rd-party-reposync.lock DEBUG=0 DOM=`date +%d` # THE VALUE AFTER THE % SIGN IS THE DIVISOR (i.e. %6 means 6/12/18/24/30) MOD=$((DOM%7)) PWD=`pwd` clear echo "Output is sent to: $LOGFILE" echo "To view output, run:" echo "tail -f $LOGFILE" if [ $NOTIFICATION == 1 ] then   exec > $LOGFILE 2>&1   date fi # DETERMINE IF A PREVIOUS REPOSYNC IS STILL RUNNING lockfile -r 0 ${LOCKFILE} 1>/...