Page 2 of 2 First 12
  • Jump to page:
    #16
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Posts
    77
    Rep Power
    14
    i finally got mysql to work.
    Now can some one help me how to find the parent mysql process and it children.

    PHP Code:


    bash
    -2.05ps -efl grep mysql 
     8 S kwik  7923  7908  0  50 20        
    ?    121        22:21:34 pts/4    0:00 grep mysql
     8 S     root  6888     1  0  40 20        
    ?    133        ?   Jul 29 ?        0:00 /bin/sh bin/mysqld_safe --user=mysq
     8 T kwik7913  7908  0  40 20        
    ?    396          22:12:58 pts/4    0:00 mysql -u kwik -p kwik_db
     8 S    mysql  6912  6888  0  40 20        
    ?   5247        ?   Jul 29 ?        0:01 /usr/local/mysql/libexec/mysqld --
  2. #17
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Posts
    103
    Rep Power
    14
    Here is an example of how to read the 'ps' command.
    Code:
                    UID   PID  PPID  C    STIME TTY  TIME CMD
                  root     0     0  0   Sep 18 ?    0:17 sched
                  root     1     0  0   Sep 18 ?    0:54 /etc/init -
                  root     2     0  0   Sep 18 ?    0:00 pageout
                  root     3     0  0   Sep 18 ?    6:15 fsflush
                  root   418     1  0   Sep 18 ?    0:00 /usr/lib/saf/sac -t 300
                 daemon  156     1  0   Sep 18 ?    0:00 /usr/lib/nfs/statd
    PID is the process ID.
    PPID is the Parent process ID.

    So you see under PID, there is a number of "1" and it is running the /etc/init process. Well, if you look for "1" under PPID, you will see /usr/lib/saf/sac and /usr/lib/nfs/statd. Those are child processes from /etc/init. The "1" in PPID tells you what the parent process is.

    Yours is hard to read because of the php text box you put it in, but PID 6888 is parent and 6912 is its' child.
  4. #18
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Posts
    77
    Rep Power
    14
    Originally Posted by faulkner
    Here is an example of how to read the 'ps' command.
    Code:
                    UID   PID  PPID  C    STIME TTY  TIME CMD
                  root     0     0  0   Sep 18 ?    0:17 sched
                  root     1     0  0   Sep 18 ?    0:54 /etc/init -
                  root     2     0  0   Sep 18 ?    0:00 pageout
                  root     3     0  0   Sep 18 ?    6:15 fsflush
                  root   418     1  0   Sep 18 ?    0:00 /usr/lib/saf/sac -t 300
                 daemon  156     1  0   Sep 18 ?    0:00 /usr/lib/nfs/statd
    PID is the process ID.
    PPID is the Parent process ID.

    So you see under PID, there is a number of "1" and it is running the /etc/init process. Well, if you look for "1" under PPID, you will see /usr/lib/saf/sac and /usr/lib/nfs/statd. Those are child processes from /etc/init. The "1" in PPID tells you what the parent process is.

    Yours is hard to read because of the php text box you put it in, but PID 6888 is parent and 6912 is its' child.
    Thanks that was a great help
  6. #19
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2004
    Posts
    2
    Rep Power
    0

    how to kill a process ID while running a script


    Originally Posted by stevengs
    ...
    hi.. can you h elp me with this one..
    i am running a script that will kill the PID of a certain process if it sees something wrong in the system..
    for example: if i encountered an error while one process is running then my script should kill the PID of the said process..
    how will i be able to grep the PID and kill it..
    thanks very much..
Page 2 of 2 First 12
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo