-
-
Save mailinglists35/11a6c3fbeac73bf0ca469217bcfc0b7c to your computer and use it in GitHub Desktop.
Systemd ping daemon
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
[root@stage ~]# cat /etc/systemd/system/ping@.service | |
[Unit] | |
Description=One time ping check of host %I | |
After=network.target | |
[Service] | |
Type=forking #forking makes the unit stay in starting state until ping finishes. oneshot does not work with RemainAfterExit, while type simple makes the unit started as soon as ping starts, which is something we DON'T want | |
Restart=on-failure | |
ExecStart=/bin/ping -q -c 5 %i | |
RemainAfterExit=true | |
[Install] | |
WantedBy=multi-user.target | |
# | |
systemctl enable ping@remotehost | |
# | |
systemctl edit --full some-service-that-needs-external-connectivity | |
After=ping@remotehost | |
Requires=ping@remotehost |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment