Bugzilla – Bug 1153280
fillup breaks on some multiline variables
Last modified: 2021-05-12 17:33:37 UTC
The prometheus node exporter takes cli arguments that can include regular expression strings. For example /etc/sysconfig/prometheus-node_exporter can have content like so: ARGS="-collector.diskstats.ignored-devices=^(ram|loop|fd)\d+$ \ -collector.filesystem.ignored-mount-points=^/(sys|proc|dev|run)($|/) \ -collector.textfile.directory=/var/lib/prometheus/node-exporter" The package https://build.opensuse.org/package/show/server:monitoring/golang-github-prometheus-node_exporter recently introduced the use of %fillup_only in its spec file. This however breaks existing sysconfig files. This behaviour can be reproduced by only calling fillup. With the content as listed above in prometheus-node_exporter, a file prometheus-node_exporter.default with this content: ARGS="foo" Calling fillup prometheus-node_exporter prometheus-node_exporter.default prometheus-node_exporter.out produces ARGS="-collector.diskstats.ignored-devices=^(ram|loop|fd)\d+$ \
Here's steps to reproduce: # cat prometheus-node_exporter ARGS="-collector.diskstats.ignored-devices=^(ram|loop|fd)\d+$ \ -collector.filesystem.ignored-mount-points=^/(sys|proc|dev|run)($|/) \ -collector.textfile.directory=/var/lib/prometheus/node-exporter" # cat prometheus-node_exporter.default ARGS="foo" # fillup prometheus-node_exporter prometheus-node_exporter.default \ prometheus-node_exporter.broken # cat prometheus-node_exporter.broken ARGS="-collector.diskstats.ignored-devices=^(ram|loop|fd)\d+$ \ I have no idea why, but if I remove the '-' character from the third line of prometheus-node_exporter, the problem goes away: # cat prometheus-node_exporter ARGS="-collector.diskstats.ignored-devices=^(ram|loop|fd)\d+$ \ -collector.filesystem.ignored-mount-points=^/(sys|proc|dev|run)($|/) \ collector.textfile.directory=/var/lib/prometheus/node-exporter" # fillup prometheus-node_exporter prometheus-node_exporter.default prometheus-node_exporter.broken # cat prometheus-node_exporter.broken ARGS="-collector.diskstats.ignored-devices=^(ram|loop|fd)\d+$ \ -collector.filesystem.ignored-mount-points=^/(sys|proc|dev|run)($|/) \ collector.textfile.directory=/var/lib/prometheus/node-exporter" Something in that string must be confusing fillup's parser, I'm just surprised it's the '-' character.