如何在AWS EB上部署后自动运行Enqueue安装代理和其他后台作业?

I have a Symfony application which relies on Enqueue Bundle for background commands, and I'm deploying it to AWS elastaic beanstalk. Now I want to run enqueue broker command along with all other enqueue commands in background directly after deploy (post-deploy).

What I'm doing right now, that I just simply creates a shell script that creates a new /etc/init.d service that is used to start/stop/status the command based on command PID.

By adding a new command to .ebextensions/files.config

"/opt/elasticbeanstalk/hooks/appdeploy/post/02_start_my_command_service.sh":
              mode: "000755"
              owner: root
              group: root
              content: |
                  #!/bin/bash
                  /var/www/html/bin/my-command-service.sh

and my-command-service.sh is the shell script responsible for creating and running my-command-service

#!/bin/bash


COMMAND='php /var/app/current/bin/console my:command'
LOG_DIR='/var/log/my-command'
LOG_FILE='/var/log/my-command/log.log'
LOCK_FILE='/var/lock/subsys/my'
PID_FILE='/var/app/current/bin/my_pid.txt'

SERVICE_NAME='myCommand'
SERVICE_LOG_NAME='My_Command'
SERVICE_INSTALLATION_LOG_NAME='MY_COMMAND'


echo "#$SERVICE_INSTALLATION_LOG_NAME# Creating log directory"
echo

mkdir -p $LOG_DIR
touch $LOG_FILE

echo "#$SERVICE_INSTALLATION_LOG_NAME# Creating service"
echo

cat > /etc/rc.d/init.d/$SERVICE_NAME << EOF
#!/bin/bash
#
# /etc/rc.d/init.d/$SERVICE_NAME
#
# chkconfig: 345 70 30
# description: Runs $SERVICE_NAME command
# processname: $SERVICE_NAME

### BEGIN INIT INFO
# Provides: $SERVICE_NAME
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Should-Start:
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions

case "\$1" in
    start)
        echo -e "($SERVICE_LOG_NAME) - Service is starting..
"
        echo -e "($SERVICE_LOG_NAME) - Creating lockfile
"
        touch $LOCK_FILE
        echo -e "($SERVICE_LOG_NAME) - Running command and directing output to $LOG_FILE
"
        nohup $COMMAND &>$LOG_FILE &
        echo \$! > $PID_FILE
        echo -e "($SERVICE_LOG_NAME) - Disowning this process from the current session
"
        disown
        echo
    ;;
    stop)
        echo -e "($SERVICE_LOG_NAME) - Service is running..
"
        echo -e "($SERVICE_LOG_NAME) - Killing command process id
"
        kill -9 \`cat $PID_FILE\`
        echo -e "($SERVICE_LOG_NAME) - Removing PID file
"
        rm -f $PID_FILE
        echo -e "($SERVICE_LOG_NAME) - Removing lockfile
"
        rm -f $LOCK_FILE
    ;;
    status)
        if [ -s $PID_FILE ]
        then
            echo -e "Command is running on PID \$(cat $PID_FILE)
"
            echo -e "Check command logs by reading this file $LOG_FILE
"
        else
            echo -e "Command is not running, PID file was not found in here $PID_FILE
"
        fi
        echo
    ;;
    restart)
    ;;
    reload)
    ;;
    probe)
    ;;
    *)
        echo "Usage: $SERVICE_NAME {start|stop|status|reload|restart[|probe]"
        exit 1
    ;;
esac
EOF

chmod +x /etc/rc.d/init.d/$SERVICE_NAME
chkconfig --add $SERVICE_NAME
service $SERVICE_NAME start

echo "#$SERVICE_INSTALLATION_LOG_NAME# Created service was done"

Now although this perfectly runs and creates new service myCommand which I can run and control it in the following manner service myCommand start|stop|status

But I feel I'm over complicating the problem, because for each command I need it to run in the background, I have to follow the exact same steps to create its own service.

So is there any better way for doing this? running background jobs automatically after deploy in AWS EB?