LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   upstart process tracking (https://www.linuxquestions.org/questions/linux-server-73/upstart-process-tracking-4175456475/)

sam42 04-02-2013 03:47 AM

upstart process tracking
 
Hi,

On Ubuntu (or Redhat, etc) , which process does an upstart job track?

Let me explain my question more.

Within an upstart config file, there can be "exec" lines and "script" lines. Perhaps there might be multiple instances of these? not sure. At the very least, within a "script" section there could be many lines of code, and each line of code would generate a PID. That PID may or may not be long lasting. In many cases, it would not be.

Put aside the issue of "expect fork" and "expect daemon", as I am not talking about forks or daemons.

Here is an attempt at answering my own question. Your feedback is welcome:

There is only one exec or script stanza permitted. The last PID is the one that's tracked.

Does that sounds right?

Thanks.

eSelix 04-02-2013 05:52 AM

Quote:

Within an upstart config file, there can be "exec" lines and "script" lines. Perhaps there might be multiple instances of these?
Only one instance.

Quote:

within a "script" section [...] each line of code would generate a PID.
This script is executed by shell (with -e option) and this shell PID is tracked. So "PID tracking" will end when any command within script fail.

sam42 04-02-2013 06:33 AM

It appears that using "exec" within the script block makes for a cleaner process list with "ps -ef"

script
exec myprocess
end script

It appears that multiple statements won't be run:

script
exec myprocess1
exec myprocess2
end script

myprocess2 isn't launched.

eSelix 04-02-2013 06:48 AM

"exec" within "script" block is not the same as "exec" from upstart job configuration file. That "exec" is a normal shell command as everything within "script / end script".


All times are GMT -5. The time now is 07:29 AM.