-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtemplate.service
More file actions
29 lines (22 loc) · 856 Bytes
/
template.service
File metadata and controls
29 lines (22 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#---------------------------------------------
# Copyright Phoenix Contact GmbH & Co. KG
#---------------------------------------------
[Unit]
Description=VPLCNEXTCONTROL CONTAINER
After=network.target
[Service]
Type=simple
ExecStartPre=-apparmor_parser -r "/etc/apparmor.d/containers/<APPARMOR_PROFILE>"
ExecStart=+podman start -a <CONTAINER_NAME>
ExecStartPost=+bash -c "until [ \"$(podman inspect -f '{{.State.Status}}' \"<CONTAINER_NAME>\" )\" = \"running\" ]; do sleep 1; done"
ExecStartPost=+podman container inspect -f '{{range $key,$value := .NetworkSettings.Networks}}Network:"{{$key}}" IP-Address:"{{$value.IPAddress}}"\n{{end}}' "<CONTAINER_NAME>"
ExecStop=+podman stop <CONTAINER_NAME>
TimeoutStartSec=60
TimeoutStopSec=65
KillSignal=SIGTERM
KillMode=process
Restart=on-failure
# Increase
RestartSec=10
[Install]
WantedBy=default.target