Skip to content
Snippets Groups Projects
Commit 09dbe3b6 authored by Anna Wilson's avatar Anna Wilson
Browse files

Merge branch 'feature/exabgp_support2' into feature/split_celery

parents 2da05a80 d0966e30
Branches
No related tags found
No related merge requests found
......@@ -373,7 +373,8 @@ import os
import signal
def handleSIGCHLD(signal, frame):
logger.info("handleSIGCHLD(): reaping childs")
pid = os.getpid()
logger.info("handleSIGCHLD(): pid="+str(pid)+" reaping childs")
os.waitpid(-1, os.WNOHANG)
def snmp_lock_create(wait=0):
......@@ -404,15 +405,18 @@ def snmp_lock_remove():
logger.error("snmp_lock_remove(): failed "+str(e))
def exit_process():
import sys
#import sys
pid = os.getpid()
logger.info("exit_process(): before exit in child process (pid="+str(pid)+")")
exit()
logger.info("exit_process(): before exit in child process (pid="+str(pid)+"), after exit")
sys.exit()
logger.info("exit_process(): before exit in child process (pid="+str(pid)+"), after sys.exit")
#logger.info("exit_process(): before exit() in child process (pid="+str(pid)+")")
#exit()
#logger.info("exit_process(): before sys.exit() in child process (pid="+str(pid)+")")
#sys.exit()
logger.info("exit_process(): before os._exit() in child process (pid="+str(pid)+")")
os._exit()
logger.info("exit_process(): before exit in child process (pid="+str(pid)+"), after os._exit")
logger.info("exit_process(): before os._exit() in child process (pid="+str(pid)+")")
#@shared_task(ignore_result=True, time_limit=580, soft_time_limit=550)
@shared_task(ignore_result=True, max_retries=0)
......@@ -432,21 +436,28 @@ def poll_snmp_statistics():
elif npid > 0:
logger.info("poll_snmp_statistics(): returning in parent process (pid="+str(pid)+", npid="+str(npid)+")")
else:
logger.info("poll_snmp_statistics(): in child process (pid="+str(pid)+", npid="+str(npid)+")")
ppid = pid
pid = os.getpid()
logger.info("poll_snmp_statistics(): in child process (pid="+str(pid)+", ppid="+str(ppid)+")")
try:
snmpstats.poll_snmp_statistics()
except Exception as e:
logger.error("poll_snmp_statistics(): exception occured in snmp poll (pid="+str(pid)+", npid="+str(npid)+"): "+str(e))
logger.error("poll_snmp_statistics(): exception occured in snmp poll (pid="+str(pid)+", ppid="+str(ppid)+"): "+str(e))
snmp_lock_remove()
#exit_process()
logger.info("exit_process(): before exit in child process (pid="+str(pid)+", npid="+str(npid)+")")
exit()
logger.info("exit_process(): before exit in child process (pid="+str(pid)+", npid="+str(npid)+"), after exit")
import sys
sys.exit()
logger.info("exit_process(): before exit in child process (pid="+str(pid)+", npid="+str(npid)+"), after sys.exit")
os._exit()
logger.info("exit_process(): before exit in child process (pid="+str(pid)+", npid="+str(npid)+"), after os._exit")
# not used anymore: will lead to exit of parent process
#logger.info("poll_snmp_statistics(): before exit() in child process (pid="+str(pid)+", ppid="+str(ppid)+")")
#exit()
# not used anymore: will lead to exit of parent process
#logger.info("poll_snmp_statistics(): before sys.exit() in child process (pid="+str(pid)+", ppid="+str(ppid)+")")
#import sys
#sys.exit()
logger.info("poll_snmp_statistics(): before os._exit() in child process (pid="+str(pid)+", ppid="+str(ppid)+")")
os._exit(0)
logger.info("poll_snmp_statistics(): after os._exit() in child process (pid="+str(pid)+", ppid="+str(ppid)+")")
@shared_task(ignore_result=True, max_retries=0)
def snmp_add_initial_zero_value(rule_id, zero_or_null=True):
......@@ -467,7 +478,9 @@ def snmp_add_initial_zero_value(rule_id, zero_or_null=True):
elif npid > 0:
logger.info("snmp_add_initial_zero_value(): returning in parent process (pid="+str(pid)+", npid="+str(npid)+")")
else:
logger.info("snmp_add_initial_zero_value(): in child process (pid="+str(pid)+", npid="+str(npid)+")")
ppid = pid
pid = os.getpid()
logger.info("snmp_add_initial_zero_value(): in child process (pid="+str(pid)+", ppid="+str(ppid)+")")
try:
snmpstats.add_initial_zero_value(rule_id, zero_or_null)
......@@ -476,14 +489,18 @@ def snmp_add_initial_zero_value(rule_id, zero_or_null=True):
logger.error("snmp_add_initial_zero_value(): rule_id="+str(rule_id)+","+str(zero_or_null)+" failed: "+str(e))
#exit_process()
logger.info("exit_process(): before exit in child process (pid="+str(pid)+", npid="+str(npid)+")")
exit()
logger.info("exit_process(): before exit in child process (pid="+str(pid)+", npid="+str(npid)+"), after exit")
sys.exit()
logger.info("exit_process(): before exit in child process (pid="+str(pid)+", npid="+str(npid)+"), after sys.exit")
os._exit()
logger.info("exit_process(): before exit in child process (pid="+str(pid)+", npid="+str(npid)+"), after os._exit")
# not used anymore: will lead to exit of parent process
#logger.info("snmp_add_initial_zero_value(): before exit() in child process (pid="+str(pid)+", ppid="+str(ppid)+")")
#exit()
# not used anymore: will lead to exit of parent process
#logger.info("snmp_add_initial_zero_value(): before sys.exit() in child process (pid="+str(pid)+", ppid="+str(ppid)+")")
#sys.exit()
logger.info("snmp_add_initial_zero_value(): before os._exit() in child process (pid="+str(pid)+", ppid="+str(ppid)+")")
os._exit(0)
logger.info("snmp_add_initial_zero_value(): after os._exit() in child process (pid="+str(pid)+", ppid="+str(ppid)+")")
@pytest.mark.skip
@shared_task(ignore_result=True,default_retry_delay=5,max_retries=2,autoretry_for=(TimeoutError,))
......
......@@ -121,6 +121,9 @@ def welcome(request):
return render(
request,
'welcome.html',
{
'BRANDING': settings.BRANDING
},
)
......
......@@ -87,6 +87,9 @@ LOG_FILE_LOCATION = "/srv/flowspy/log/"
LOGGING_FORMAT_DEFAULT = '%(asctime)s %(name)s %(levelname)s: %(message)s'
#LOGGING_FORMAT_DEFAULT = '%(processName)s[%(process)d] %(asctime)s %(name)s %(levelname)s: %(message)s'
#CELERYD_LOG_FORMAT = LOGGING_FORMAT_DEFAULT
#CELERYD_TASK_LOG_FORMAT = CELERYD_LOG_FORMAT
# "error" | "warn" | "info" | "debug"
LOG_LEVEL = "info"
......@@ -262,6 +265,8 @@ BRANDING = {
'logo': 'fodlogo2.png',
'favicon': 'favicon.ico',
'contact_support': 'GÉANT OC at <a href=\'mailto:support@oc.geant.net\'>support@oc.geant.net</a> or +44 1223 733033.',
'product_name' : 'Firewall-On-Demand',
'product_name_short' : 'FoD',
}
SETTINGS_EXPORT = [
......
......@@ -2,7 +2,8 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>GEANT's FoD</title>
<!--<title>GEANT's FoD</title>-->
<title>{{ settings.BRANDING.name }}'s {{ settings.BRANDING.product_name_short|default:'FoD' }}</title>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
......
......@@ -6,7 +6,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ settings.BRANDING.name }} FoD :: {% block title %}{% endblock %}</title>
<title>{{ settings.BRANDING.name }} {{ settings.BRANDING.product_name_short|default:'FoD' }} :: {% block title %}{% endblock %}</title>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
<link REL="SHORTCUT ICON" HREF="{% get_static_prefix %}/{{ settings.BRANDING.favicon }}">
......
Your account with username {{ user.username }} has been activated.
You may login to FoD using the following URL:
You may login to {{ settings.BRANDING.product_name_short|default:'FoD' }} using the following URL:
http://{{ site.domain }}{% url 'login' %}
......
......@@ -84,7 +84,7 @@ function myreloadPage() {
{% endif %}
</div>
{% endif %}
<br> FoD Rule Id: {{ route.id }}
<br> {{ settings.BRANDING.product_name_short|default:'FoD' }} Rule Id: {{ route.id }}
</div>
<div>
<h2>Statistics</h2>
......
......@@ -31,7 +31,7 @@
<div class="item active">
<img src="{% static 'img/slide2.jpg' %}" alt="FoD" style="width:100%; height:100%; margin: auto; padding:auto;">
<div class="carousel-caption">
<h2>{{ BRANDING.name }} - Firewall on Demand</h2>
<h2>{{ BRANDING.name }} - {{ BRANDING.product_name|default:'Firewall on Demand' }}</h2>
<h4>Protect your network, protect the network</h4>
<p>
<a href="{% url 'login' %}" type="button" class="btn btn-lg btn-outline btn-primary">{% trans "Join Now" %}</a>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment