generated from NethServer/ns8-kickstart
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add systemd unit for sogo, mariadb-app, sogo-app
- Loading branch information
Showing
3 changed files
with
96 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# | ||
# Copyright (C) 2023 Nethesis S.r.l. | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
# | ||
|
||
[Unit] | ||
Description=Podman mariadb-app.service | ||
BindsTo=sogo.service | ||
After=sogo.service | ||
|
||
[Service] | ||
Environment=PODMAN_SYSTEMD_UNIT=%n | ||
EnvironmentFile=%S/state/environment | ||
Restart=always | ||
TimeoutStopSec=70 | ||
ExecStartPre=/bin/rm -f %t/mariadb-app.pid %t/mariadb-app.ctr-id | ||
ExecStart=/usr/bin/podman run --conmon-pidfile %t/mariadb-app.pid \ | ||
--cidfile %t/mariadb-app.ctr-id --cgroups=no-conmon \ | ||
--pod-id-file %t/sogo.pod-id --replace -d --name mariadb-app \ | ||
--env-file=%S/state/environment \ | ||
--volume mysql-data:/var/lib/mysql/:Z \ | ||
--env MARIADB_ROOT_PASSWORD=Nethesis,1234 \ | ||
--env MARIADB_DATABASE=sogo \ | ||
--env MARIADB_USER=sogo \ | ||
--env MARIADB_PASSWORD=Nethesis,1234 \ | ||
--env MARIADB_AUTO_UPGRADE=1 \ | ||
${MARIADB_IMAGE} \ | ||
--character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci | ||
ExecStartPost=/usr/bin/podman exec mariadb-app /bin/bash -c 'printf "[client] \npassword=Nethesis,1234" > /root/.my.cnf' | ||
ExecStartPost=/usr/bin/podman exec mariadb-app /bin/bash -c "while ! mysqladmin ping -h localhost -P 3306 -u root; do sleep 1; done" | ||
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/mariadb-app.ctr-id -t 10 | ||
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/mariadb-app.ctr-id | ||
ExecReload=/usr/bin/podman kill -s HUP mariadb-app | ||
SyslogIdentifier=%u | ||
PIDFile=%t/mariadb-app.pid | ||
Type=forking | ||
|
||
[Install] | ||
WantedBy=default.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# | ||
# Copyright (C) 2023 Nethesis S.r.l. | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
# | ||
|
||
[Unit] | ||
Description=Podman sogo-app.service | ||
BindsTo=sogo.service | ||
After=sogo.service mariadb-app.service | ||
|
||
[Service] | ||
Environment=PODMAN_SYSTEMD_UNIT=%n | ||
EnvironmentFile=%S/state/environment | ||
EnvironmentFile=-%S/state/discovery.env | ||
WorkingDirectory=%S/state | ||
Restart=always | ||
TimeoutStopSec=70 | ||
ExecStartPre=/bin/mkdir -p config | ||
ExecStartPre=/bin/rm -f %t/sogo-app.pid %t/sogo-app.ctr-id | ||
ExecStartPre=runagent discover-ldap | ||
ExecStartPre=/usr/local/bin/runagent discover-service | ||
ExecStart=/usr/bin/podman run --conmon-pidfile %t/sogo-app.pid \ | ||
--cidfile %t/sogo-app.ctr-id --cgroups=no-conmon \ | ||
--pod-id-file %t/sogo.pod-id --replace -d --name sogo-app \ | ||
--volume ./config:/etc/sogo:Z \ | ||
--env=sogo_* \ | ||
--env sogo_DB_TYPE=mysql \ | ||
--env sogo_DB_HOST=127.0.0.1 \ | ||
--env sogo_DB_PORT=3306 \ | ||
--env sogo_DB_USER=sogo \ | ||
--env sogo_DB_PASSWORD=Nethesis,1234 \ | ||
--env sogo_DB_NAME=sogo \ | ||
${sogo_IMAGE} | ||
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/sogo-app.ctr-id -t 10 | ||
ExecReload=/usr/bin/podman kill -s HUP sogo-app | ||
SyslogIdentifier=%u | ||
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/sogo-app.ctr-id | ||
PIDFile=%t/sogo-app.pid | ||
Type=forking | ||
|
||
[Install] | ||
WantedBy=default.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters