cinder: cleanup spec file

- cleanup service files
  * add Group, PrivateTmp and WorkingDirectory
  * move ExecPreStart to the correct file section
- Remove unneeded (for python3) enum34 dependency
- Package missing resource_filter.json file
- fix ownership of /var/lib/cinder

Change-Id: Iaa9b46d5119dada80d3bb370c637a2641dfde529
This commit is contained in:
Ralf Haferkamp 2019-08-29 11:44:57 +02:00
parent 85d1cdef3a
commit 28ca946f6f
7 changed files with 16 additions and 6 deletions

View File

@ -20,8 +20,8 @@ Source2: openstack-cinder-api.service
Source3: openstack-cinder-scheduler.service
Source4: openstack-cinder-volume.service
Source5: openstack-cinder-backup.service
Source6: %{service}-sudoers
Source7: %{service}.tmpfiles
Source6: openstack-cinder-sudoers
Source7: openstack-cinder.tmpfiles
Source50: openstack-cinder.README.config
BuildRequires: openstack-macros
BuildRequires: {{ py3('PyMySQL') }}
@ -108,7 +108,6 @@ Requires: {{ py3('cryptography') }}
Requires: {{ py3('cursive') }}
Requires: {{ py3('decorator') }}
Requires: {{ py3('defusedxml') }}
Requires: {{ py3('enum34') }}
Requires: {{ py3('eventlet') }}
Requires: {{ py3('python-glanceclient') }}
Requires: {{ py3('google-api-python-client') }}
@ -266,7 +265,7 @@ install -D -m 644 %{SOURCE7} %{buildroot}/%_tmpfilesdir/%name.conf
# install config files
install -d -m 755 %{buildroot}%{_sysconfdir}/%{service}
install -p -D -m 644 etc/%{service}/{cinder.conf,api-paste.ini,policy.json,rootwrap.conf} %{buildroot}%{_sysconfdir}/%{service}/
install -p -D -m 644 etc/%{service}/{cinder.conf,api-paste.ini,policy.json,resource_filters.json,rootwrap.conf} %{buildroot}%{_sysconfdir}/%{service}/
cp -a etc/cinder/rootwrap.d/ %{buildroot}%{_sysconfdir}/%{service}/
install -p -D -m 640 %{SOURCE50} %{buildroot}%{_sysconfdir}/%{service}/README.config
@ -352,10 +351,11 @@ stestr run
%config(noreplace) %{_sysconfdir}/logrotate.d/openstack-%{service}
%config(noreplace) %{_sysconfdir}/sudoers.d/openstack-%{service}
%config(noreplace) %{_sysconfdir}/%{service}/policy.json
%config(noreplace) %{_sysconfdir}/%{service}/resource_filters.json
%_tmpfilesdir/%name.conf
%dir %attr(0750, %{service}, root) %{_sysconfdir}/%{service}/rootwrap.d/
%dir %attr(0750, %{service}, root) %{_localstatedir}/log/%{service}
%dir %{_localstatedir}/lib/%{service}
%dir %attr(0750, %{service}, root) %{_localstatedir}/lib/%{service}
%{_bindir}/{{ pypi_name }}-manage
%{_bindir}/{{ pypi_name }}-rootwrap
%{_bindir}/{{ pypi_name }}-rtstool

View File

@ -6,10 +6,12 @@ After=syslog.target network.target
Type=notify
User=cinder
Group=cinder
WorkingDirectory=/var/lib/cinder
PrivateTmp=yes
ExecStartPre=-/usr/bin/cinder-manage db sync
ExecStart=/usr/bin/cinder-api
Restart=on-failure
KillMode=process
[Install]
WantedBy=multi-user.target
ExecStartPre=-/usr/bin/cinder-manage db sync

View File

@ -5,6 +5,8 @@ After=syslog.target network.target
[Service]
Type=notify
User=cinder
Group=cinder
WorkingDirectory=/var/lib/cinder
ExecStart=/usr/bin/cinder-backup
Restart=on-failure

View File

@ -5,6 +5,9 @@ After=syslog.target network.target
[Service]
Type=notify
User=cinder
Group=cinder
WorkingDirectory=/var/lib/cinder
PrivateTmp=yes
ExecStart=/usr/bin/cinder-scheduler
Restart=on-failure

View File

@ -8,6 +8,9 @@ LimitNPROC=131072
TasksMax=infinity
Type=notify
User=cinder
Group=cinder
WorkingDirectory=/var/lib/cinder
PrivateTmp=yes
ExecStart=/usr/bin/cinder-volume
Restart=on-failure
KillMode=process