background-process
background-process copied to clipboard
isRunning is not working in docker container
Hello im using php-fpm alpine docker
the isRunning function always says true because the output of this code :
$result = shell_exec(sprintf('ps %d 2>&1', $this->pid));
is something like this :
PID USER TIME COMMAND\n 1 root 0:00 {supervisord} /usr/bin/python2 /usr/bin/supervisord -n -c /etc/supervisord.conf\n 15 root 0:00 crond -f /dev/null\n 17 root 0:00 php-fpm: master process (/usr/local/etc/php-fpm.d/www.conf)\n 18 root 0:00 nginx: master process /usr/sbin/nginx -g daemon off; error_log /dev/stderr info;\n 19 nginx 0:00 nginx: worker process\n 20 nginx 0:00 nginx: worker process\n 21 nginx 0:00 php-fpm: pool www\n 22 nginx 0:00 php-fpm: pool www\n 23 nginx 0:00 php-fpm: pool www\n 114 root 0:00 /bin/bash\n 270 root 0:00 php artisan streams:uptime\n 275 root 0:00 ps 90\n
so the count check after (the if statement) always get TRUE because it returns mother than 2 rows
im investigating and maybe send you a PR