trying different inotifywait command
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 49s
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 49s
This commit is contained in:
+14
-4
@@ -63,13 +63,23 @@ spec:
|
|||||||
command: ["/bin/sh", "-c"]
|
command: ["/bin/sh", "-c"]
|
||||||
args:
|
args:
|
||||||
- |
|
- |
|
||||||
|
|
||||||
apk add --no-cache inotify-tools;
|
apk add --no-cache inotify-tools;
|
||||||
echo "Watcher started..."
|
# Ensure file exists so inotify doesn't fail
|
||||||
while inotifywait -e close_write /etc/nginx/blacklisted.d/blacklisted-sessions.conf; do
|
touch /etc/nginx/blacklisted.d/blacklisted-sessions.conf;
|
||||||
echo "Change detected in deny.conf, reloading Nginx..."
|
echo "Watcher started on /etc/nginx/blacklisted.d/blacklisted-sessions.conf"
|
||||||
# Find the Nginx master process and send SIGHUP (reload)
|
|
||||||
|
while inotifywait -e modify /etc/nginx/blacklisted.d/blacklisted-sessions.conf; do
|
||||||
|
echo "Change detected, waiting 5 seconds to batch updates..."
|
||||||
|
sleep 5;
|
||||||
|
|
||||||
|
# Check if Nginx is actually running before signaling
|
||||||
|
if pgrep nginx > /dev/null; then
|
||||||
|
echo "Reloading Nginx..."
|
||||||
pkill -HUP nginx
|
pkill -HUP nginx
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: blacklisted-memory-volume
|
- name: blacklisted-memory-volume
|
||||||
mountPath: /etc/nginx/blacklisted.d/
|
mountPath: /etc/nginx/blacklisted.d/
|
||||||
|
|||||||
Reference in New Issue
Block a user