Created
February 6, 2015 01:00
-
-
Save sukrit007/574bfb21fea7bdf1711f to your computer and use it in GitHub Desktop.
Systemd Reload Hack for Fleet
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=Systemd Reload Hack for coreos fleet | |
After=fleet.service | |
[Service] | |
Restart=always | |
RestartSec=20s | |
ExecStart=/bin/bash -c "while true; do if systemctl -all list-units | grep -e '@.*not-found.*inactive.*dead.*'; then systemctl daemon-reload; fi; systemctl -all list-units | grep '@[0-9].*loaded.*inactive.*dead.*' | awk '{print $1}' | xargs systemctl restart; sleep 120s; done" |
Love this. Not exactly what we need here, though, for two reasons (which I'm listing in case others come here looking):
- It only works with templated service files. Global services, or single-host services managed by fleet don't get any love.
- It doesn't understand timer unit files (whose associated service files are usually inactive/dead).
I've got fixes in test for both of these issues; I'll post my changes to my own Gist on (likely) Mar 25, 2015.
And that gist is up, if anybody else needs help. https://gist.github.com/scole-scea/177a367c51d0b93d51f6
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hack to address : coreos/fleet#1079
USE AT YOUR OWN RISK. Feel free to customize.