Skip to content

Commit 4f253dc

Browse files
committed
feat: adde cron and workers
1 parent 6198552 commit 4f253dc

3 files changed

Lines changed: 92 additions & 2 deletions

File tree

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#
2+
# Copyright (C) 2022 Nethesis S.r.l.
3+
# SPDX-License-Identifier: GPL-3.0-or-later
4+
#
5+
6+
[Unit]
7+
Description=Podman mautic-cron-app.service
8+
BindsTo=mautic.service
9+
After=mautic.service mariadb-app.service
10+
11+
[Service]
12+
Environment=PODMAN_SYSTEMD_UNIT=%n
13+
EnvironmentFile=%S/state/environment
14+
EnvironmentFile=-%S/state/smarthost.env
15+
EnvironmentFile=-%S/state/app.env
16+
EnvironmentFile=-%S/state/mautic.env
17+
WorkingDirectory=%S/state
18+
Restart=always
19+
TimeoutStopSec=70
20+
ExecStartPre=/bin/mkdir -p tmp
21+
ExecStartPre=/bin/rm -f %t/mautic-cron-app.pid %t/mautic-cron-app.ctr-id
22+
ExecStartPre=-runagent discover-smarthost
23+
ExecStart=/usr/bin/podman run --conmon-pidfile %t/mautic-cron-app.pid \
24+
--cidfile %t/mautic-cron-app.ctr-id --cgroups=no-conmon \
25+
--pod-id-file %t/mautic.pod-id --replace -d --name mautic-cron-app \
26+
--volume mautic-config:/var/www/html/config:z \
27+
--volume mautic-logs:/var/www/html/var/logs:z \
28+
--volume mautic-files:/var/www/html/docroot/media/files:z \
29+
--volume mautic-images:/var/www/html/docroot/media/images:z \
30+
--volume mautic-cron:/opt/mautic/cron:z \
31+
--volume %S/bin/install:/install:z \
32+
--env-file=%S/state/app.env \
33+
--env-file=%S/state/mautic.env \
34+
--env DOCKER_MAUTIC_ROLE=mautic_cron \
35+
${MAUTIC_IMAGE}
36+
# ExecStartPost=/usr/bin/podman exec mautic-cron-app /bin/bash -c "/install"
37+
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/mautic-cron-app.ctr-id -t 10
38+
ExecReload=/usr/bin/podman kill -s HUP mautic-cron-app
39+
SyslogIdentifier=%u
40+
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/mautic-cron-app.ctr-id
41+
PIDFile=%t/mautic-cron-app.pid
42+
Type=forking
43+
44+
[Install]
45+
WantedBy=default.target
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#
2+
# Copyright (C) 2022 Nethesis S.r.l.
3+
# SPDX-License-Identifier: GPL-3.0-or-later
4+
#
5+
6+
[Unit]
7+
Description=Podman mautic-worker-app.service
8+
BindsTo=mautic.service
9+
After=mautic.service mariadb-app.service
10+
11+
[Service]
12+
Environment=PODMAN_SYSTEMD_UNIT=%n
13+
EnvironmentFile=%S/state/environment
14+
EnvironmentFile=-%S/state/smarthost.env
15+
EnvironmentFile=-%S/state/app.env
16+
EnvironmentFile=-%S/state/mautic.env
17+
WorkingDirectory=%S/state
18+
Restart=always
19+
TimeoutStopSec=70
20+
ExecStartPre=/bin/mkdir -p tmp
21+
ExecStartPre=/bin/rm -f %t/mautic-worker-app.pid %t/mautic-worker-app.ctr-id
22+
ExecStartPre=-runagent discover-smarthost
23+
ExecStart=/usr/bin/podman run --conmon-pidfile %t/mautic-worker-app.pid \
24+
--cidfile %t/mautic-worker-app.ctr-id --cgroups=no-conmon \
25+
--pod-id-file %t/mautic.pod-id --replace -d --name mautic-worker-app \
26+
--volume mautic-config:/var/www/html/config:z \
27+
--volume mautic-logs:/var/www/html/var/logs:z \
28+
--volume mautic-files:/var/www/html/docroot/media/files:z \
29+
--volume mautic-images:/var/www/html/docroot/media/images:z \
30+
--volume mautic-cron:/opt/mautic/cron:z \
31+
--volume %S/bin/install:/install:z \
32+
--env-file=%S/state/app.env \
33+
--env-file=%S/state/mautic.env \
34+
--env DOCKER_MAUTIC_ROLE=mautic_worker \
35+
${MAUTIC_IMAGE}
36+
# ExecStartPost=/usr/bin/podman exec mautic-worker-app /bin/bash -c "/install"
37+
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/mautic-worker-app.ctr-id -t 10
38+
ExecReload=/usr/bin/podman kill -s HUP mautic-worker-app
39+
SyslogIdentifier=%u
40+
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/mautic-worker-app.ctr-id
41+
PIDFile=%t/mautic-worker-app.pid
42+
Type=forking
43+
44+
[Install]
45+
WantedBy=default.target

imageroot/systemd/user/mautic.service

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
[Unit]
1212
Description=Podman mautic.service
13-
Requires=mariadb-app.service mautic-app.service
14-
Before=mariadb-app.service mautic-app.service
13+
Requires=mariadb-app.service mautic-app.service mautic-cron-app.service mautic-worker-app.service
14+
Before=mariadb-app.service mautic-app.service mautic-cron-app.service mautic-worker-app.service
1515

1616
[Service]
1717
Environment=PODMAN_SYSTEMD_UNIT=%n

0 commit comments

Comments
 (0)