On 9/30/25 9:28 AM, Óscar García Amor wrote:
Hello folks,


Hey

Let me tell you, I've been maintaining the Telegraf[1] package in AUR
for some time now, and whenever I update it (or generate it), I have to
do it in a container because it's not possible with the `extra-x86_64-
build` command.

If you look at the PKGBUILD, there is a point where the configuration
is generated with the newly created binary itself. It is the last line
of `build()`, `./build/telegraf config > telegraf.conf`. It is at this
point that the execution stops completely if I build the package with
`extra-x86_64-build`.

Can you think of any reason why this might happen or how it could be
fixed? This step is necessary because there is no other way to generate
the base configuration.


For some reason it seems like, despite the "config" argument (which you would expect to solely generate the config), the telegraf binary runs as a daemon and therefore never stops unless you kill it. The `--once` flag, which supposedly should prevent this to happen according to the help message, does not help here.

A sketchy workaround is to run `timeout 2s ./build/telegraf config > telegraf.conf || true`

The timeout command will kill the process after 2s (to ensure it doesn't run endlessly) and the `|| true` part will ensure the build doesn't fail due to the error exit code produced by the process being killed by `timeout`. As I said, it's a bit of a sketchy workaround but should allow the build to succeed in a clean chroot.

I guess this should probably be reported and properly fixed upstream :)

Best regards.

[1]: https://aur.archlinux.org/packages/telegraf



--
Regards,
Robin Candau / Antiz

Attachment: OpenPGP_0xFDC3040B92ACA748.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to