Skip to content

Commit d991fc7

Browse files
committed
Add: feature to gracefully shutdown/wake kafka
sleep_hook is called both before suspend and after system wakes up from suspend. Before suspend, it stops Zookeeper, broker, mirror services along with all the logging services. After waking up, it restarts everything.
1 parent 19f4c1d commit d991fc7

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

misc/sleep_hook.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh
2+
3+
if [ "${1}" == "pre" ]; then
4+
# Do the thing you want before suspend here, e.g.:
5+
systemctl stop mirror
6+
systemctl stop zookeeper
7+
systemctl stop gps-log@remote
8+
systemctl stop gps-log@gps
9+
sync
10+
elif [ "${1}" == "post" ]; then
11+
# Do the thing you want after resume here, e.g.:
12+
systemctl restart zookeeper
13+
systemctl restart mirror
14+
systemctl restart gps-log@remote
15+
systemctl restart gps-log@gps
16+
systemctl restart gps-log-watchdog
17+
fi

0 commit comments

Comments
 (0)