Take for example the following .config file in .ebextensions/
container_commands:
000_run_queue_daemon:
command: "nohup php artisan queue:work --daemon &"
test: "ps -ef | grep artisan | grep -v grep > /dev/null || echo 1"
If the daemon is not already running, start a queue worker. The queue worker daemon runs forever (by design) and therefore needs to be run as a background process.
The ampersand seems to have no effect and tailing cfn-init.log just halts at
2014-09-15 00:24:53,921 [DEBUG] Running test for command 000_run_queue_daemon
2014-09-15 00:24:53,929 [DEBUG] Test command output: 1
2014-09-15 00:24:53,929 [DEBUG] Test for command 000_run_queue_daemon passed
This then stays as such until the EB process times out and it gives up with the deployment.
How can I make this run as a background process?