feat: start stop
This commit is contained in:
parent
a9cfd6843b
commit
61eb7bc9b8
1 changed files with 16 additions and 4 deletions
|
@ -6,8 +6,20 @@ test -n "$ACCESS_LOGS_FLAGS" || exit 1
|
|||
# Give write access to Nginx
|
||||
umask 007
|
||||
|
||||
# Copy default database
|
||||
install -m 640 -o nobody /var/lib/access_log.sqlite3 /var/log/access_log.sqlite3
|
||||
pid=/run/access_logd.pid
|
||||
|
||||
# Read from fifo and load into database
|
||||
daemonize -p /run/access_logd.pid -u nobody /usr/local/bin/syslogize /usr/bin/access_log $ACCESS_LOGS_FLAGS
|
||||
case $1 in
|
||||
start)
|
||||
# Copy default database
|
||||
install -m 640 -o nobody /var/lib/access_log.sqlite3 /var/log/access_log.sqlite3
|
||||
|
||||
# Read from fifo and load into database
|
||||
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