The setup work needs to be put in a pre-start script, not in the 'script'; otherwise upstart will be confused because it's told to 'expect fork', and there are several forked processes in this script and upstart has no way to know which is the correct one.
The setup work needs to be put in a pre-start script, not in the 'script'; otherwise upstart will be confused because it's told to 'expect fork', and there are several forked processes in this script and upstart has no way to know which is the correct one.