Skip to content

Commit

Permalink
Cleanup and remove systemd use in the setup scripts
Browse files Browse the repository at this point in the history
Remove unused code in the setup scripts in order to ease refactoring
them. This commit removes the need for systemd running as PID1 to run
the setup script.

This also means that mgr-setup has to be called before running the real
container and starting everything.

Note that some of the cleanup removing non-SUSE distributions handling,
which shouldn't be a problem as Uyuni is now only shipped as a container
built on a single openSUSE distro.
  • Loading branch information
cbosdo committed Nov 26, 2024
1 parent 5bcbcda commit 44145bb
Show file tree
Hide file tree
Showing 31 changed files with 103 additions and 2,289 deletions.
2 changes: 0 additions & 2 deletions projects/perl-Satcon/bin/satcon-deploy-tree.pl
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ sub process_file {
my $apache_group = getgrnam(`grep -hsoP "(?<=Group ).*" /etc/httpd/conf/*.conf /etc/apache2/*.conf | tr -d '\n'`);
chown 0, $apache_group, "$destdir/$relative_path";

system '/sbin/restorecon', '-vv', "$destdir/$relative_path";

while (<IF>) {
my $out = $engine->perform_substitutions($_);
print OF $out;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Remove useless selinux-related code
1 change: 0 additions & 1 deletion rel-eng/packages/spacewalk-setup-postgresql

This file was deleted.

5 changes: 1 addition & 4 deletions schema/spacewalk/spacewalk-schema-upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,7 @@ elsif($server_version > $MAX_PG_DB_VERSION) {
exit 1;
}

my $my_schema_version_out = `rpm -qf --qf '%{name} %{version} %{release}\n' $SCHEMA_DIR/schema-override 2> /dev/null`;
if ($?) { # the directory does not exists or is not owned by any rpm
$my_schema_version_out = `rpm -qf --qf '%{name} %{version} %{release}\n' $SCHEMA_DIR/main.sql`;
}
$my_schema_version_out = `rpm -qf --qf '%{name} %{version} %{release}\n' $SCHEMA_DIR/main.sql`;
my ($my_schema_name, $my_schema_version, $my_schema_release) = ($my_schema_version_out =~ /^(\S+)\s(\S+)\s(\S+)$/);
if (not defined $my_schema_release) {
die "Failed to retrieve our schema package name and version.\n";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Clean up code related to unused schema-override
1 change: 0 additions & 1 deletion spacewalk/admin/Makefile.admin
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ CONF_DEST = $(PREFIX)/$(CONFDIR)
SYSTEMD_DEST = $(PREFIX)/$(SYSTEMDDIR)

SCRIPTS = rhn-config-satellite.pl \
rhn-config-schema.pl \
rhn-deploy-ca-cert.pl \
rhn-install-ssl-cert.pl \
salt-secrets-config.py
Expand Down
192 changes: 0 additions & 192 deletions spacewalk/admin/rhn-config-schema.pl

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Remove useless selinux and oracle related code
3 changes: 0 additions & 3 deletions spacewalk/admin/spacewalk-admin.spec
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ sed -i 's/apache2.service/httpd.service/g' uyuni-check-database.service
make -f Makefile.admin install PREFIX=%{buildroot}

mkdir -p %{buildroot}%{_mandir}/man8/
%{_bindir}/pod2man --section=8 rhn-config-schema.pl > %{buildroot}%{_mandir}/man8/rhn-config-schema.pl.8
%{_bindir}/pod2man --section=8 man/spacewalk-service.pod > %{buildroot}%{_mandir}/man8/spacewalk-service.8
%{_bindir}/pod2man --section=8 man/rhn-sat-restart-silent.pod > %{buildroot}%{_mandir}/man8/rhn-sat-restart-silent.8
%{_bindir}/pod2man --section=8 rhn-config-satellite.pl > %{buildroot}%{_mandir}/man8/rhn-config-satellite.pl.8
Expand All @@ -81,13 +80,11 @@ fi
%{_sbindir}/uyuni-update-config
%{_sbindir}/import-suma-build-keys
%{_bindir}/rhn-config-satellite.pl
%{_bindir}/rhn-config-schema.pl
%{_bindir}/rhn-deploy-ca-cert.pl
%{_bindir}/rhn-install-ssl-cert.pl
%{_bindir}/salt-secrets-config.py
%{_sbindir}/rhn-sat-restart-silent
%{_sbindir}/mgr-monitoring-ctl
%{_mandir}/man8/rhn-config-schema.pl.8*
%{_mandir}/man8/spacewalk-service.8*
%{_mandir}/man8/rhn-sat-restart-silent.8*
%{_mandir}/man8/rhn-config-satellite.pl.8*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Remove unused configuration defaults files
19 changes: 0 additions & 19 deletions spacewalk/package/spacewalk.spec
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,7 @@ Version for PostgreSQL database backend.
#nothing to do here

%install
RDBMS="postgresql"
install -d %{buildroot}%{_sysconfdir}
install -d %{buildroot}%{_datadir}/spacewalk/setup/defaults.d
for i in ${RDBMS} ; do
cat <<EOF >%{buildroot}%{_datadir}/spacewalk/setup/defaults.d/$i-backend.conf
# database backend to be used by spacewalk
db-backend = $i
EOF
done
install -d %{buildroot}%{_bindir}
%if 0%{?rhel}
ln -s %{_prefix}/pgsql-14/bin/initdb %{buildroot}%{_bindir}/initdb
Expand All @@ -152,16 +144,5 @@ ln -s %{_prefix}/pgsql-14/bin/initdb %{buildroot}%{_bindir}/initdb
%files common
%{!?_licensedir:%global license %doc}
%license LICENSE
%if 0%{?suse_version}
%dir %{_datadir}/spacewalk
%dir %{_datadir}/spacewalk/setup
%dir %{_datadir}/spacewalk/setup/defaults.d
%endif

%files postgresql
%{_datadir}/spacewalk/setup/defaults.d/postgresql-backend.conf
%if 0%{?rhel}
%{_bindir}/initdb
%endif

%changelog
1 change: 0 additions & 1 deletion spacewalk/setup/Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ WriteMakefile(
ABSTRACT_FROM => 'lib/Spacewalk/Setup.pm',
PL_FILES => {},
EXE_FILES => ['bin/spacewalk-setup',
'bin/spacewalk-make-mount-points',
'bin/spacewalk-setup-cobbler',
'bin/spacewalk-setup-httpd'],
PREREQ_PM => {
Expand Down
92 changes: 0 additions & 92 deletions spacewalk/setup/bin/spacewalk-make-mount-points

This file was deleted.

Loading

0 comments on commit 44145bb

Please sign in to comment.