Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
fwdriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1176a7a8
authored
Jul 20, 2015
by
Czémán Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fwdriver: fix systemd unit files and fw.py
parent
e2e90f5b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
fw.py
+1
-1
miscellaneous/firewall-init.service
+4
-5
miscellaneous/firewall.service
+3
-2
No files found.
fw.py
View file @
1176a7a8
...
@@ -77,7 +77,7 @@ def reload_firewall_vlan(data, save_config=True):
...
@@ -77,7 +77,7 @@ def reload_firewall_vlan(data, save_config=True):
def
reload_dhcp
(
data
):
def
reload_dhcp
(
data
):
with
open
(
'/etc/dhcp/dhcpd.conf.generated'
,
'w'
)
as
f
:
with
open
(
'/etc/dhcp/dhcpd.conf.generated'
,
'w'
)
as
f
:
f
.
write
(
"
\n
"
.
join
(
data
)
+
"
\n
"
)
f
.
write
(
"
\n
"
.
join
(
data
)
+
"
\n
"
)
import
platform
if
platform
.
dist
()[
0
]
==
"centos"
:
if
platform
.
dist
()[
0
]
==
"centos"
:
sudo
((
'/bin/systemctl'
,
'restart'
,
'dhcpd'
))
sudo
((
'/bin/systemctl'
,
'restart'
,
'dhcpd'
))
else
:
else
:
...
...
miscellaneous/firewall-init.service
View file @
1176a7a8
[Unit]
[Unit]
Description=CIRCLE firewall
Description=CIRCLE firewall
init
After=network.target
After=network.target
#Before=firewall.service
[Service]
[Service]
User=root
User=root
Group=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;"
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"
Restart=always
[Install]
[Install]
WantedBy=multi-user.target
WantedBy=multi-user.target
...
...
miscellaneous/firewall.service
View file @
1176a7a8
[Unit]
[Unit]
Description=CIRCLE firewall
Description=CIRCLE firewall
After=network.target
After=network.target
Requires=firewall-init.service
After=firewall-init.service
After=firewall-init.service
[Service]
[Service]
...
@@ -8,8 +9,8 @@ User=fw
...
@@ -8,8 +9,8 @@ User=fw
Group=fw
Group=fw
WorkingDirectory=/home/fw/fwdriver
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"
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/s
ystemclt
restart dhcpd
#ExecStartPost=/bin/s
udo /bin/systemctl
restart dhcpd
Restart=always
Restart=always
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment