EzDevInfo.com

centos-6 interview questions

Top centos-6 frequently asked interview questions

Linux cal command not showing proper output

If you type cal 9 1752 in a Linux terminal you will get strange output. For example:

[max@avi ~]$ cal 9 1752

   September 1752  

Su Mo Tu We Th Fr Sa

       1  2 14 15 16

17 18 19 20 21 22 23

24 25 26 27 28 29 30

Did you notice the date from 3 to 13 is missing? Why is this so? I am using CentOS 6.2.


Source: (StackOverflow)

Installed minimal CentOS 6.4 in VirtualBox but have no internet?

I just started using the VirtualBox, but I don't seem to have any internet on the CentOS when I type yum update. Is there a solution to my problem? (it could possibly be a problem with misconfigured VirtualBox)

Here is an output of ifconfig.

Image


Source: (StackOverflow)

Advertisements

How to Boot CentOS in CLI?

I have a CentOS 6.2 OS which boots into GUI. How, upon startup, can I not boot into the GUI and instead, boot into the CLI? I want to do this at computer startup time.


Source: (StackOverflow)

How to deduplicate 40TB of data?

I've inherited a research cluster with ~40TB of data across three filesystems. The data stretches back almost 15 years, and there are most likely a good amount of duplicates as researchers copy each others data for different reasons and then just hang on to the copies.

I know about de-duping tools like fdupes and rmlint. I'm trying to find one that will work on such a large dataset. I don't care if it takes weeks (or maybe even months) to crawl all the data - I'll probably throttle it anyway to go easy on the filesystems. But I need to find a tool that's either somehow super efficient with RAM, or can store all the intermediary data it needs in files rather than RAM. I'm assuming that my RAM (64GB) will be exhausted if I crawl through all this data as one set.

I'm experimenting with fdupes now on a 900GB tree. It's 25% of the way through and RAM usage has been slowly creeping up the whole time, now it's at 700MB.

Or, is there a way to direct a process to use disk-mapped RAM so there's much more available and it doesn't use system RAM?

I'm running CentOS 6.


Source: (StackOverflow)

How do I execute/run a .sql file in PostgreSQL 9.2.6 + CentOs

I would like to know how to execute a .sql file in PostgreSQL. I'm using CentOs 6.4.

I have created a database and just need to run a script given to me to create tables.

Thanking you in advance.


Source: (StackOverflow)

What is PAM (Pluggable Authentication Modules) in Linux?

What is PAM (Pluggable Authentication Modules) in Linux? I know it is used for authentication, but what good is this? How does it work?

I am using CentOS 6.2.


Source: (StackOverflow)

How can I configure gdm to allow X connections to other servers/workstations?

I have an issue on all new installs of CentOS 6.2 on my network. Connecting to remote machines using X11 gui software fails for reasons associated with the xauth. I'm not sure how to diagnose but have narrowed it down to the following:

  • gdm can't properly authenticate with remote host
  • XAUTHORITY is set to a local path not available on the remote machine
  • there is no .Xauthority file in the local user home dir
  • missing MIT-MAGIC-COOKIE-1

Here are some logs:

/var/log/Xorg.0.log

[  9273.858] AUDIT: Mon Jun  4 14:41:21 2012: 7778: client 20 connected from local host (
uid=0 gid=0 pid=8800 )
  Auth name: MIT-MAGIC-COOKIE-1 ID: 496
[  9273.870] AUDIT: Mon Jun  4 14:41:21 2012: 7778: client 35 connected from local host (
uid=0 gid=0 pid=8800 )
  Auth name: MIT-MAGIC-COOKIE-1 ID: 496
[  9274.072] AUDIT: Mon Jun  4 14:41:21 2012: 7778: client 20 disconnected
[  9274.072] AUDIT: Mon Jun  4 14:41:21 2012: 7778: client 35 disconnected
[  9277.236] AUDIT: Mon Jun  4 14:41:25 2012: 7778: client 20 connected from local host (
uid=0 gid=0 pid=8804 )
  Auth name: MIT-MAGIC-COOKIE-1 ID: 496
[  9277.248] AUDIT: Mon Jun  4 14:41:25 2012: 7778: client 35 connected from local host (
uid=0 gid=0 pid=8804 )
  Auth name: MIT-MAGIC-COOKIE-1 ID: 496
[  9277.277] AUDIT: Mon Jun  4 14:41:25 2012: 7778: client 20 disconnected
[  9277.277] AUDIT: Mon Jun  4 14:41:25 2012: 7778: client 35 disconnected

/var/log/messages

Jun  4 14:41:21 myhostname abrt[8801]: saved core dump of pid 8800 (/usr/bin/perl) to /var/spo
ol/abrt/ccpp-2012-06-04-14:41:21-8800.new/coredump (18776064 bytes)
Jun  4 14:41:21 myhostname abrtd: Directory 'ccpp-2012-06-04-14:41:21-8800' creation detected
Jun  4 14:41:21 myhostname abrtd: Package 'clusterssh' isn't signed with proper key
Jun  4 14:41:21 myhostname abrtd: Corrupted or bad dump /var/spool/abrt/ccpp-2012-06-04-14:41:21-8800 (res:2), deleting

I'm sure this is an easy thing to address.

Things I tried that were unsuccessful:

  • sadly gdmsetup is not part of EL6
  • configured /etc/gdm/PostLogin to copy $XAUTHORITY to $HOME/.Xauthority (NFS mounted home directories)
  • explicitly created /etc/sysconfig/desktop with DISPLAYMANAGER=GNOME & DESKTOP=GNOME
  • tried different combinations of xinit and xauth

Hopefully someone can help diagnose and solve this problem. As visible in the logs, I'm without clusterssh as a result which is an unfortunate thing given I use it daily.


Source: (StackOverflow)

How can I manually control a fan from the terminal?

I'm trying to control the fan speed on my desktop, and I'd appreciate your help.

Goal: Use a script to control the fan speed on my computer.

Motivation: The embedded BIOS "Smart Fan" settings isn't smart enough to speed up the fan when the system gets hot, resulting in a crash when the one of the temps passes the threshold.

Configuration:

  • Centos 6.3
  • Acer Veriton VN281G-UA425L
  • abbreviated lspci output

    00:00.0 Host bridge: Intel Corporation N10 Family DMI Bridge
    00:1c.0 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 1 (rev 02)
    00:1c.2 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 3 (rev 02)
    00:1c.3 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 4 (rev 02)
    00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)
    00:1f.0 ISA bridge: Intel Corporation NM10 Family LPC Controller (rev 02)
    00:1f.2 IDE interface: Intel Corporation N10/ICH7 Family SATA Controller [IDE mode] (rev 02)
    00:1f.3 SMBus: Intel Corporation N10/ICH 7 Family SMBus Controller (rev 02)
    
  • abbreviated /proc/cpuinfo

    processor   : 0
    vendor_id   : GenuineIntel
    cpu family  : 6
    model       : 28
    model name  : Intel(R) Atom(TM) CPU D425   @ 1.80GHz
    
  • Grub configuration

    title CentOS (2.6.32-279.5.1.el6.x86_64)
            root (hd0,0)
            kernel /vmlinuz-2.6.32-279.5.1.el6.x86_64 ro root=/dev/mapper/vg_hadean-lv_root rd_NO_LUKS rd_LVM_LV=vg_hadean/lv_root LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=vg_hadean/lv_swap  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
            initrd /initramfs-2.6.32-279.5.1.el6.x86_64.img
    

Previous attempts:

  • Run lm_sensors lm_sensors could only find the temperature output
  • Run yum search fan no matches
  • add acpi and acpi=strict to kernel opts nothing happened
  • check /proc/acpi/fan the directory is empty

I ran acer_ec.pl regs and the output was this:

        00  01  02  03  04  05  06  07  |   08  09  0A  0B  0C  0D  0E  0F
        __  __  __  __  __  __  __  __  |   __  __  __  __  __  __  __  __
00 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
10 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
20 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
30 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
40 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
50 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
60 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
70 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
80 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
90 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
A0 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
B0 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
C0 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
D0 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
E0 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 255 255 
F0 |    255 255 255 255 255 255 255 255 |   255 255 255 255 255 255 

I don't know if that's what it's supposed to look like, but something seems amiss here.


I found a link that inspired me to try pwmconfig. The output was: There are no pwm-capable sensor modules installed I'm going to try to find out how I can install those modules.


I reset the "Smart Fan" setting and it isn't causing me any more problems, for now. I don't know how that could affect it, but we'll see what happens when I start putting a load back on the system.

I still haven't found the right patches for the kernel (or if that's even the problem). If the problem continues, I'll try to update the kernel to include the acpi support. Using the hardware tool from an arch linux iso, I found out that I'm using the P01-A3L BIOS, release 4/6/2011, revision 8.16 on an Acer Veriton N281G motherboard.

If that doesn't work, I might just scrap it and move to Debian or Arch.


Source: (StackOverflow)

CentOS 6.5 - bash: service: command not found

So I can't type service on my CentOS 6.5 server. I'm logged in as root. When typing service I get this error:

bash: service: command not found

I have also tried to type sudo service, but with no luck. And then I get this error:

sudo: service: command not found


Source: (StackOverflow)

Why Centos still not using Latest kernel

As i have seen many changes and improvement in kernel 3.xx

The improvement i like is dmcache which introduced in kernel 3.9

I have 3 server with centos installed on all machine

Centos is still using old kernel which is 2.6.xx

I'm wondering why they are not upgrading kernel?

Resources


Source: (StackOverflow)

Why is pip not listed in easy_install on CentOS 6? Where to get it?

I am trying to install pip for python on CentOS 6. I thought of installing it through easy_install but it is not there. I tried to find easy_install with find command, but no luck. I tried to re-install python with yum and still not able to find easy_install.


Source: (StackOverflow)

Upgrading PHP 5.3.3 to 5.4.4 in CentOS 6.4

I'm using CentOS 6.4 (centos-release-6-4.el6.centos.10.x86_64). I'm trying to upgrade the php version from 5.3.3 to 5.4.4 by using:

yum upgrade php-mysql php-devel php-gd php-pecl-memcache php-pspell php-snmp php-xmlrpc php-xml

and

yum upgrade php

...but this is the only message i'm getting:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.netnitco.net
 * extras: mirror.wiredtree.com
 * updates: mirror.thelinuxfix.com
Setting up Update Process
No Packages marked for Update

I already ran:

yum update

and everything is in order. I also checked for exclusions of php-* in /etc/yum.conf but nothing was found. Any ideas? Thanks!

Update: solution

Thanks to @mirkobrankovic I ended doing this (on a 64-bit OS):

wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm
yum --enablerepo=remi upgrade php-mysql php-devel php-gd php-pecl-memcache php-pspell php-snmp php-xmlrpc php-xml

Source: (StackOverflow)

How to multiseat with HW 3d accel on CentOS 6.3 Final?

I would like to setup a multiseat configuration on CentOS 6.3 (two video cards, two keyboards, two mice, two monitors) and have hardware accelerated 3D on both monitors. 3D HW acceleration rules out Xephyr. I saw somewhere that recent versions of GDM (3.3 and newer?) don't support multiseat, so do I have to install KDM to make this work? If I just create a duplicate section with new device identifiers in my xorg.conf file, will this 'just work'? Using different ports on the same video card and separate keyboards, mice, and displays, the result was a desktop which spanned both monitors with both keyboards and mice acting as the same input in the GUI. I will power down and put in the new video card and report on the results soon. Both video cards are nvidia.

UPDATE

after putting in another NVIDIA video card, default behavior (before changing xorg.conf) is that one screen works normally, and both mice and keyboards are connected to it. Changing xorg.conf and the display manager to KDM and following the directions here https://help.ubuntu.com/community/MultiseatX#Ubuntu_10.04_.28Lucid.29 , I have 2 mirrored screens connected to separate video cards, DRI enabled, and 2 mice both connected to the same pointer. Keyboards don't do anything, however, I probably just need to fix a setting in xorg.conf

I would still like to get multiseat functionality, eg. separate screens with separate input devices I have verified that the separate X processes are running (see page above) using 'ps aux | grepX [01]'


Source: (StackOverflow)

Why don't my certificates match?

I'm configuring a VPN with OpenVPN without interfaz, the problem is when I try to connect, it says:

TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)

But I know that is not the problem cause I've tried it even with the firewalls disabled... so, trying to figure it out, I ran:

openssl verify -purpose any -CAfile ca.crt client1.crt

In the server and also in the client, the weird thing is in the server everything's fine, but in the client it says:

error 20 at 0 depth lookup:unable to get local issuer certificate

I've tried with many certificates, and copying them in different ways... I am sure the crt's are the same, and also I've tried it with the complete route and so on...

Could somebody give me a hand with this??

The server is Ubuntu 12.04 and the client is CentOS 6

If any other information is required, please tell me!


Source: (StackOverflow)

Can't ping ip's or hostnames on fresh CentOS 6.2 install

I just installed CentOS 6.2 on a box using ipmi and have tried setting up the network with no luck.

I've got a 66.x.x.56/29 allocation of ip addresses on vlan (66.x.x.56 to 66.x.x.63), so I have set up 5 ips on one of the nics. 66.x.x.57 is the gateway.

My problem is I can ping any of the 5 ip's on eth1 and get a response, but I cannot ping the gateway or any other ip/hostname. Basically, no outside connections..

/etc/resolv.conf:

nameserver 8.8.8.8
nameserver 8.8.4.4

/etc/sysconfig/network

NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=hostname.mydomain.com
GATEWAY=66.x.x.57

/etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE="eth1"
BOOTPROTO=none
IPADDR=66.x.x.58
NETMASK=255.255.255.248
ONBOOT=yes

/etc/sysconfig/network-scripts/ifcfg-eth1:1

DEVICE="eth1:1"
BOOTPROTO=none
IPADDR=66.x.x.59
NETMASK=255.255.255.248
ONBOOT=yes

/etc/sysconfig/network-scripts/ifcfg-eth1:2

DEVICE="eth1:2"
BOOTPROTO=none
IPADDR=66.x.x.60
NETMASK=255.255.255.248
ONBOOT=yes

/etc/sysconfig/network-scripts/ifcfg-eth1:3

DEVICE="eth1:3"
BOOTPROTO=none
IPADDR=66.x.x.61
NETMASK=255.255.255.248
ONBOOT=yes

/etc/sysconfig/network-scripts/ifcfg-eth1:4

DEVICE="eth1:4"
BOOTPROTO=none
IPADDR=66.x.x.62
NETMASK=255.255.255.248
ONBOOT=yes

route -n

Dest           Gateway       Genmask            Flags   Metric   Ref  Use   Iface
66.x.x.56      0.0.0.0       255.255.255.248    U       0        0    0     eth1
169.254.0.0    0.0.0.0       255.255.0.0        U       1003     0    0     eth1
0.0.0.0        66.x.x.57     0.0.0.0            UG      0        0    0     eth1

Please let me know if I left anything out.I included anything that I thought was necessary! Any help is greatly appreciated!


Source: (StackOverflow)