muzafferdede
6 months ago
325
0
Laravel

How to include host ip adress in artisan command with supervisor

Posted 6 months ago by muzafferdede

Hi i am trying to make my supervisor config file gets ip address of host using this way:

[program:socket-server]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/atm/artisan socket-serve --host=$(hostname -I)
autostart=true
autorestart=true
user=laxan
numprocs=1
redirect_stderr=true
stdout_logfile=/var/www/atm/storage/logs/socket-server.log

as you can see i reference the host ip adress using $(hostname -I)

when i run this command in termina, it's works and finds the ip adress correctly but running with supervisor gives me error which says i cant use $(hostname -I) in the string because of the format error. How can i reference ip address of host in command?

Thanks

Please sign in or create an account to participate in this conversation.