feat: Restart salt-master on config changes
Automatically restart salt-master when config changes are detected.
This commit is contained in:
17
assets/sbin/config-reloader
Executable file
17
assets/sbin/config-reloader
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
# shellcheck source=assets/runtime/functions.sh
|
||||
FUNCTIONS_FILE="${SALT_RUNTIME_DIR}/functions.sh"
|
||||
source "${FUNCTIONS_FILE}"
|
||||
|
||||
function check_for_config_changes()
|
||||
{
|
||||
inotifywait -qq --recursive \
|
||||
--event modify,move,create,delete \
|
||||
"${SALT_CONFS_DIR}"
|
||||
}
|
||||
|
||||
while check_for_config_changes; do
|
||||
log_info "Configuration changes detected. Reloading salt-master ..."
|
||||
supervisorctl restart salt-master
|
||||
done
|
||||
Reference in New Issue
Block a user