Linux OS

Fix for ping socket operation not permitted

Just a little while ago I checked my kuma status page and noted that several checks were failing. In troubleshooting, I found that at least the ping command had a problem.

ping www.google.com
ping: socket: Operation not permitted

Needless to say, this became rather annoying and off to google I went. I quickly found these two pages that described the problem and a fix for it.  While I don’t understand yet how the problem started on my system, I am glad I found a fix.

Continue reading…

SELinux – From Disabled to Enforcing and fixing the headache with it

I ran into an issue re-enabling SELinux on my little fleet of CentOS 7 boxes in my home lab.  Basically when I installed them I had disabled SELinux at install and thus enabling SELinux was causing all the systems to freeze up after a reboot.

A little googling/digging around mailing lists.  I stumbled upon a post that gave a perfect answer to fix the problem I was having.

# setenforce 0
# yum remove selinux-policy\*
# rm -rf /etc/selinux/targeted /etc/selinux/config
# yum install selinux-policy-targeted
# yum install selinux-policy-devel policycoreutils-gui  *** Only if these were removed byt the yum remove.
# touch /.autorelabel; reboot

Basically temporary disable SELinux, remove selinux-policy*, remove the old targeted dir and config file, and re-install selinux.  Followed by the usualy autorelabel and reboot.

The only thing I would add would be to check your network and ifup the interface after setenforce 0.

Reset lost iDRAC pass from OMSA

I was recently playing around with EM7 and various Dynamic Apps around Dell hardware.  I came to find that my remote server (hosting this site) had storage in a ‘nonCritical’ state.  I promptly tried logging into my idrac for the system and was having issues getting in.  I had forgot what I had set for the password on the root and personal accounts.  (For those that leave it root/calvin, shame on you!)  This set off a “fear” if you will of having to shut down several VMs and get the datacenter hosting it to attach a remote KVM so I could change the drac password.  I hate this thought.  I spent 30 seconds here and there trying every password I could think of but nothing worked.  I finally started googling around to see if there was any other method.  I struck a winner.

So first thing is you will need Dell Open manage installed on the host system.  From what I can tell this wont work otherwise.  I wrote up a short on installing Dell OpenManage on an Ubuntu 16.04 system previously.

I quickly found that racadm is not properly setup for x64 systems.

root@hostsystem:~# racadm getconfig -g cfgUserAdmin -i 2
/opt/dell/srvadmin/sbin/racadm: line 3: /opt/dell/srvadmin/lib/srvadmin-omilcore/Funcs.sh: No such file or directory
/opt/dell/srvadmin/sbin/racadm: line 5: GetRegVal: command not found
/opt/dell/srvadmin/sbin/racadm: line 6: GetRegVal: command not found
/opt/dell/srvadmin/sbin/racadm: line 8: GetSysId: command not found
/opt/dell/srvadmin/sbin/racadm: line 9: GetRegVal: command not found
/opt/dell/srvadmin/sbin/racadm: line 10: GetRegVal: command not found
/opt/dell/srvadmin/sbin/racadm: line 13: printf: 0x: invalid hex number
ERROR: Unable to communicate with RAC controller. Please make sure that a RAC
controller is present in the server and appropriate software is installed.

Thankfully it looks like it was just missing a couple of things in the lib folder that are in lib64.

cd /opt/dell/srvadmin/lib
ln -s ../lib64/srvadmin-deng/
ln -s ../lib64/srvadmin-idrac/
ln -s ../lib64/srvadmin-isvc/
ln -s ../lib64/srvadmin-omacore/
ln -s ../lib64/srvadmin-omilcore/
ln -s ../lib64/srvadmin-storage/

After that, racadm appears to work on the hostsystem.

After all that, it appears that racadm works locally without needing a user/pass to do anything.  This will help later when I will be working on pushing out LetsEncrypt certs into the iDRACs automatically.  So I ran the following as mentioned on the dell forum post to reset the root password to ‘ThisIsNewPass’.  If you want to change other users, change the 2 to what ever number they are in the user list.

racadm set idrac.users.2.password ThisIsNewPass
root@hostsystem:~# racadm set idrac.users.3.password ThisIsNewPass
[Key=idrac.Embedded.1#Users.3]
Object value modified successfully

root@hostsystem:~#

Install Dell OpenManage on Ubuntu 16.04 (and up?)

So with this new server I am setting up I wanted to install the Dell OpenManage software but got a headache from doing so. Just about everything I was finding was pointing me to CentOS based info and I am using an Ubuntu based system. Hence my headache. After hours of googling I finally found the page I did and it helped me get Dell OpenManage installed. Of course I had to mangle their instructions some but it was not to bad. Below is what I used and a link to the page that was helpful.

sudo echo 'deb http://linux.dell.com/repo/community/ubuntu trusty openmanage' | sudo tee -a /etc/apt/sources.list.d/linux.dell.com.sources.list
gpg --keyserver hkp://pool.sks-keyservers.net:80 --recv-key 1285491434D8786F ; gpg -a --export 1285491434D8786F | sudo apt-key add -
sudo apt-get update
sudo apt install srvadmin-base srvadmin-storageservices srvadmin-idrac7
# sudo apt install srvadmin-webserver
# sudo service dsm_om_connsvc start && sudo update-rc.d dsm_om_connsvc defaults

Continue reading…

Reducing swap partition on lvm on ubuntu server

So the server I have hosted at Dacentec is starting to show its age and limitations.  Luckily I can get my hands on some decent hardware thanks to ebay and other methods.  So the past few days when time allows I have been working on building a replacement 1u server to what I currently have.  In doing so I am taking the RAM from 16GB to 196GB. With that said the system is installed with a stock ubuntu 17.10 server using guided lvm partitioning.  Which thinks like days of old where total ram equals the swap size needed.

Avoiding the whole debate of how much swap would be ideal. I am just going to scale it back to about 16GB.  Thus freeing up about 80% of the OS RAID 1 drives.

As always google and a stackoverflow/askubuntu (Ref links below) along with some good old fashion thinking.

root@atlas:~# lvs
  LV     VG       Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root   atlas-vg -wi-ao----  86.88g                                                    
  swap_1 atlas-vg -wi-ao---- 191.95g                                                    

root@atlas:~# swapoff /dev/atlas-vg/swap_1

root@atlas:~# lvreduce --size 16G /dev/atlas-vg/swap_1
  WARNING: Reducing active logical volume to 16.00 GiB.
  THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce atlas-vg/swap_1? [y/n]: y
  Size of logical volume atlas-vg/swap_1 changed from 191.95 GiB (49140 extents) to 16.00 GiB (4096 extents).
  Logical volume atlas-vg/swap_1 successfully resized.

root@atlas:~# mkswap /dev/atlas-vg/swap_1
mkswap: /dev/atlas-vg/swap_1: warning: wiping old swap signature.
Setting up swapspace version 1, size = 16 GiB (17179865088 bytes)
no label, UUID=f0260f73-bf13-41d4-af79-3203114b3f9d

root@atlas:~# swapon /dev/atlas-vg/swap_1

root@atlas:~# lvs
  LV     VG       Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root   atlas-vg -wi-ao---- 86.88g                                                    
  swap_1 atlas-vg -wi-ao---- 16.00g