Skip to content

Adjustments for running hub in non-priv/non-systemd container #1718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packaging/cfengine-nova-hub/cfengine-nova-hub.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ Url: https://cfengine.com
BuildRoot: %{_topdir}/%{name}-%{version}-%{release}-buildroot
Obsoletes: cfengine3 < @@VERSION@@, cf-community < @@VERSION@@
Requires: coreutils

# installation scriptlets need hostname command, not present in UBI container images
Requires: hostname

# "Recommends" is only supported on RHEL 8+
%if %{?rhel}%{!?rhel:0} >= 8
Recommends: gzip
Expand Down
4 changes: 2 additions & 2 deletions packaging/common/cfengine-hub/postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ systemctl restart cfengine3"
fi
fi

if [ -x /bin/systemctl ]; then
if command -v systemctl 2>/dev/null && systemctl is-system-running; then
# This is important in case any of the units have been replaced by the package
# and we call them in the postinstall script.
if ! /bin/systemctl daemon-reload; then
Expand Down Expand Up @@ -1066,7 +1066,7 @@ chmod g+rX "$PREFIX/httpd/php"
# Register CFEngine initscript, if not yet.
#
if ! is_upgrade; then
if [ -x /bin/systemctl ]; then
if command -v systemctl 2>/dev/null && systemctl is-system-running; then
# Reload systemd config to pick up newly installed units
/bin/systemctl daemon-reload > /dev/null 2>&1
# Enable cfengine3 service (starts all the other services)
Expand Down
4 changes: 2 additions & 2 deletions packaging/common/cfengine-non-hub/postinstall.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if [ -x /bin/systemctl ]; then
if command -v systemctl 2>/dev/null && systemctl is-system-running; then
# This is important in case any of the units have been replaced by the package
# and we call them in the postinstall script.
if ! /bin/systemctl daemon-reload; then
Expand Down Expand Up @@ -68,7 +68,7 @@ case `os_type` in
#
# Register CFEngine initscript, if not yet.
#
if [ -x /bin/systemctl ]; then
if command -v systemctl 2>/dev/null && systemctl is-system-running; then
# Reload systemd config to pick up newly installed units
/bin/systemctl daemon-reload > /dev/null 2>&1
# Enable cfengine3 service (starts all the other services)
Expand Down