Bitbull Tech Notes - home of free minds ...

HowTo do tricky downgrade with yum (example)

This is tricky, because the version of Samba I need ist no longer available on the Repos.

Remove the software you want to downgrade:

rpm -qa | grep samba | xargs rpm -e --nodeps
rpm -e --nodeps libsmbclient libwbclient

Manually install the needed Version:

[root@backup x86_64]# ls -1
libsmbclient-4.1.1-10031.el7.centos.x86_64.rpm
libwbclient-4.1.1-10031.el7.centos.x86_64.rpm
samba-4.1.1-10031.el7.centos.x86_64.rpm
samba-client-4.1.1-10031.el7.centos.x86_64.rpm
samba-common-4.1.1-10031.el7.centos.x86_64.rpm
samba-dc-4.1.1-10031.el7.centos.x86_64.rpm
samba-dc-libs-4.1.1-10031.el7.centos.x86_64.rpm
samba-libs-4.1.1-10031.el7.centos.x86_64.rpm
samba-pidl-4.1.1-10031.el7.centos.x86_64.rpm
samba-python-4.1.1-10031.el7.centos.x86_64.rpm
samba-test-4.1.1-10031.el7.centos.x86_64.rpm
samba-vfs-glusterfs-4.1.1-10031.el7.centos.x86_64.rpm
samba-winbind-4.1.1-10031.el7.centos.x86_64.rpm
samba-winbind-clients-4.1.1-10031.el7.centos.x86_64.rpm
samba-winbind-krb5-locator-4.1.1-10031.el7.centos.x86_64.rpm
samba-winbind-modules-4.1.1-10031.el7.centos.x86_64.rpm

yum install *.rpm

Check if all deps are solved:

yum check

Pin the needed package versions:

yum -y install yum-versionlock
yum versionlock add samba\* BackupPC

 

Exclude the Versions from beeing upgraded:

vi /etc/yum.conf
------
[main]
...
exclude=*samba* libsmb* libwbclient* BackupPC
------

 

Check if yum is doing as expected:

yum makecache
yum upgrade

 

 

 

 

 

 

Enable Kdump in CentOS7

Just a small hint :-)

yum install kexec-tools

grep crashkernel= /etc/default/grub
   GRUB_CMDLINE_LINUX="vconsole.font=latarcyrheb-sun16 vconsole.keymap=sg crashkernel=auto console=tty0 console=ttyS0,115200"

grub2-mkconfig -o /boot/grub2/grub.cfg

reboot

systemctl enable kdump.service

systemctl start kdump.service

systemctl status kdump

grep ^path /etc/kdump.conf

   path /var/crash

 

done!

ntpd on CentOS 7 is starting before networking on reboot

Strange Issue, but it is true!

Here is my way how to fix:

# first check systemd service and only fix if present
if [ -f /usr/lib/systemd/system/ntpd.service ] ; then
   cat /usr/lib/systemd/system/ntpd.service > /etc/systemd/system/ntpd.service
   grep -q 'After=.*network.target' /etc/systemd/system/ntpd.service
   if [ $? -ne 0 ] ; then
      sed -i '/After=/ s/$/ network.target/g' /etc/systemd/system/ntpd.service
   fi
fi   

systemctl daemon-reload

CentOS 7 set MTU on bonding and VLAN interfaces

YES IT IS A BUG ON CENTOS7!
mtu on bonding interface is ignored by default ... to sad!!!

What we can do to get around:

eth0 + eth1 (NIC) > SAN1 (BOND) > NFS (VLAN.99) and MTU=9000

# egrep "MTU=|ONBOOT=|NM_CONTROLLED=" /etc/sysconfig/network-scripts/ifcfg-*
[...]
/etc/sysconfig/network-scripts/ifcfg-NFS:ONBOOT=yes
/etc/sysconfig/network-scripts/ifcfg-NFS:MTU=9000
/etc/sysconfig/network-scripts/ifcfg-SAN1:ONBOOT=yes
/etc/sysconfig/network-scripts/ifcfg-SAN1:MTU=9000
/etc/sysconfig/network-scripts/ifcfg-SAN1.1:ONBOOT=yes
/etc/sysconfig/network-scripts/ifcfg-SAN1.1:MTU=9000
/etc/sysconfig/network-scripts/ifcfg-SAN1.2:ONBOOT=yes
/etc/sysconfig/network-scripts/ifcfg-SAN1.2:MTU=9000
/etc/sysconfig/network-scripts/ifcfg-VM1:ONBOOT=yes
/etc/sysconfig/network-scripts/ifcfg-VM1.1:ONBOOT=yes
/etc/sysconfig/network-scripts/ifcfg-VM1.2:ONBOOT=yes

Configured with nmtui

  • /etc/NetworkManager/dispatcher.d/bond-mtu.sh
#!/bin/sh  

INTERFACE_NAME_REGEX="^bond?|SAN1|NFS"

/usr/bin/logger -t `basename $0` "starting"

if [[ $CONNECTION_ID =~ $INTERFACE_NAME_REGEX ]]; then
   if [[ $2 == up ]]; then
      MTU=$(awk -F "=" '($1 ~ "^MTU") {print $NF}' /etc/sysconfig/network-scripts/ifcfg-$CONNECTION_ID)
      if [[ $MTU > 0 ]] && [[ $MTU != 1500 ]]; then
         /usr/bin/logger -t `basename $0` -s "Setting MTU of $CONNECTION_ID to $MTU..."
         if /usr/sbin/ip link set dev $1 mtu $MTU ; then
            /usr/bin/logger -t `basename $0` "Successfully set MTU of $CONNECTION_ID to $MTU"
         else
            /usr/bin/logger -t `basename $0` "Failed to set MTU of $CONNECTION_ID to $MTU"
         fi
      fi
   fi
fi
chmod 755 /etc/NetworkManager/dispatcher.d/bond-mtu.sh
systemctl enable NetworkManager-dispatcher.service
systemctl start NetworkManager-dispatcher.service
reboot
ip a

 

Home