Compare commits
No commits in common. "a5cfca8a0f95eb9f32b7193636fdd192608a2b72" and "a9cfd6843b76a6ec5f62d5642a2ac08c4c137ea9" have entirely different histories.
a5cfca8a0f
...
a9cfd6843b
2 changed files with 8 additions and 17 deletions
|
@ -30,7 +30,10 @@ RUN mv /etc/nginx/access_logd_`access_log -v`.conf /etc/nginx/access_logd.conf
|
||||||
RUN chown -R nginx:nginx /etc/nginx
|
RUN chown -R nginx:nginx /etc/nginx
|
||||||
RUN nginx -t
|
RUN nginx -t
|
||||||
|
|
||||||
RUN chown nginx:nginx /var/lib/access_log.sqlite3
|
# access_logd runs as nobody but the socket can be written to by nginx
|
||||||
|
RUN delgroup nobody nobody
|
||||||
|
RUN addgroup nobody www-data
|
||||||
|
RUN chown nobody:www-data /var/lib/access_log.sqlite3
|
||||||
|
|
||||||
# Shared configuration
|
# Shared configuration
|
||||||
VOLUME /etc/nginx/sites
|
VOLUME /etc/nginx/sites
|
||||||
|
|
|
@ -6,20 +6,8 @@ test -n "$ACCESS_LOGS_FLAGS" || exit 1
|
||||||
# Give write access to Nginx
|
# Give write access to Nginx
|
||||||
umask 007
|
umask 007
|
||||||
|
|
||||||
pid=/run/access_logd.pid
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
start)
|
|
||||||
# Copy default database
|
# Copy default database
|
||||||
install -m 640 -o nobody /var/lib/access_log.sqlite3 /var/log/access_log.sqlite3
|
install -m 640 -o nobody /var/lib/access_log.sqlite3 /var/log/access_log.sqlite3
|
||||||
|
|
||||||
# Read from fifo and load into database
|
# Read from fifo and load into database
|
||||||
daemonize -p /run/access_logd.pid -u nginx /usr/local/bin/syslogize /usr/bin/access_log $ACCESS_LOGS_FLAGS
|
daemonize -p /run/access_logd.pid -u nobody /usr/local/bin/syslogize /usr/bin/access_log $ACCESS_LOGS_FLAGS
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
test -f $pid || exit 0
|
|
||||||
|
|
||||||
cat $pid | xargs kill
|
|
||||||
rm $pid
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
Loading…
Reference in a new issue