feat: start stop

This commit is contained in:
f 2023-04-20 13:04:42 -03:00
parent a9cfd6843b
commit 61eb7bc9b8

View file

@ -6,8 +6,20 @@ test -n "$ACCESS_LOGS_FLAGS" || exit 1
# Give write access to Nginx # Give write access to Nginx
umask 007 umask 007
# Copy default database pid=/run/access_logd.pid
install -m 640 -o nobody /var/lib/access_log.sqlite3 /var/log/access_log.sqlite3
# Read from fifo and load into database case $1 in
daemonize -p /run/access_logd.pid -u nobody /usr/local/bin/syslogize /usr/bin/access_log $ACCESS_LOGS_FLAGS 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