Skip to content

Commit b9bf262

Browse files
committed
spec: fix for leap container installation
service enablement is tied to check if systemd booted. Signed-off-by: Sayan Paul <paul.sayan@gmail.com>
1 parent bd36633 commit b9bf262

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

greenboot-rs.spec

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ automated rollback actions if it's not.
3434

3535
%package -n %{pkgname}
3636
Summary: %{summary}
37-
%{?systemd_requires}
37+
%{?systemd_ordering}
3838
Requires: systemd >= 240
3939
Requires: rpm-ostree
4040
Requires: pam >= 1.4.0
@@ -101,19 +101,19 @@ install -DpZm 0755 usr/lib/greenboot/check/wanted.d/* %{buildroot}%{_prefix}/lib
101101
install -DpZm 0644 usr/lib/systemd/system/greenboot-healthcheck.service.d/10-network-online.conf %{buildroot}%{_unitdir}/greenboot-healthcheck.service.d/10-network-online.conf
102102

103103
%post -n %{pkgname}
104-
%systemd_post greenboot-healthcheck.service
105-
%systemd_post greenboot-set-rollback-trigger.service
106-
%systemd_post greenboot-success.target
104+
if [ -d /run/systemd/system ]; then
105+
systemctl --no-reload preset greenboot-healthcheck.service greenboot-set-rollback-trigger.service greenboot-success.target &>/dev/null || :
106+
fi
107107

108108
%preun -n %{pkgname}
109-
%systemd_preun greenboot-healthcheck.service
110-
%systemd_preun greenboot-set-rollback-trigger.service
111-
%systemd_preun greenboot-success.target
109+
if [ -d /run/systemd/system ]; then
110+
systemctl --no-reload disable --now greenboot-healthcheck.service greenboot-set-rollback-trigger.service greenboot-success.target &>/dev/null || :
111+
fi
112112

113113
%postun -n %{pkgname}
114-
%systemd_postun greenboot-healthcheck.service
115-
%systemd_postun greenboot-set-rollback-trigger.service
116-
%systemd_postun greenboot-success.target
114+
if [ -d /run/systemd/system ]; then
115+
systemctl daemon-reload &>/dev/null || :
116+
fi
117117

118118
%files -n %{pkgname}
119119
%license LICENSE LICENSE.dependencies

0 commit comments

Comments
 (0)