mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
(cherry picked from commit bdc435c392)
Co-authored-by: Mohd Husaam Mehdi <husaam.mehdi@iopsys.eu>
14 lines
375 B
Bash
14 lines
375 B
Bash
#!/bin/sh
|
|
# This hotplug script reloads fluent-bit, so that kmsg logs' timestamp gets in sync
|
|
|
|
[ "$ACTION" = stratum ] || exit 0
|
|
|
|
# only once
|
|
if ! uci -q get time.global.first_use_date > /dev/null 2>&1; then
|
|
flb_pid="$(pidof fluent-bit)"
|
|
|
|
if [ -n "$flb_pid" ]; then
|
|
logger -t "logmngr.hotplug" -p info "reload fluent-bit due to ntp sync"
|
|
kill -SIGHUP "$flb_pid"
|
|
fi
|
|
fi
|