| 1 |
# Serf Agent (systemd service unit) |
| 2 |
[Unit] |
| 3 |
Description=Serf Agent |
| 4 |
After=network.target |
| 5 |
|
| 6 |
[Service] |
| 7 |
Type=simple |
| 8 |
# Ensure the configuration directory exists. |
| 9 |
ExecStartPre=/usr/bin/install -d -g root -o root /etc/serf/ |
| 10 |
ExecStart=/usr/bin/serf agent -config-dir=/etc/serf/ |
| 11 |
# Use SIGINT instead of SIGTERM so serf can depart the cluster. |
| 12 |
KillSignal=SIGINT |
| 13 |
# Restart on success, failure, and any emitted signals like HUP. |
| 14 |
Restart=always |
| 15 |
# Wait ten seconds before respawn attempts. |
| 16 |
RestartSec=10 |
| 17 |
|
| 18 |
[Install] |
| 19 |
WantedBy=multi-user.target |