Skip to content

Commit 5eda683

Browse files
authored
Merge pull request #2014 from craigcomstock/ENT-13319
Fixed packaging to handle cf-php-fpm sysvinit script properly for client and hub
2 parents 5137ce5 + 9fa6875 commit 5eda683

File tree

5 files changed

+22
-9
lines changed

5 files changed

+22
-9
lines changed

packaging/cfengine-community/cfengine-community.spec.in

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,11 @@ rm -f $RPM_BUILD_ROOT%{prefix}/bin/curl
6363
rm -f $RPM_BUILD_ROOT%{prefix}/bin/wcurl
6464
rm -rf $RPM_BUILD_ROOT%{prefix}/ssl
6565

66-
# For el9+ and suse-15+ we started seeing issues from other packages not expecting init scripts
67-
%if %{?rhel}%{!?rhel:0} >= 9 || %{?suse_version}%{!?suse_version:0} >= 1500
66+
# For el8+ and suse-15+ we started seeing issues from other packages not expecting init scripts
67+
%if %{?rhel}%{!?rhel:0} >= 8 || %{?suse_version}%{!?suse_version:0} >= 1500
6868
rm -f $RPM_BUILD_ROOT/etc/sysconfig/cfengine3
6969
rm -f $RPM_BUILD_ROOT/etc/init.d/cfengine3
70+
rm -f $RPM_BUILD_ROOT/etc/init.d/cf-php-fpm
7071
rm -f $RPM_BUILD_ROOT/etc/profile.d/cfengine3.sh
7172
%endif
7273

@@ -149,12 +150,13 @@ done
149150
%endif
150151

151152
# Globally installed configs, scripts
152-
%if %{?rhel}%{!?rhel:0} < 9 && %{?suse_version}%{!?suse_version:0} < 1500
153+
%if %{?rhel}%{!?rhel:0} < 8 && %{?suse_version}%{!?suse_version:0} < 1500
153154
%attr(644,root,root) /etc/sysconfig/cfengine3
154155
%attr(755,root,root) /etc/profile.d/cfengine3.sh
155156
# ENT-11901
156-
# For el9+ and suse15+ we started seeing issues from other packages not expecting init scripts
157+
# For el8+ and suse15+ we started seeing issues from other packages not expecting init scripts
157158
%attr(755,root,root) /etc/init.d/cfengine3
159+
%attr(755,root,root) /etc/init.d/cf-php-fpm
158160
%endif
159161

160162
# Systemd units

packaging/cfengine-nova-hub/cfengine-nova-hub.spec.in

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,12 @@ cp -a %{prefix}/* $RPM_BUILD_ROOT%{prefix}
8282
cp -a %{_basedir}/cfengine/dist/* $RPM_BUILD_ROOT
8383

8484
# ENT-11901
85-
# For el9+ we started seeing issues from other packages not expecting init scripts
86-
%if %{?rhel}%{!?rhel:0} >= 9
85+
# For el8+ we started seeing issues from other packages not expecting init scripts
86+
# If sysvinit scripts other than cfengine3 are present, such as cf-php-fpm, they will fail with systemctl operations due to not supporting chkconfig.
87+
%if %{?rhel}%{!?rhel:0} >= 8
8788
rm -f $RPM_BUILD_ROOT/etc/sysconfig/cfengine3
8889
rm -f $RPM_BUILD_ROOT/etc/init.d/cfengine3
90+
rm -f $RPM_BUILD_ROOT/etc/init.d/cf-php-fpm
8991
rm -f $RPM_BUILD_ROOT/etc/profile.d/cfengine.sh
9092
%endif
9193
# Remove useless stuff
@@ -347,9 +349,11 @@ exit 0
347349
# Initscript, other configuration
348350
%defattr(755,root,root,755)
349351
# ENT-11901
350-
# For el9+ we started seeing issues from other packages not expecting init scripts
351-
%if %{?rhel}%{!?rhel:0} < 9
352+
# For el8+ we started seeing issues from other packages not expecting init scripts
353+
# ENT-13319 we found that rhel-8 also exhibited this behavior so adjusted el9+ to el8+
354+
%if %{?rhel}%{!?rhel:0} < 8
352355
/etc/init.d/cfengine3
356+
/etc/init.d/cf-php-fpm
353357
/etc/profile.d/cfengine.sh
354358
%attr(644,root,root) /etc/sysconfig/cfengine3
355359
%endif

packaging/cfengine-nova/cfengine-nova.spec.aix.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ rm -f $RPM_BUILD_ROOT%{prefix}/bin/openssl
4242
rm -f $RPM_BUILD_ROOT%{prefix}/bin/curl
4343
rm -rf $RPM_BUILD_ROOT%{prefix}/ssl
4444

45+
# For client we never want hub-specific things
46+
rm -f $RPM_BUILD_ROOT/init.d/cf-php-fpm
47+
4548
%clean
4649
rm -rf $RPM_BUILD_ROOT
4750

packaging/cfengine-nova/cfengine-nova.spec.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ mkdir -p $RPM_BUILD_ROOT%{prefix}
5757
cp -a %{prefix}/* $RPM_BUILD_ROOT%{prefix}
5858
cp -a %{_basedir}/cfengine/dist/* $RPM_BUILD_ROOT
5959

60+
# for cfengine-nova (client) we never want cf-php-fpm service, that is only for cfengine-nova-hub
61+
rm -f $RPM_BUILD_ROOT/etc/init.d/cf-php-fpm
62+
6063
# ENT-11901
6164
# For el9+ and suse-15+ we started seeing issues from other packages not expecting init scripts
6265
%if %{?rhel}%{!?rhel:0} >= 9 || %{?suse_version}%{!?suse_version:0} >= 1500

packaging/cfengine-nova/debian/rules

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ install: build
3838
rm -f $(CURDIR)/debian/tmp$(PREFIX)/bin/openssl
3939
rm -f $(CURDIR)/debian/tmp$(PREFIX)/bin/curl
4040
rm -rf $(CURDIR)/debian/tmp$(PREFIX)/ssl
41-
41+
# remove hub-specific files
42+
rm -f $(CURDIR)/debian/tmp/etc/init.d/cf-php-fpm
4243

4344
# Debian is different
4445

0 commit comments

Comments
 (0)