In Upstart script I can use chdir stanza to set the working directory. Also I can just execute a normal cd command inside my script section.
What is the difference between this two approaches? When and why I should use each of them?
In Upstart script I can use chdir stanza to set the working directory. Also I can just execute a normal cd command inside my script section.
What is the difference between this two approaches? When and why I should use each of them?
In Upstart, you can have more than just one type of script. For example you can have pre/post start and pre/post stop scripts as well. The chdir stanza sets a default directory for ALL scripts. The cd command will only change the working directory within the scope of the current script.