Friday 19 June 2015

When a process shows uid number instead of user name

When a process appears with the uid number instead of the username, it is because the username is more than 8 characters long:
[root@ pe-activemq]# ps -ef|grep active
497       2578     1  0 12:44 ?        00:00:27 /opt/puppet/lib/jvm/pe-java/jre/bin/java -Xms512m -Xmx512m -Djava.util.logging.config.file=logging.properties -Dhawtio.realm=activemq -Dhawtio.role=admins -Dhawtio.rolePrincipalClasses=org.apache.activemq.jaas.GroupPrincipal -Djava.security.auth.login.config=/etc/puppetlabs/activemq/login.config -Dcom.sun.management.jmxremote -Djava.awt.headless=true -Djava.io.tmpdir=/opt/puppet/share/activemq/tmp -Dactivemq.classpath=/etc/puppetlabs/activemq; -Dactivemq.home=/opt/puppet/share/activemq -Dactivemq.base=/opt/puppet/share/activemq -Dactivemq.conf=/etc/puppetlabs/activemq -Dactivemq.data=/opt/puppet/share/activemq/data -jar /opt/puppet/share/activemq/bin/activemq.jar start
root     16591  7586  0 13:30 pts/0    00:00:00 grep active
Use the command option -o to shown fullname:
[root@ pe-activemq]# ps -e -o "user:16,pid,ppid,c,stime,tty,time,command"|grep active
pe-activemq       2578     1  0 12:44 ?        00:00:28 /opt/puppet/lib/jvm/pe-java/jre/bin/java -Xms512m -Xmx512m -Djava.util.logging.config.file=logging.properties -Dhawtio.realm=activemq -Dhawtio.role=admins -Dhawtio.rolePrincipalClasses=org.apache.activemq.jaas.GroupPrincipal -Djava.security.auth.login.config=/etc/puppetlabs/activemq/login.config -Dcom.sun.management.jmxremote -Djava.awt.headless=true -Djava.io.tmpdir=/opt/puppet/share/activemq/tmp -Dactivemq.classpath=/etc/puppetlabs/activemq; -Dactivemq.home=/opt/puppet/share/activemq -Dactivemq.base=/opt/puppet/share/activemq -Dactivemq.conf=/etc/puppetlabs/activemq -Dactivemq.data=/opt/puppet/share/activemq/data -jar /opt/puppet/share/activemq/bin/activemq.jar start
root             17623  7586  0 13:37 pts/0    00:00:00 grep active
root             17391 grep active

Tuesday 9 June 2015

Add CDROM as local yum repo - CentOS 7

Mount the CD/DVD ROM on the any directory of your wish, for testing mount it on /cdrom.
# mkdir /cdrom
# mount /dev/cdrom /cdrom
Configuration file: Create the new repo file called cdrom.repo under /etc/yum.repos.d directory. # vi /etc/yum.repos.d/local.repo Add the following details.
[LocalRepo]
name=Local Repository
baseurl=file:///cdrom
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7