Differences between script and exec
I'm wondering what exactly the differences and similarities are between three different patterns I've seen in upstart scripts in the wild. Here are the patterns:
#------
description "node program that just has an exec stanza"
author "ankur"
respawn
respawn limit 99 5
exec /usr/local/bin/node /home/ubuntu/
#------
description "node program that just has an script stanza"
author "ankur"
respawn
respawn limit 99 5
script
end script
#------
description "node program that has script and exec stanzas"
author "ankur"
respawn
respawn limit 99 5
script
exec /usr/local/bin/node /home/ubuntu/
end script
From my own investigation, I couldn't spot any differences. Namely, on 'start' they all get a pid, if I try to start when its already running I'm told that its already running, 'stop' works as expected. If the program exits, they all try to respawn.
If these are all equivalent, then what is the point of exec inside a script stanza? If not, how do these behave differently. I'm not that familiar with how shells are used to start processes and when a new shell process is created, so any explanation of those types of conditions would be great. Also, when would one of these by the right/wrong choice for any given program?
Thanks!
Question information
- Language:
- English Edit question
- Status:
- Expired
- For:
- upstart Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: