tools/stx/toCOPY/aptly/nginx.logrotate
Haiqing Bai d9bcb8b10e aptly docker: change nginx log files to /var/aptly
The original log files of nginx are under '/var/log/nginx/'
which is not in local disk and it hard to collect these logs.
This commit changed these logs to the shared volume 'var/aptly'
of aptly docker.

Test Plan:
Pass: Create a new build environment and check with:
      $stx control enter --dockername repomgr
      $cat /var/aptly/nginx_error.log
      $cat /var/aptly/nginx_access.log
      exit from the repomgr:
      $cd ${STX_BUILD_HOME}
      $cat aptly/nginx_error.log
      $cat aptly/nginx_access.log
      nginx works and it logs into the above files

Story: 2008846
Task: 46647

Signed-off-by: Haiqing Bai <haiqing.bai@windriver.com>
Change-Id: Ibeeb7e1c2b98c3a5d8a78acd5bb269b45550589c
2022-10-26 10:14:35 +08:00

16 lines
353 B
Plaintext

/var/aptly/nginx_*.log {
daily
missingok
rotate 52
compress
delaycompress
notifempty
create 640 nginx adm
sharedscripts
postrotate
if [ -f /var/run/nginx.pid ]; then
kill -USR1 `cat /var/run/nginx.pid`
fi
endscript
}