This commit is contained in:
Suhel_Ksolves_Cassandra-Partner 2026-07-29 13:35:24 +08:00 committed by GitHub
commit 7a044ab8e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 4 deletions

View File

@ -10,6 +10,7 @@ conf/hotspot_compiler etc/cassandra
conf/cqlshrc.sample etc/cassandra
conf/credentials.sample etc/cassandra
conf/triggers/* etc/cassandra/triggers
conf/cassandra-jaas.config etc/cassandra
debian/cassandra.conf etc/security/limits.d
debian/cassandra-sysctl.conf etc/sysctl.d
bin/cassandra.in.sh usr/share/cassandra

View File

@ -100,8 +100,9 @@ rm -f bin/cassandra.in.sh
rm -f lib/sigar-bin/*winnt* # strip segfaults on dll..
rm -f tools/bin/cassandra.in.sh
# copy default configs
cp -pr conf/* %{buildroot}/%{_sysconfdir}/%{username}/default.conf/
# copy default configs directly to /etc/cassandra to align with Cassandra's expected config path
# Removed references to 'default.conf' to simplify config management. Now, all Cassandra configs reside directly under /etc/cassandra
cp -pr conf/* %{buildroot}/%{_sysconfdir}/%{username}/
# step on default config with our redhat one
cp -p redhat/%{username}.in.sh %{buildroot}/usr/share/%{username}/%{username}.in.sh
@ -165,13 +166,14 @@ exit 0
%{python_sitelib}/cassandra_pylib*.egg-info
%post
alternatives --install /%{_sysconfdir}/%{username}/conf %{username} /%{_sysconfdir}/%{username}/default.conf/ 0
# Update alternatives to point to the correct config directory.
alternatives --install /%{_sysconfdir}/%{username} %{username} /%{_sysconfdir}/%{username}/ 0
exit 0
%preun
# only delete alternative on removal, not upgrade
if [ "$1" = "0" ]; then
alternatives --remove %{username} /%{_sysconfdir}/%{username}/default.conf/
alternatives --remove %{username} /%{_sysconfdir}/%{username}/
fi
exit 0