Perl parsing ps fwaux output -


I am trying to understand the processes of children from a given parent's PS FYX (One of doing so The better way can be this). Actually, I'm running Daemon, which can not be processed at any time, or not. In another script, I want to see if there are any child procedures, and if you do something like this then error then.

ps fwaux | Grep will show me the tree, but I'm not sure what any suggestions to do with it will be great.

You can parse the results of the call:

  Usage Proc: ProcessTable; My $ process = PRO: processable-> new (enable_ttys = & gt; 0); My @Childen = Grape {$ _- & gt; CMDline = ~ / some_pattern_matching_your_children /} @ {$ procedures-> Table}; #or: My @Childon = GAP {$ _- & gt; Ppid == $ parent_pid} @ {$ processes-> Table};  

But withdrawing the major problem of child tracking: Instead of displaying the procedure table, children should use PID files. Can help you


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -