Commit 1176a7a8 by Czémán Arnold

fwdriver: fix systemd unit files and fw.py

parent e2e90f5b
......@@ -77,7 +77,7 @@ 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")
import platform
if platform.dist()[0]=="centos":
sudo(('/bin/systemctl', 'restart','dhcpd'))
else:
......
[Unit]
Description=CIRCLE firewall
Description=CIRCLE firewall init
After=network.target
#Before=firewall.service
[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
Type=oneshot
ExecStart=/bin/bash -c "/bin/systemctl restart openvswitch ; /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"
[Install]
WantedBy=multi-user.target
......
[Unit]
Description=CIRCLE firewall
After=network.target
Requires=firewall-init.service
After=firewall-init.service
[Service]
......@@ -8,8 +9,8 @@ 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
ExecStart=/bin/bash -c ". /home/fw/.virtualenvs/fw/bin/postactivate; . /home/fw/.virtualenvs/fw/bin/activate; exec celeryd -A fw -Q %H.firewall --loglevel=info -c 1"
#ExecStartPost=/bin/sudo /bin/systemctl restart dhcpd
Restart=always
......
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