elastic / elastic/apm-agent-php

RPM should not overwrite existing configuration files

Open
#851 0 comments 0 reactions 0 assignees View on GitHub
agent-php enhancement from a real user priority: medium triaged
Dominant language
PHP
Stars
268
Forks
86
PR merge metrics
No merged PRs in 30d

Description

When I install the RPM through `yum`, it looks for the PHP additional configuration directory and adds symlinks `98-elastic-apm.ini` and `99-elastic-apm-custom.ini` to point to their respective configuration files in `/opt/elastic/apm-agent-php/etc/`. However, the installation does not check if a configuration file (or symlink) already exists, and it forcefully overwrites what is already there. This is a problem for me because we have multiple PHP versions running on the same server. Each PHP version has the correct INI files for the Elastic APM agent, and it overwriting a pre-existing configuration is a problem. Every time I install the RPM I have to go back and fix the configuration files again removing the symlinks.

Can the RPM be changed so that it checks for `98-elastic-apm.ini` and `99-elastic-apm-custom.ini`, but if they already exists, they are not touched. That is also what is normal behavior, RPMs can create `.rpmnew` or `.rpmsave` files sometimes, but they should never overwrite an existing configuration without confirming with the user. You can display a warning about this to notify the user that the configuration was not updated.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.