alpinelinux / docker-alpine

Official Alpine Linux Docker image. Win at minimalism!
MIT License
1.11k stars 264 forks source link

New Relic php daemon installer does not work on 3.20 | /etc/init.d/ directory does not exist? #398

Open sidneyprins opened 6 months ago

sidneyprins commented 6 months ago

We use the New Relic PHP Daemon. We install this through the tar and execute the New Relic installer script

RUN curl -L https://download.newrelic.com/php_agent/archive/10.19.0.9/newrelic-php5-10.19.0.9-linux-musl.tar.gz | tar -C /tmp -zx \
    && /tmp/newrelic-php5-10.19.0.9-linux-musl/newrelic-install install \
    && rm -rf /tmp/newrelic-php5-* /tmp/nrinstall*

The above will result in the following error. I've also tried newer versions of the New Relic PHP Daemon, but that does not change anything.

1.892 FATAL: failed to copy daemon init script to /etc/init.d/newrelic-daemon
1.892 FATAL: New Relic agent installation failed.

When I do a ls -lha /etc/init.d/ I can see that this directory does not exist.

The newrelic installer executes this

    if logcmd cp -f "${ilibdir}/scripts/init.${ostype}" "${osdifile}"; then
      logcmd chmod 755 "${osdifile}" || {
        fatal "failed to set permissions on ${osdifile}"
      }
    else
      fatal "failed to copy daemon init script to ${osdifile}"
    fi

So it tries to copy a script to init.d and that's where it fails.

A workaround is pinning the version to 3.19, ex php:8.3-fpm-alpine3.19

I would like to use 3.20. How to resolve this? Do I need to do something to make this directory available? Is this something the Alpine Linux needs to fix, or New Relic in their installer?

fvelcker commented 6 months ago

Looks like NR is on it https://knowledge.newrelic.com/s/article/PHP-agent-Install-script-fails-on-alpine-3-20-for-official-php-docker-images?t=1717143195693 (and there are some workarounds)

sidneyprins commented 6 months ago

Link to issue on the newrelic-php-agent repository

https://github.com/newrelic/newrelic-php-agent/issues/905

lavarou commented 5 months ago

/etc/init.d (along with a few other dirs) has been removed from alpine-baselayout in https://git.alpinelinux.org/aports/commit/main/alpine-baselayout/APKBUILD?id=4c48c04055fe3d077edf9d23ddf5492901ac9259 commit. This has not been advertised in Alpine 3.20 Release Notes.

fossdd commented 5 months ago

Please open a issue on aports: https://gitlab.alpinelinux.org/alpine/aports/-/issues