Merge "Amphora-agent should log to a distinct location"
This commit is contained in:
commit
e24e3934c2
@ -1,4 +1,5 @@
|
|||||||
dib-init-system
|
dib-init-system
|
||||||
|
install-static
|
||||||
package-installs
|
package-installs
|
||||||
pip-and-virtualenv
|
pip-and-virtualenv
|
||||||
source-repositories
|
source-repositories
|
||||||
|
@ -7,6 +7,8 @@ Wants=syslog.service
|
|||||||
ExecStart=/usr/local/bin/amphora-agent --config-file /etc/octavia/amphora-agent.conf
|
ExecStart=/usr/local/bin/amphora-agent --config-file /etc/octavia/amphora-agent.conf
|
||||||
KillMode=mixed
|
KillMode=mixed
|
||||||
Restart=always
|
Restart=always
|
||||||
|
ExecStartPost=/bin/sh -c "echo $MAINPID > /var/run/amphora-agent.pid"
|
||||||
|
PIDFile=/var/run/amphora-agent.pid
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
@ -7,3 +7,12 @@ respawn
|
|||||||
respawn limit 2 2
|
respawn limit 2 2
|
||||||
|
|
||||||
exec amphora-agent --config-file /etc/octavia/amphora-agent.conf
|
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
|
||||||
|
12
elements/amphora-agent/static/etc/logrotate.d/amphora-agent
Normal file
12
elements/amphora-agent/static/etc/logrotate.d/amphora-agent
Normal 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
|
||||||
|
}
|
@ -77,8 +77,8 @@ def main():
|
|||||||
'ca_certs': CONF.amphora_agent.agent_server_ca,
|
'ca_certs': CONF.amphora_agent.agent_server_ca,
|
||||||
'cert_reqs': True,
|
'cert_reqs': True,
|
||||||
'preload_app': True,
|
'preload_app': True,
|
||||||
'accesslog': '-',
|
'accesslog': '/var/log/amphora-agent.log',
|
||||||
'errorlog': '-',
|
'errorlog': '/var/log/amphora-agent.log',
|
||||||
'loglevel': 'debug',
|
'loglevel': 'debug',
|
||||||
}
|
}
|
||||||
AmphoraAgent(server_instance.app, options).run()
|
AmphoraAgent(server_instance.app, options).run()
|
||||||
|
Loading…
Reference in New Issue
Block a user