Skip to content

php-fpm issues (container runtime) #404

Description

@paulbadcock

Logic issues with the following

https://github.com/sclorg/s2i-php-container/blob/master/8.1/s2i/bin/run#L59-L68

if [ "x$PLATFORM" == "xel9" ] || [ "x$PLATFORM" == "xfedora" ]; then
  if [ -n "${PHP_FPM_RUN_DIR:-}" ]; then
    /bin/ln -s /dev/stderr ${PHP_FPM_LOG_PATH}/error.log
    mkdir -p ${PHP_FPM_RUN_DIR}
    chmod -R a+rwx ${PHP_FPM_RUN_DIR}
    chown -R 1001:0 ${PHP_FPM_RUN_DIR}
    mkdir -p ${PHP_FPM_LOG_PATH}
    chmod -R a+rwx ${PHP_FPM_LOG_PATH}
    chown -R 1001:0 ${PHP_FPM_LOG_PATH}
  fi

fi

On runtime it's trying to create folders and set permissions in an immutable object, shouldn't this be in the assemble script and not at runtime?

Also there's functional issues such as trying to symlink to the error.log before the mkdir runs on the ${PHP_FPM_LOG_PATH} but the bigger issue is this won't run inside the assembled container as the following output indicates running as non root.

chmod: changing permissions of '/run/php-fpm': Operation not permitted
chown: changing ownership of '/run/php-fpm': Operation not permitted
chmod: changing permissions of '/var/log/php-fpm': Operation not permitted
chown: changing ownership of '/var/log/php-fpm/error.log': Operation not permitted
chown: changing ownership of '/var/log/php-fpm': Operation not permitted

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions