summaryrefslogtreecommitdiffstats
path: root/playbooks/adhoc/deploy_monitoring_containers/oso-f22-host-monitoring.service
blob: 852be09b6a2ea1a2f91f817def0c964ed077562f (plain)
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
30
31
32
33
34
35
36
# This is a systemd file to run this docker container under systemd.
# To make this work:
#  * pull the image (probably from ops docker registry)
#  * place this file in /etc/systemd/system without the .systemd extension
#  * run the commands:
#  systemctl daemon-reload
#  systemctl enable pcp-docker
#  systemctl start pcp-docker
#
#
[Unit]
Description=PCP Collector Contatainer
Requires=docker.service
After=docker.service


[Service]
Type=simple
TimeoutStartSec=5m
#Slice=container-small.slice

ExecStartPre=-/usr/bin/docker rm "oso-f22-host-monitoring"

ExecStart=/usr/bin/docker run --rm  --name=oso-f22-host-monitoring            \
          --privileged --net=host --pid=host --ipc=host                       \
          -v /sys:/sys:ro  -v /etc/localtime:/etc/localtime:ro                \
          -v /var/lib/docker:/var/lib/docker:ro -v /run:/run                  \
          -v /var/log:/var/log                                                \
          docker-registry.ops.rhcloud.com/ops/oso-f22-host-monitoring

ExecReload=-/usr/bin/docker stop "oso-f22-host-monitoring"
ExecReload=-/usr/bin/docker rm "oso-f22-host-monitoring"
ExecStop=-/usr/bin/docker stop "oso-f22-host-monitoring"

[Install]
WantedBy=default.target