Commit e2e90f5b by Czémán Arnold

Add systemd service scripts, and modify reload_firewall, and freeze some dependecies

parent af42f3a5
......@@ -77,6 +77,10 @@ def reload_firewall_vlan(data, save_config=True):
def reload_dhcp(data):
with open('/etc/dhcp/dhcpd.conf.generated', 'w') as f:
f.write("\n".join(data) + "\n")
if platform.dist()[0]=="centos":
sudo(('/bin/systemctl', 'restart','dhcpd'))
else:
sudo(('/etc/init.d/isc-dhcp-server', 'restart'))
logger.info("DHCP configuration is reloaded.")
......
[Unit]
Description=CIRCLE firewall
After=network.target
[Service]
User=root
Group=root
WorkingDirectory=/home/fw/fwdriver
ExecStart=/bin/bash -c "/etc/init.d/openvswitch restart ; /sbin/ip netns add fw || true; ovs-vsctl del-br firewall || true; /sbin/ip netns exec fw sysctl -f /etc/sysctl.d/60-circle-firewall.conf; /sbin/ip netns exec fw ip link set lo up;"
Restart=always
[Install]
WantedBy=multi-user.target
[Unit]
Description=CIRCLE firewall
After=network.target
After=firewall-init.service
[Service]
User=fw
Group=fw
WorkingDirectory=/home/fw/fwdriver
ExecStart=/bin/bash -c "cd /home/fw/fwdriver ; . /home/fw/.virtualenvs/fw/bin/postactivate; . /home/fw/.virtualenvs/fw/bin/activate; HOSTNAME=$(hostname -s); exec celeryd -A fw -Q ${HOSTNAME}.firewall --loglevel=info -c 1"
#ExecStartPost=/bin/systemclt restart dhcpd
Restart=always
[Install]
WantedBy=multi-user.target
setuptools==0.9.8
amqp==1.0.13
anyjson==0.3.3
argparse==1.2.1
billiard==2.7.3.32
celery==3.0.23
distribute==0.6.24
distribute==0.7.3
kombu==2.5.14
netaddr==0.7.10
python-dateutil==2.1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment