Skip to content

Instantly share code, notes, and snippets.

@brucewu16899
Forked from szepeviktor/incrontab
Created August 19, 2014 03:34
Show Gist options
  • Save brucewu16899/802f44b9b3dd5231bd13 to your computer and use it in GitHub Desktop.
Save brucewu16899/802f44b9b3dd5231bd13 to your computer and use it in GitHub Desktop.
/var/www/site1/nginx.conf IN_MODIFY,IN_NO_LOOP /usr/local/sbin/nginx-reload.sh
/var/www/site2/nginx.conf IN_MODIFY,IN_NO_LOOP /usr/local/sbin/nginx-reload.sh
/var/www/site3/nginx.conf IN_MODIFY,IN_NO_LOOP /usr/local/sbin/nginx-reload.sh
#!/bin/sh
error() {
local RET=$1
shift
echo -e "$@" >&2
exit "$RET"
}
sleep 5
service nginx reload || error 2 "nginx reload error"
#!/bin/sh
flock -x "/var/lock/nginx-reload" -c nginx-reload-worker.sh
logger -t "nginx-reload[$$]" "Reloading OK"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment