On Wed May 30 17:57:49 EDT 2012, Nataraj wrote:
On Wed, May 30, 2012 17:00, James B. Byrne wrote:
I am trying, without success, to create an upstart config file to automatically start and restart an ssh proxy. The command sting that I use in the script has been checked and verified from the shell but it fails in the upstart file.
The '-f option' tells SSH to run in the background, but normally upstart expects to wait for the process. Maybe you want '-n' instead of '-f'. Alternatively, if you run a program in the background you could specify 'task' in the config file to tell upstart not to wait for the process (you couldn't use respawn with that because then the process is not managed by upstart anymore).
The problem in my script appears to be this:
# SSH switches used: env SSH_SWITCHES="" env SSH_SWITCHES=${SSH_SWITCHES}" -nNqT -vvv "
Upon further investigation I discovered that the env stanza does not expand previously defined variables. My attempt at concatenating values results in the key name being used instead of its value. In other words: '${SSH_SWITCHES} -nNqT -vvv' is what results and not simply '-nNqT -vvv' as one might expect. Exporting the value between env stanzas does not change this behaviour.
Eliminating the concatenation attempts resolved the issue.