Skip to content

Commit

Permalink
Add missing /var/spacewalk/* packages to uyuni-base.spec
Browse files Browse the repository at this point in the history
The /var/spacewalk/{systems,packages} folders where created by
spacewalk-setup before the recent refactoring. Now that they have been
removed from the setup scriptm they need to be part of the
uyuni-base-server package like their parent.

Since the GH PR acceptance tests are only using a released image and
deploy changes to it, the spec file changes won't be there. They need to
be duplicated by the CI setup, hence the create of a
setup_missing_folders.sh script.
  • Loading branch information
cbosdo committed Jan 30, 2025
1 parent 2c61e58 commit 0f4407a
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
6 changes: 0 additions & 6 deletions spacewalk/setup/bin/spacewalk-setup
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,8 @@ setup_admin_email(\%opts, \%answers, \%rhnOptions);
if(not $opts{"skip-initial-configuration"}) {
print Spacewalk::Setup::loc("* Performing initial configuration.\n");
my $config_opts = populate_initial_configs(\%opts, \%answers);
my $www_uid = (getpwnam('wwwrun') // "");
chown $www_uid, -1, $config_opts->{'mount_point'} . '/packages';
chmod 0775, $config_opts->{'mount_point'};
chmod 0775, $config_opts->{'mount_point'} . '/systems';
chmod 0775, $config_opts->{'kickstart_mount_point'};
# Check for both potential Apache groups (SUSE/RHEL)
my $www_gid = getgrnam(`grep -hsoP "(?<=Group ).*" /etc/httpd/conf/*.conf /etc/apache2/*.conf | tr -d '\n'`);
chown $www_uid, $www_gid, $config_opts->{'mount_point'} . '/systems';
}


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Create /var/spacewalk/* folders in the spec file
3 changes: 2 additions & 1 deletion testsuite/podman_runner/07_server_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,5 @@ sudo -i podman run --cap-add AUDIT_CONTROL --rm \
/usr/lib/susemanager/bin/mgr-setup && \
/usr/bin/spacewalk-schema-upgrade -y && \
/testsuite/podman_runner/run_db_migrations.sh susemanager-schema && \
/testsuite/podman_runner/run_db_migrations.sh uyuni-reportdb-schema"
/testsuite/podman_runner/run_db_migrations.sh uyuni-reportdb-schema && \
/testsuite/podman_runner/setup_missing_folders.sh"
7 changes: 7 additions & 0 deletions testsuite/podman_runner/setup_missing_folders.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/bash

for folder in systems packages; do
mkdir -p /var/spacewalk/${folder}
chmod 0775 /var/spacewalk/${folder}
chown wwwrun:www /var/spacewalk/${folder}
done
1 change: 1 addition & 0 deletions uyuni/base/uyuni-base.changes.cbosdo.gh-ci-volumes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Create /var/spacewalk/* folders in the spec file
4 changes: 3 additions & 1 deletion uyuni/base/uyuni-base.spec
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ Basic filesystem hierarchy for Uyuni proxy.
mkdir -p %{buildroot}%{_sysconfdir}/rhn
mkdir -p %{buildroot}%{_datadir}/rhn/proxy
%if 0%{?suse_version} >= 1500 || 0%{?rhel} >= 9
mkdir -p %{buildroot}%{_localstatedir}/spacewalk
install -d -m 0775 %{buildroot}%{_localstatedir}/spacewalk
install -d -m 0775 -o %{apache_user} -g %{apache_group} %{buildroot}/%{_localstatedir}/spacewalk/systems
install -d -m 0775 -o %{apache_user} -g %{apache_group} %{buildroot}/%{_localstatedir}/spacewalk/packages
%endif
mkdir -p %{buildroot}%{_datadir}/rhn/config-defaults
mkdir -p %{buildroot}/srv/www/distributions
Expand Down

0 comments on commit 0f4407a

Please sign in to comment.