Merge "Amphora-agent should log to a distinct location"

This commit is contained in:
Jenkins 2016-12-19 18:54:25 +00:00 committed by Gerrit Code Review
commit e24e3934c2
5 changed files with 26 additions and 2 deletions

View File

@ -1,4 +1,5 @@
dib-init-system
install-static
package-installs
pip-and-virtualenv
source-repositories

View File

@ -7,6 +7,8 @@ Wants=syslog.service
ExecStart=/usr/local/bin/amphora-agent --config-file /etc/octavia/amphora-agent.conf
KillMode=mixed
Restart=always
ExecStartPost=/bin/sh -c "echo $MAINPID > /var/run/amphora-agent.pid"
PIDFile=/var/run/amphora-agent.pid
[Install]
WantedBy=multi-user.target

View File

@ -7,3 +7,12 @@ respawn
respawn limit 2 2
exec amphora-agent --config-file /etc/octavia/amphora-agent.conf
post-start script
PID=`status amphora-agent | egrep -oi '([0-9]+)$' | head -n1`
echo $PID > /var/run/amphora-agent.pid
end script
post-stop script
rm -f /var/run/amphora-agent.pid
end script

View File

@ -0,0 +1,12 @@
/var/log/amphora-agent.log {
daily
rotate 10
missingok
notifempty
compress
delaycompress
sharedscripts
postrotate
kill -s SIGUSR1 $(cat /var/run/amphora-agent.pid)
endscript
}

View File

@ -77,8 +77,8 @@ def main():
'ca_certs': CONF.amphora_agent.agent_server_ca,
'cert_reqs': True,
'preload_app': True,
'accesslog': '-',
'errorlog': '-',
'accesslog': '/var/log/amphora-agent.log',
'errorlog': '/var/log/amphora-agent.log',
'loglevel': 'debug',
}
AmphoraAgent(server_instance.app, options).run()