Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Problem: pulp 3 can't be installed along with pulp 2 #98

Merged
merged 1 commit into from Jun 11, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 13 additions & 10 deletions packages/pulp/pulp.spec
Expand Up @@ -473,29 +473,31 @@ Pulp provides replication, access, and accounting for software repositories.
%defattr(-,root,root,-)
%{_usr}/lib/tmpfiles.d/
%endif
# 640 root:apache
%defattr(640,root,apache,-)
# 640 root:pulp
%defattr(640,root,pulp,-)
dkliban marked this conversation as resolved.
Show resolved Hide resolved
%ghost %{_sysconfdir}/pki/%{name}/ca.key
%ghost %{_sysconfdir}/pki/%{name}/ca.crt
%ghost %{_sysconfdir}/pki/%{name}/rsa.key
%ghost %{_sysconfdir}/pki/%{name}/rsa_pub.key
%config(noreplace) %{_sysconfdir}/%{name}/server.conf
# - apache:apache
%defattr(-,apache,apache,-)
# - apache:pulp
%defattr(-,apache,pulp,-)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dkliban , would you mind changing comments above those changes to reflect them?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't mind at all

%dir %{_var}/lib/%{name}
%{_var}/lib/%{name}/published
%{_var}/lib/%{name}/static
%{_var}/lib/%{name}/uploads
%{_var}/www/pub
%{_var}/cache/%{name}/
%{_var}/run/%{name}/
%defattr(640,apache,apache,750)
%defattr(640,apache,pulp,750)
%dir %{_var}/log/%{name}
# Install the docs
%defattr(-,root,root,-)
%doc README LICENSE COPYRIGHT

%pre server
/usr/sbin/groupadd -f pulp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://fedoraproject.org/wiki/Packaging:UsersAndGroups#Dynamic_allocation suggests to first check if the group exists. You should also add a Requires(pre): shadow-utils

/usr/sbin/usermod -a -G pulp apache
# If we are upgrading
if [ $1 -gt 1 ] ; then
%if %{pulp_systemd} == 1
Expand All @@ -507,6 +509,7 @@ if [ $1 -gt 1 ] ; then
/sbin/service pulp_celerybeat stop > /dev/null 2>&1 || :
/sbin/service pulp_resource_manager stop > /dev/null 2>&1 || :
%endif
/usr/bin/chown -R apache:pulp /var/lib/pulp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to run on every upgrade which might become very slow if there's a lot files. Perhaps you should check if the user/group of /var/lib/pulp is already correct and otherwise recurse?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ekohl, thank you for the recommendation. I'll make a follow up PR.

fi

%preun server
Expand Down Expand Up @@ -548,7 +551,7 @@ Pulp nodes common modules.
%{python_sitelib}/pulp_node/extensions/__init__.py*
%{python_sitelib}/pulp_node/*.py*
%{python_sitelib}/pulp_node_common*.egg-info
%defattr(640,root,apache,-)
%defattr(640,root,pulp,-)
%ghost %{_sysconfdir}/pki/pulp/nodes/node.crt
# The nodes.conf file contains OAuth secrets, so we don't want it to be world readable
%config(noreplace) %{_sysconfdir}/pulp/nodes.conf
Expand All @@ -573,7 +576,7 @@ Pulp parent nodes support.
%{python_sitelib}/pulp_node/profilers/
%{python_sitelib}/pulp_node/distributors/
%{python_sitelib}/pulp_node_parent*.egg-info
%defattr(-,apache,apache,-)
%defattr(-,apache,pulp,-)
%{_var}/lib/pulp/nodes
%{_var}/www/pulp/nodes
%defattr(-,root,root,-)
Expand Down Expand Up @@ -601,7 +604,7 @@ Pulp child nodes support.
%{python_sitelib}/pulp_node_child*.egg-info
%{_usr}/lib/pulp/plugins/types/nodes.json
%{_sysconfdir}/pulp/agent/conf.d/nodes.conf
%defattr(640,root,apache,-)
%defattr(640,root,pulp,-)
# We don't want the importer config to be world readable, since it can contain proxy passwords
%{_sysconfdir}/pulp/server/plugins.conf.d/nodes/importer/*
%defattr(-,root,root,-)
Expand Down Expand Up @@ -704,8 +707,8 @@ The streamer component of the Pulp Lazy Sync feature.
%defattr(-,root,root,-)
%{_usr}/lib/systemd/system/pulp_streamer.service
%endif
# - apache:apache
%defattr(-,apache,apache,-)
# - apache:pulp
%defattr(-,apache,pulp,-)
%{_var}/www/streamer

# Uninstall scriptlet
Expand Down