/[smecontribs]/rpms/smeserver-bridge-interface/contribs10/smeserver-bridge-interface-0.2-makeitcompatible.patch
ViewVC logotype

Contents of /rpms/smeserver-bridge-interface/contribs10/smeserver-bridge-interface-0.2-makeitcompatible.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Tue Mar 23 17:19:55 2021 UTC (3 years, 8 months ago) by jpp
Branch: MAIN
CVS Tags: smeserver-bridge-interface-0_2-8_el7_sme, smeserver-bridge-interface-0_2-9_el7_sme, smeserver-bridge-interface-0_2-7_el7_sme, HEAD
* Tue Mar 23 2021 Jean-Philippe Pialasse <tests@pialasse.com> 0.2-7.sme
- make bridge interface up on install [SME: 11485]
- modify support for dhcp with bridge

1 diff -Nur --no-dereference smeserver-bridge-interface-0.2.old/createlinks smeserver-bridge-interface-0.2/createlinks
2 --- smeserver-bridge-interface-0.2.old/createlinks 2021-03-23 10:53:19.458000000 -0400
3 +++ smeserver-bridge-interface-0.2/createlinks 2021-03-23 11:53:43.644000000 -0400
4 @@ -11,7 +11,7 @@
5
6 foreach my $file (qw(
7 /etc/systemd/system-preset/49-koozali.preset
8 -
9 + /usr/lib/systemd/system/dhcpd.service.d/50koozali.conf
10
11 ))
12 {
13 @@ -20,23 +20,21 @@
14
15
16 #action needed in case we have a systemd unit
17 -event_link("systemd-default", $event, "10");
18 -event_link("systemd-reload", $event, "50");
19 +#event_link("systemd-default", $event, "10");
20 +#event_link("systemd-reload", $event, "50");
21 +event_link("systemd-default", $event, "88");
22 +event_link("systemd-reload", $event, "89");
23
24 -#action specific to this package
25 -event_link("bridge-disable", "$event", "02");
26 -event_link("bridge-enable", "$event", "98");
27
28 +#action specific to this package
29 +#event_link("bridge-disable", "$event", "02");
30 +#event_link("bridge-enable", "$event", "98");
31 +event_link("bridge-enable", "$event", "87");
32
33 #services we need to restarta
34 #none?
35 -
36 -
37 -# Start and stop links - SME9
38 -#service_link_enhanced("bridge", "S80", "7");
39 -#service_link_enhanced("bridge", "K01", "6");
40 -#service_link_enhanced("bridge", "K01", "0");
41 -#service_link_enhanced("bridge", "K01", "1");
42 +event_services($event, "dhcpd" => "restart");
43 +event_services($event, "bridge" => "restart");
44
45 foreach my $event (qw/console-save bootstrap-console-save/){
46 event_link("bridge-disable", "$event", "02");
47 diff -Nur --no-dereference smeserver-bridge-interface-0.2.old/root/etc/e-smith/templates/usr/lib/systemd/system/dhcpd.service.d/50koozali.conf/41service smeserver-bridge-interface-0.2/root/etc/e-smith/templates/usr/lib/systemd/system/dhcpd.service.d/50koozali.conf/41service
48 --- smeserver-bridge-interface-0.2.old/root/etc/e-smith/templates/usr/lib/systemd/system/dhcpd.service.d/50koozali.conf/41service 1969-12-31 19:00:00.000000000 -0500
49 +++ smeserver-bridge-interface-0.2/root/etc/e-smith/templates/usr/lib/systemd/system/dhcpd.service.d/50koozali.conf/41service 2021-03-23 13:13:18.425000000 -0400
50 @@ -0,0 +1,21 @@
51 +{
52 +$interface=$InternalInterface{'Name'}||"hum";
53 +$bridgeif=(defined $bridge{bridgeInterface} && $bridge{status} eq "enabled")? $bridge{bridgeInterface}: "";
54 +#$bridgedif=(defined $bridge{ethernetInterface} ) ? $bridge{ethernetInterface} : undef;
55 +#$interface=(defined $bridgedif && $bridgedif eq $interface && defined $bridgeif) ? $bridgeif : $interface;
56 +# extra code if we want to hide the ethernet interface, howecer with only a little noise in dhcp log, we can keep the two intefaces
57 +$interface=( "$interface" ne "$bridgeif" && defined $bridgeif ) ? "$interface $bridgeif" : $interface;
58 +
59 +$configfile='/etc/dhcpd.conf';
60 +$leasefile='/var/lib/dhcpd/dhcpd.leases';
61 +$OUT .="";
62 +}
63 +
64 +[Service]
65 +# added for bridge interface
66 +ExecStart=
67 +ExecStart=/usr/bin/sh -c 'exec /usr/sbin/dhcpd -f -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases -user dhcpd -group dhcpd --no-pid {$interface} {$bridgeif} >>/var/log/dhcpd/current 2>>/var/log/dhcpd/current'
68 +
69 +# in case bridge is not yet started, we want to retry..
70 +Restart=always
71 +RestartSec=1
72 diff -Nur --no-dereference smeserver-bridge-interface-0.2.old/root/sbin/e-smith/systemd/bridge-run smeserver-bridge-interface-0.2/root/sbin/e-smith/systemd/bridge-run
73 --- smeserver-bridge-interface-0.2.old/root/sbin/e-smith/systemd/bridge-run 2021-03-23 10:53:19.463000000 -0400
74 +++ smeserver-bridge-interface-0.2/root/sbin/e-smith/systemd/bridge-run 2021-03-23 12:37:08.282000000 -0400
75 @@ -81,6 +81,9 @@
76 }
77
78 start(){
79 + # prep : filtering module
80 + /usr/sbin/modprobe br_netfilter
81 +
82 # First, create the bridge interface
83 /usr/sbin/brctl addbr $BRIDGE_IF
84
85 diff -Nur --no-dereference smeserver-bridge-interface-0.2.old/root/usr/lib/systemd/system/bridge.service smeserver-bridge-interface-0.2/root/usr/lib/systemd/system/bridge.service
86 --- smeserver-bridge-interface-0.2.old/root/usr/lib/systemd/system/bridge.service 2021-03-23 10:53:19.473000000 -0400
87 +++ smeserver-bridge-interface-0.2/root/usr/lib/systemd/system/bridge.service 2021-03-23 11:03:51.938000000 -0400
88 @@ -2,6 +2,10 @@
89 Description=Bridge Interface for VPN use.
90 #After=network.target
91 After=network.service
92 +After=wan.service
93 +Requires=network.service
94 +PartOf=network.service
95 +Before=network-online.target
96
97 [Service]
98 Type=forking

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed