openziti / ziti-tunnel-sdk-c

Apache License 2.0
43 stars 16 forks source link

RPM package missing config file #994

Open sabedevops opened 1 month ago

sabedevops commented 1 month ago

The commit ff12270b added logic to unlink the ziti-edge-tunnel.service unit file in the post.sh script here.

This causes the RPM database to list this file as missing since it is marked with %config in the generated RPM Spec file.

sudo rpm -V ziti-edge-tunnel
.M....G..    /opt/openziti/etc/identities
missing   c /opt/openziti/share/ziti-edge-tunnel.service
.M...UG..    /var/lib/ziti

Perhaps adding it to the CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION might work if desired.

qrkourier commented 1 month ago

blocked by https://github.com/openziti/ziti-tunnel-sdk-c/issues/965

qrkourier commented 4 hours ago

Recap: the post-install scripts introspect the OS to discover the correct location to place the systemd service unit for ZET. This can't be done as reliably at build time, so it's necessary to install the service unit in the package to a predictable location, then move it to the correct location for the specific distribution and vintage. This causes the package manager to complain that a file it was asked to manage is missing.

We could stop moving it, and only copy it. This is the way it was done at first, and we started removing the unit file because its presence caused confusion. Specifically, users found the unit file and assumed they could modify and load and were confused that their changes were not in effect.

We could mitigate that risk of confusion by adding a note in the unit file like:

Do not modify this main unit file. Run systemctl cat ziti-edge-tunnel.service to see the unit's file location(s) and the configuration provided by each. You can customize the unit by adding or overriding directives with a drop-in: /etc/systemd/system/ziti-edge-tunnel.service.d/override.conf.

This would eliminate the problem we're now facing with installed files that are missing because they were deleted by the post-install script, and would be more helpful than simply removing the main unit file from its installed location because we would also be answering "How do I customize the unit?"