[Ilugc] ps -ef |grep command in ptyhon not working

  • From: hariprasadh89@xxxxxxxxx (hari prasadh)
  • Date: Wed, 29 Jan 2014 18:16:29 +0530

In python

import os
os.popen("ps -ef |grep jboss").read()
'root     24452 24425  0 17:34 pts/0    00:00:00 sh
/root/jboss-as-7.1.1.Final/bi\nroot     24593 24592  0 17:34 pts/0
 00:00:00 sh -c ps -ef |grep jboss\nroot     24595 24593  0 17:34 pts/0
 00:00:00 grep jboss\n'

if i ran the command in console

[root at 10 bin]# ps -ef |grep jboss
root     24452 24425  0 17:34 pts/0    00:00:00 sh
/root/jboss-as-7.1.1.Final/bin/standalone.sh -Djboss.bind.address=0.0.0.0
-Djboss.bind.address.management=0.0.0.0
*root     24499 24452  0 17:34 pts/0    00:00:13 java -D[Standalone]
-server -XX:+UseCompressedOops -XX:+TieredCompilation -Xms64m -Xmx512m
-XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true
-Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000
-Dsun.rmi.dgc.server.gcInterval=3600000
-Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true
-Djboss.server.default.config=standalone.xml
-Xloggc:/root/jboss-as-7.1.1.Final/standalone/log/gc.log
-XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Dmaster.enable=true
-Dorg.jboss.boot.log.file=/root/jboss-as-7.1.1.Final/standalone/log/boot.log
-Dlogging.configuration=file:/root/jboss-as-7.1.1.Final/standalone/configuration/logging.properties
-jar /root/jboss-as-7.1.1.Final/jboss-modules.jar -mp
/root/jboss-as-7.1.1.Final/modules -jaxpmodule javax.xml.jaxp-provider
org.jboss.as.standalone -Djboss.home.dir=/root/jboss-as-7.1.1.Final
-Djboss.bind.address=0.0.0.0 -Djboss.bind.address.management=0.0.0.0*
root     24677 24425  0 18:08 pts/0    00:00:00 grep jboss


i was not able to get the process and its id.i dont know what iam missing
there.
can someone help me out.

-- 
Thanks & Regards,
HariPrasadh

Other related posts: