Created
April 10, 2019 05:30
-
-
Save rav94/3da6ca92d14c394ac9c85f87aa6a79c4 to your computer and use it in GitHub Desktop.
Filebeat Systemd Unit File
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
[Unit] | |
Description=Filebeat Docker Service | |
After=docker.service | |
Requires=docker.service | |
[Service] | |
Type=simple | |
User=root | |
TimeoutStartSec=0 | |
Restart=on-failure | |
ExecStartPre=-/usr/bin/docker kill filebeat | |
ExecStartPre=-/usr/bin/docker rm -f filebeat | |
ExecStartPre=-/usr/bin/docker pull ${YOUR_FILEBEAT_DOCKER_IMAGE}:latest | |
ExecStartPre=-/bin/sh -c "/bin/docker rmi $(docker images --quiet --filter 'dangling=true')" | |
ExecStart=/usr/bin/docker run -v '/var/lib/docker/containers:/usr/share/dockerlogs/data:ro' -v '/var/run/docker.sock:/var/run/docker.sock' --name filebeat ${YOUR_FILEBEAT_DOCKER_IMAGE}:latest | |
ExecStop=/usr/bin/docker stop filebeat | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment