Search code examples
phpdockercontainersbuildpack

reload `procmgr` in container?


So I have a docker container build with buildpack that runs the following command under PID 1

procmgr /layers/paketo-buildpacks_php-web/php-web/procs.yml

is it possible to reload the configs passed into procmgr somehow?

🐳  [DEV] backend-v1-7476cc6cfd-l68p2 app # 
ps aufx
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
cnb         30  1.0  0.0  18648  3444 pts/0    Ss   03:22   0:00 bash
cnb         77  0.0  0.0  34412  2944 pts/0    R+   03:22   0:00  \_ ps aufx
cnb          1  0.0  0.1 1013616 4096 ?        Ssl  03:20   0:00 procmgr /layers/paketo-buildpacks_php-web/php-web/procs.yml
cnb         24  0.0  0.7 323596 31260 ?        Ss   03:20   0:00 php-fpm: master process (/layers/paketo-buildpacks_php-web/php-web/etc/php-fpm.conf)
cnb         28  0.3  0.6 330252 24112 ?        S    03:20   0:00  \_ php-fpm: pool www
cnb         29  0.1  0.6 330016 23900 ?        S    03:20   0:00  \_ php-fpm: pool www
cnb         25  0.0  0.1  25132  5648 ?        S    03:20   0:00 nginx: master process nginx -p /workspace/app -c /workspace/app/nginx.conf
cnb         26  0.0  0.0  25132  1988 ?        S    03:20   0:00  \_ nginx: worker process
cnb         27  0.0  0.0  25132  1988 ?        S    03:20   0:00  \_ nginx: worker process

🐳  [DEV] backend-v1-7476cc6cfd-l68p2 app # 
cat /layers/paketo-buildpacks_php-web/php-web/procs.yml
processes:
  nginx:
    command: nginx
    args:
    - -p
    - /workspace/app
    - -c
    - /workspace/app/nginx.conf
  php-fpm:
    command: php-fpm
    args:
    - -p
    - /layers/paketo-buildpacks_php-web/php-web
    - -y
    - /layers/paketo-buildpacks_php-web/php-web/etc/php-fpm.conf
    - -c
    - /layers/paketo-buildpacks_php-web/php-web/etc

Solution

  • At the time of writing this, no. The procmgr cli that is used here is very basic.

    https://github.com/paketo-buildpacks/php-web/blob/main/cmd/procmgr/main.go

    It loads the processes information listed in procs.yml, starts those processes, redirects all STDOUT/STDERR, and watches for a process to exit. If one process exits, then they all exit. There's no reload capability.

    If you need to reload the information in procs.yml, you'll need to reload your container.