Find the answer to your Linux question:
Results 1 to 2 of 2
Hi, I tried to get process ID using pidof. It didn't give any error but a blank output at console Code: $ pidof -s instance1 $ But when I use ...
  1. #1
    Just Joined!
    Join Date
    Jan 2011
    Posts
    9

    How to get process ID using "pidof"

    Hi,

    I tried to get process ID using pidof. It didn't give any error but a blank output at console

    Code:
    $ pidof -s instance1
    
    $
    But when I use ps -ef, I get the process ID

    Code:
    $ ps -ef | grep instance1
    root      4174 21661  0 06:52 pts/1    00:00:00 grep instance1
    provgw   30220 30219 28 06:46 pts/1    00:01:44 /usr/java/jdk1.6.0_18/bin/java -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/opt/provgw/tomcat/instance1/conf/logging.properties -Dinstance_id=instance1 -Dglobal.conf=/etc/provgw -Daxis.xml.reuseParsers=true -Xbatch -dsa -Xrs -Xss128k -XX:+UseParallelGC -XX:ParallelGCThreads=20 -XX:+AggressiveOpts -Xms10097514k -Xmx10097514k -Xmn3029255k -XX:MaxPermSize=256m -XX:+CMSClassUnloadingEnabled -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n -Djava.endorsed.dirs=/opt/provgw/tomcat/endorsed -classpath :/opt/provgw/tomcat/bin/bootstrap.jar:/opt/provgw/tomcat/bin/onends-tomcat.jar -Dcatalina.base=/opt/provgw/tomcat/instance1 -Dcatalina.home=/opt/provgw/tomcat -Djava.io.tmpdir=/opt/provgw/tomcat/instance1/temp org.apache.catalina.startup.Bootstrap start
    Actually i'm writing a shell script. So I thought if i can get the process ID directly using "pidof" it'd be helpful. Can someone please help?

  2. #2
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    Please do not double post.
    DISTRO=Arch
    Registered Linux User #388732

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...