Cannot start upstart job, error: Could not open input file

Borna Source

I have an upstart configuration that worked before and now it shows the error:

Could not open input file: /var/local/test/run.php

but the file is there and I can normally run it with php /var/local/test/run.php command.

# Events
start on local-filesystems and net-device-up IFACE=eth0
stop on shutdown

# Automatically respawn
respawn limit 20 5

    exec php -f /var/local/test/run.php
end script

I tried chmod 777, but not helping.

What are my options? Please help. Thank you!


adding an instance variable:

instance $ID

made it work, The thing is that before it used the instance, but now I decided to change the script a bit, and removed it. So I was thinking, is there some cache or similar that I can delete (that does not get deleted with rebooting)?


I figured out that the script adds an end-line char at the end of command, so that is the reason it cannot find the path. I tried surrounding it with quotes:

exec php -f "/var/local/test/run.php"

but it still starts the script with end-line char at the end of php script file path.

What can I do?



answered 1 week ago Borna #1

So, the alternative solution is to add some parameter to the script, so it "eats" the end-line char.

exec php -f /var/local/test/run.php 1

comments powered by Disqus