Skip to content

Commit d0b12c3

Browse files
authored
Merge pull request #819 from aaannz/healthy_notify
Notify systemd only once db and server containers are healthy (bsc#1263823)
2 parents c6af85a + 20f1925 commit d0b12c3

5 files changed

Lines changed: 18 additions & 15 deletions

File tree

mgradm/shared/templates/pgsqlServiceTemplate.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import (
1111
"github.com/uyuni-project/uyuni-tools/shared/types"
1212
)
1313

14-
const pgsqlServiceTemplate = `# uyuni-db-server.service, generated by mgradm
15-
# Use an uyuni-db-server.service.d/local.conf file to override
14+
const pgsqlServiceTemplate = `# uyuni-db.service, generated by mgradm
15+
# Use an uyuni-db.service.d/local.conf file to override
1616
1717
[Unit]
1818
Description=Uyuni database container service
@@ -33,8 +33,7 @@ ExecStart=/bin/sh -c '/usr/bin/podman run \
3333
--cgroups=no-conmon \
3434
--shm-size=0 \
3535
--shm-size-systemd=0 \
36-
--sdnotify=conmon \
37-
-d \
36+
--sdnotify=healthy \
3837
--name {{ .NamePrefix }}-db \
3938
--hostname {{ .NamePrefix }}-db.mgr.internal \
4039
--network-alias db \
@@ -68,7 +67,8 @@ ExecStopPost=/usr/bin/podman rm \
6867
PIDFile=%t/%n.pid
6968
TimeoutStopSec=180
7069
TimeoutStartSec=900
71-
Type=forking
70+
Type=notify
71+
NotifyAccess=all
7272
7373
[Install]
7474
WantedBy=multi-user.target default.target

mgradm/shared/templates/serviceTemplate.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ ExecStart=/bin/sh -c '/usr/bin/podman run \
3131
--cgroups=no-conmon \
3232
--shm-size=0 \
3333
--shm-size-systemd=0 \
34-
--sdnotify=conmon \
34+
--sdnotify=healthy \
3535
--systemd=always \
36-
-d \
3736
--name {{ .NamePrefix }}-server \
3837
--hostname {{ .NamePrefix }}-server.mgr.internal \
3938
{{ .Args }} \
@@ -87,7 +86,8 @@ ExecStopPost=/usr/bin/podman rm \
8786
PIDFile=%t/uyuni-server.pid
8887
TimeoutStopSec=180
8988
TimeoutStartSec=900
90-
Type=forking
89+
Type=notify
90+
NotifyAccess=all
9191
9292
[Install]
9393
WantedBy=multi-user.target default.target

mgradm/shared/templates/templates_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,8 @@ ExecStart=/bin/sh -c '/usr/bin/podman run \
115115
--cgroups=no-conmon \
116116
--shm-size=0 \
117117
--shm-size-systemd=0 \
118-
--sdnotify=conmon \
118+
--sdnotify=healthy \
119119
--systemd=always \
120-
-d \
121120
--name uyuni-server \
122121
--hostname uyuni-server.mgr.internal \
123122
--arg value \
@@ -159,7 +158,8 @@ ExecStopPost=/usr/bin/podman rm \
159158
PIDFile=%t/uyuni-server.pid
160159
TimeoutStopSec=180
161160
TimeoutStartSec=900
162-
Type=forking
161+
Type=notify
162+
NotifyAccess=all
163163
164164
[Install]
165165
WantedBy=multi-user.target default.target
@@ -203,9 +203,8 @@ ExecStart=/bin/sh -c '/usr/bin/podman run \
203203
--cgroups=no-conmon \
204204
--shm-size=0 \
205205
--shm-size-systemd=0 \
206-
--sdnotify=conmon \
206+
--sdnotify=healthy \
207207
--systemd=always \
208-
-d \
209208
--name uyuni-server \
210209
--hostname uyuni-server.mgr.internal \
211210
--arg value \
@@ -239,7 +238,8 @@ ExecStopPost=/usr/bin/podman rm \
239238
PIDFile=%t/uyuni-server.pid
240239
TimeoutStopSec=180
241240
TimeoutStartSec=900
242-
Type=forking
241+
Type=notify
242+
NotifyAccess=all
243243
244244
[Install]
245245
WantedBy=multi-user.target default.target
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- Require at least podman v4.7.2
2+
- Send READY notification to systemd only once healthy
3+
(bsc#1263823)

uyuni-tools.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Requires: (netavark if podman)
116116
Requires: openssl
117117
# suse_version
118118
%if "%{_vendor}" != "debbuild"
119-
Requires: (podman >= 4.5.0 if podman)
119+
Requires: (podman >= 4.7.2 if podman)
120120
%endif
121121

122122
%description -n %{name_adm}

0 commit comments

Comments
 (0)