1 |
brianr |
1.1 |
diff -urN smeserver-openvpn-bridge-2.1.old/createlinks smeserver-openvpn-bridge-2.1/createlinks |
2 |
|
|
--- smeserver-openvpn-bridge-2.1.old/createlinks 2021-02-08 10:00:30.142202494 +0000 |
3 |
|
|
+++ smeserver-openvpn-bridge-2.1/createlinks 2021-02-08 15:59:14.489481691 +0000 |
4 |
|
|
@@ -6,12 +6,12 @@ |
5 |
|
|
safe_symlink("restart", "root/etc/e-smith/events/network-create/services2adjust/openvpn-bridge"); |
6 |
|
|
safe_symlink("restart", "root/etc/e-smith/events/network-delete/services2adjust/openvpn-bridge"); |
7 |
|
|
|
8 |
|
|
-service_link_enhanced("openvpn-bridge", "S80", "7"); |
9 |
|
|
-service_link_enhanced("openvpn-bridge", "K25", "6"); |
10 |
|
|
-service_link_enhanced("openvpn-bridge", "K25", "0"); |
11 |
|
|
+#service_link_enhanced("openvpn-bridge", "S80", "7"); |
12 |
|
|
+#service_link_enhanced("openvpn-bridge", "K25", "6"); |
13 |
|
|
+#service_link_enhanced("openvpn-bridge", "K25", "0"); |
14 |
|
|
|
15 |
|
|
|
16 |
|
|
-safe_symlink("../daemontools" , 'root/etc/rc.d/init.d/supervise/openvpn-bridge'); |
17 |
|
|
+#safe_symlink("../daemontools" , 'root/etc/rc.d/init.d/supervise/openvpn-bridge'); |
18 |
|
|
safe_symlink("/var/service/openvpn-bridge" , 'root/service/openvpn-bridge'); |
19 |
|
|
|
20 |
|
|
safe_touch("root/var/service/openvpn-bridge/down"); |
21 |
|
|
@@ -28,3 +28,28 @@ |
22 |
|
|
event_link("openvpn-bridge-update-crl", "openvpn-bridge-update", "30"); |
23 |
|
|
event_link("openvpn-bridge-reload-ccd", "openvpn-bridge-reload-ccd", "20"); |
24 |
|
|
event_link("openvpn-bridge-update-crl", "openvpn-bridge-reload-ccd", "30"); |
25 |
|
|
+ |
26 |
|
|
+# our event specific for updating with yum without reboot |
27 |
|
|
+$event = "smeserver-openvpn-bridge-update"; |
28 |
|
|
+#add here the path to your templates needed to expand |
29 |
|
|
+#see the /etc/systemd/system-preset/49-koozali.preset should be present for systemd integration on all you yum update event |
30 |
|
|
+ |
31 |
|
|
+foreach my $file (qw( |
32 |
|
|
+ /etc/systemd/system-preset/49-koozali.preset |
33 |
|
|
+ /etc/crontab |
34 |
|
|
+ /etc/openvpn/bridge/management-pass.txt |
35 |
|
|
+ /etc/openvpn/bridge/openvpn.conf |
36 |
|
|
+ |
37 |
|
|
+)) |
38 |
|
|
+{ |
39 |
|
|
+ templates2events( $file, $event ); |
40 |
|
|
+} |
41 |
|
|
+ |
42 |
|
|
+#action needed in case we have a systemd unit |
43 |
|
|
+event_link("systemd-default", $event, "10"); |
44 |
|
|
+event_link("systemd-reload", $event, "50"); |
45 |
|
|
+ |
46 |
|
|
+#action specific to this package |
47 |
|
|
+event_link("openvpn-bridge-update", $event, "60"); |
48 |
|
|
+#services we need to restart |
49 |
|
|
+safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/openvpn-bridge"); |
50 |
|
|
diff -urN smeserver-openvpn-bridge-2.1.old/root/usr/lib/systemd/system/openvpn-bridge.service smeserver-openvpn-bridge-2.1/root/usr/lib/systemd/system/openvpn-bridge.service |
51 |
|
|
--- smeserver-openvpn-bridge-2.1.old/root/usr/lib/systemd/system/openvpn-bridge.service 1970-01-01 01:00:00.000000000 +0100 |
52 |
|
|
+++ smeserver-openvpn-bridge-2.1/root/usr/lib/systemd/system/openvpn-bridge.service 2021-02-08 16:01:59.796681570 +0000 |
53 |
|
|
@@ -0,0 +1,9 @@ |
54 |
|
|
+[Unit] |
55 |
|
|
+Description=OpenVPN Server to Server |
56 |
|
|
+After=network.service |
57 |
|
|
+[Service] |
58 |
|
|
+Type=forking |
59 |
|
|
+ExecStart=/usr/sbin/systemd/openvpn-bridge |
60 |
|
|
+[Install] |
61 |
|
|
+WantedBy=sme-server.target |
62 |
|
|
+ |
63 |
|
|
diff -urN smeserver-openvpn-bridge-2.1.old/root/usr/sbin/systemd/openvpn-bridge smeserver-openvpn-bridge-2.1/root/usr/sbin/systemd/openvpn-bridge |
64 |
|
|
--- smeserver-openvpn-bridge-2.1.old/root/usr/sbin/systemd/openvpn-bridge 1970-01-01 01:00:00.000000000 +0100 |
65 |
|
|
+++ smeserver-openvpn-bridge-2.1/root/usr/sbin/systemd/openvpn-bridge 2021-02-13 14:24:39.487170316 +0000 |
66 |
|
|
@@ -0,0 +1,5 @@ |
67 |
|
|
+#!/bin/sh |
68 |
|
|
+ |
69 |
|
|
+exec 2>&1 |
70 |
|
|
+ |
71 |
|
|
+exec /usr/sbin/openvpn --config /etc/openvpn/bridge/openvpn.conf --cd /etc/openvpn/bridge |