api-umbrella icon indicating copy to clipboard operation
api-umbrella copied to clipboard

API Umbrella postrotate command fails on nginx access.log

Open mnguyen9 opened this issue 6 years ago • 0 comments

API Umbrella Version: 0.14.2 The postrotate command api-umbrella reopen-logs is failing to reopen Nginx access.log. After logs are rotated, the rotated file is created and access.log is empty. However, the service does not write to access.log anymore. If I run the command, it hangs and cancelling it gives the following error: Executing command failed: perpctl -b /opt/api-umbrella/etc/perp 1 nginx.

That command along with perpctl -b /opt/api-umbrella/etc/perp hup nginx hangs when ran on their own.

Logrotate config:

# Rotate all the perp stdout/stderr logs, as well as any logs that can be
# reopend via the "api-umbrella reopen-logs" command.
/opt/api-umbrella/var/log/*/current /opt/api-umbrella/var/log/nginx/*.log /opt/api-umbrella/var/log/rsyslog/*.log {
  daily
  rotate 10
  size 1k
  missingok
  compress
  notifempty
  dateext
  postrotate
    api-umbrella reopen-logs
  endscript
}

# Skip compression for already gzipped logs.
/opt/api-umbrella/var/log/nginx/*.log.gz {
  daily
  rotate 10
  missingok
  nocompress
  notifempty
  dateext
  sharedscripts
  postrotate
    api-umbrella reopen-logs
  endscript
}

# Skip compression for already gzipped logs and use shorter duration for these
# logs since the data is mostly duplicative.
/opt/api-umbrella/var/log/rsyslog/*.log.gz {
  daily
  rotate 10
  missingok
  nocompress
  notifempty
  dateext
  sharedscripts
  postrotate
    api-umbrella reopen-logs
  endscript
}

# Rotate any remaining logs that can't be reopened, so we have to use the
# "copytruncate" strategy.
/opt/api-umbrella/var/log/elasticsearch/*.log /opt/api-umbrella/var/log/trafficserver/*.blog /opt/api-umbrella/var/log/trafficserver/*.log /opt/api-umbrella/var/log/trafficserver/*.out {
  daily
  rotate 10
  missingok
  compress
  delaycompress
  notifempty
  dateext
  copytruncate
}

mnguyen9 avatar Jul 30 '19 17:07 mnguyen9