To give the new sudo options and to give new sudo rules

To give the new sudo options and to give new sudo rules

User_Alias JBOSS_USER=ksivaprag
Cmnd_Alias JBOSS_CMD=/bin/su – jboss , /bin/su jboss
JBOSS_USER ALL=JBOSS_CMD
JBOSS_USER ALL=NOPASSWD: JBOSS_CMD
[root@matcvauaa81-vm ~]#

Example ;
User_Alias APACHE_USER=webadm
Cmnd_Alias APACHE_CMD= \
/opt/software/apache-vehicleservice/bin/apachectl – k stop, \
/opt/software/apache-vehicleservice/bin/apachectl – k start, \
/opt/software/apache-vehicleservice/bin/apachectl s tatus

APACHE_USER ALL=APACHE_CMD

Advertisements

Disable Ctrl+Alt+Delete option on linux box .

To disable this behavior, open the /etc/init/control-alt-delete.conf configuration file .
————————————————REDHAT 5x :—————————
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
comment the above line and run command to make change effect and run init q
————————————————REDHAT 6.0 TO 6.2:—————————
start on control-alt-delete
#exec /sbin/shutdown -r now “Control-Alt-Delete pressed”
exec echo “Ctrl-Alt-delete keys pressed”
The init daemon should automagically reload this change, but just to be sure run this command:
initctl reload-configuration
————————————————REDHAT 6.3 AND ABOVE———————
cp -p /etc/init/control-alt-delete.conf /etc/init/control-alt-delete.override
vi /etc/init/control-alt-delete.override
start on control-alt-delete
#exec /sbin/shutdown -r now “Control-Alt-Delete pressed”
exec /bin/true
initctl reload-configuration
—————————————————————————————————-

SanityChecks

SANITY CHECK

#df -hT
#free -m
#uname -a
#netstat -ntulp
#netstat -rn
#cat /etc/redhat-release
#ifconfig -a
#fdisk -l
#pvs,vgs,lvs
#uptime;date
#cat /etc/fstab

PERFORMANCE TUNING

–> Performance depends on CPU,MEMORY,DISK,Network

CPU:
-Context switching
-RunQueue(Active process queue)
-Load average()
-Utilization
commands: sar,top,vmstat

I/O:
-iostat

Memory:
-#free -m

Network:

#tcpdump -c eth0
#ethtool eth0
#ifconfig -a

KDUMP Configuration

create /var/crash FS equal to memory

add line /etc/kdump.conf

core_collector makedumpfile -d 17 -c
add below /etc/grub.conf

crashkernel=256M

kernel /vmlinuz-2.6.32-431.20.3.el6.x86_64 ro root=/dev/mapper/rootvg-rootlv rd_NO_LUKS rd_LVM_LV=rootvg/rootlv LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=rootvg/swaplv SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=256M rhgb quiet rd_NO_DM rhgb quiet
initrd /initramfs-2.6.32-431.20.3.el6.x86_64.img

make sure

# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0

chkconfig kdump on

service kdump start

1.We need to add the 30GB new disk and mount it with /kdump
2.check for the memory of 512 MB
3.Need to configure the Kdump under /etc/kdump.conf
4.I seen path is /var/crash we have to change it to /kdump
5.Under /etc/grub.conf
crashkernel=128M@16M
6.Service kdump enable
7.service kdump restart
8.chkconfig kdump on
9.restart the server

Removing openfiles or deleted files

Login to server and type below command to list files

find /proc/*/fd -ls | grep ‘(deleted)’

Once listed the files go to deleted file directory and ls
Nullify the number 1 or any number.

237899032 0 l-wx—— 1 hybris hybris 64 Jan 19 14:58 /proc/7631/fd/1 -> /home/hybris/CopyLogs_NAS/Copy_NAS.log\ (deleted)
237899033 0 l-wx—— 1 hybris hybris 64 Jan 19 14:58 /proc/7631/fd/2 -> /home/hybris/CopyLogs_NAS/Copy_NAS.log\ (deleted)
237915736 0 lr-x—— 1 root root 64 Jan 19 15:06 /proc/877/fd/21 -> /run/log/journal/99033ba25b6549aeb30847609efb5288/system@d381531d7bdc486c8794e01a6f8da91d-0000000001f8e06f-00056295b98c1a14.journal\ (deleted)
[root@carc-vhybt02 ~]# cd /proc/7631/fd/
[root@carc-vhybt02 fd]# > 1
[root@carc-vhybt02 fd]# df -h /home
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_root-lv_home 30G 1.2G 29G 4% /home

Yum update error unauthorized trying another mirror

Error ( please find the resolution in the totally below or bottoon of the page )
====================================================================================
[root@carc-vjavas01 yum.repos.d]# yum repolist
Loaded plugins: product-id, rhui-lb, search-disabled-repos, subscription-manager
Repository ‘rhui-rhel-7-server-rhui-rh-common-rpms’: Error parsing config: Error parsing “gpgcheck = ‘i'”: invalid boolean value
rhel-7-server-rpms | 3.5 kB 00:00:00
rhel-server-rhscl-7-rpms | 3.5 kB 00:00:00
https://cdc-inf-rhcds01.cdc-dc1-core.cscehub.com/pulp/repos///content/dist/rhel/rhui/server/7/7Server/x86_64/optional/os/repodata/repomd.xml: [Errno 14] HTTPS Error 401 – Unauthorized
Trying other mirror.
https://cdc-inf-rhcds02.cdc-dc1-core.cscehub.com/pulp/repos///content/dist/rhel/rhui/server/7/7Server/x86_64/optional/os/repodata/repomd.xml: [Errno 14] HTTPS Error 401 – Unauthorized
Trying other mirror.
https://cdc-inf-rhcds01.cdc-dc1-core.cscehub.com/pulp/repos///content/dist/rhel/rhui/server/7/7Server/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 401 – Unauthorized
Trying other mirror.
https://cdc-inf-rhcds02.cdc-dc1-core.cscehub.com/pulp/repos///content/dist/rhel/rhui/server/7/7Server/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 401 – Unauthorized
Trying other mirror.
rhel-7-server-rpms/7Server/x86_64/primary_db | 46 MB 00:00:03
rhel-server-rhscl-7-rpms/7Server/x86_64/primary_db | 4.8 MB 00:00:01
https://cdc-inf-rhcds01.cdc-dc1-core.cscehub.com/pulp/repos///content/dist/rhel/rhui/server/7/7Server/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 401 – Unauthorized
Trying other mirror.
https://cdc-inf-rhcds02.cdc-dc1-core.cscehub.com/pulp/repos///content/dist/rhel/rhui/server/7/7Server/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 401 – Unauthorized
Trying other mirror.
repo id repo name status
rhel-7-server-rpms/7Server/x86_64 Red Hat Enterprise Linux 7 Server (RPMs) 17,906
rhel-server-rhscl-7-rpms/7Server/x86_64 Red Hat Software Collections RPMs for Red Hat Enterprise Linux 7 Server 9,319
rhui-rhel-7-server-rhui-rpms/7Server/x86_64 Red Hat Enterprise Linux 7 Server from RHUI (RPMs) 0
repolist: 27,225

============================

Resolution
================
===================

1. subscription-manager list –consumed

2. go to cd /etc/yum.repos.d –> cat rh-cloud.repo

[root@carc-vjavas01 yum.repos.d]# cat rh-cloud.repo
[rhui-rhel-7-server-rhui-optional-rpms]
name=Red Hat Enterprise Linux 7 Server – Optional from RHUI (RPMs)
mirrorlist=https://cdc-inf-rhcds02.cdc-dc1-core.cscehub.com/pulp/mirror//content/dist/rhel/rhui/server/7/$releasever/$basearch/optional/os
enabled=0 <<=============================== altered this from 1 to 0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
sslverify=1
sslcacert=/etc/pki/rhui/ca.crt
sslclientcert=/etc/pki/rhui/product/content.crt
sslclientkey=/etc/pki/rhui/key.pem
skip_if_unavailable = 1
keepcache = 0

[rhui-rhel-7-server-rhui-rh-common-rpms]
name=Red Hat Enterprise Linux 7 Server – RH Common from RHUI (RPMs)
mirrorlist=https://cdc-inf-rhcds02.cdc-dc1-core.cscehub.com/pulp/mirror//content/dist/rhel/rhui/server/7/$releasever/$basearch/rh-common/os
enabled=0 <<=============================== altered this from 1 to 0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
sslverify=1
sslcacert=/etc/pki/rhui/ca.crt
sslclientcert=/etc/pki/rhui/product/content.crt
sslclientkey=/etc/pki/rhui/key.pem

[rhui-rhel-7-server-rhui-rpms]
name=Red Hat Enterprise Linux 7 Server from RHUI (RPMs)
mirrorlist=https://cdc-inf-rhcds02.cdc-dc1-core.cscehub.com/pulp/mirror//content/dist/rhel/rhui/server/7/$releasever/$basearch/os
enabled=0 <<=============================== altered this from 1 to 0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
sslverify=1
sslcacert=/etc/pki/rhui/ca.crt
sslclientcert=/etc/pki/rhui/product/content.crt
sslclientkey=/etc/pki/rhui/key.pem

[root@carc-vjavas01 yum.repos.d]#

3.[root@carc-vjavas01 pluginconf.d]# cat rhui-lb.conf
[main]

enabled=0 <<=============================== altered this from "1" to "0"
cds_list_file=/etc/yum.repos.d/rhui-load-balancers
[root@carc-vjavas01 pluginconf.d]#

4.[root@carc-vjavas01 ~]# cd /etc/yum/pluginconf.d/
[root@carc-vjavas01 pluginconf.d]#
[root@carc-vjavas01 pluginconf.d]# cat search-disabled-repos.conf
[main]
enabled=1

# With notify_only=1 this plugin does not modify yum's behaviour.
# Setting notify_only to 0 will enable yum to try to automatically resolve
# dependency errors by temporarily enabling disabled repos and searching
# for missing dependencies. If that helps resolve dependencies, yum will
# suggest to permanently enable the repositories that have helped find
# missing dependencies.
# IMPORTANT: running yum with –assumeyes (or assumeyes config option)
# will make yum automatically and without prompting the user temporarily
# enable all repositories, and if it helps resolve dependencies yum will
# permanently enable the repos that helped without prompting the user.
notify_only=0 <<=============================== altered this from " 1" to" 0 "

# Repositories matching the patterns listed in ignored_repos will not be enabled by the plugin
ignored_repos=*debug-rpms *source-rpms *beta-rpms
[root@carc-vjavas01 pluginconf.d]#

Once done with above steps
5.yum update -y
6.yum update -y –skip-broken

Files edited from the above
=============================
cd /etc/yum.repos.d/rh-cloud.repo
cd /etc/yum/pluginconf.d/rhui-lb.conf
cd /etc/yum/pluginconf.d/search-disabled-repos.conf