1 |
jpp |
1.1 |
diff -Nur e-smith-base-5.8.0.old/createlinks e-smith-base-5.8.0/createlinks |
2 |
|
|
--- e-smith-base-5.8.0.old/createlinks 2020-11-11 21:39:57.056000000 -0500 |
3 |
jpp |
1.3 |
+++ e-smith-base-5.8.0/createlinks 2020-11-11 22:10:03.287000000 -0500 |
4 |
jpp |
1.1 |
@@ -605,7 +605,6 @@ |
5 |
|
|
my %service2order = |
6 |
|
|
( |
7 |
|
|
# Start rsyslog up before network! |
8 |
|
|
- raidmonitor => "15", |
9 |
|
|
dhcpd => "65", |
10 |
|
|
'local' => "99", |
11 |
|
|
); |
12 |
jpp |
1.3 |
@@ -628,7 +627,6 @@ |
13 |
|
|
} |
14 |
|
|
|
15 |
|
|
# Set up links to daemontools. |
16 |
|
|
-safe_symlink("daemontools", "root/etc/rc.d/init.d/raidmonitor"); |
17 |
|
|
|
18 |
|
|
safe_symlink("run.dhclient", "root/var/service/wan/run.DHCPHostname"); |
19 |
|
|
safe_symlink("run.dhclient", "root/var/service/wan/run.DHCPEthernetAddress"); |
20 |
|
|
@@ -657,6 +655,7 @@ |
21 |
jpp |
1.1 |
systemd-update-utmp-runlevel.service |
22 |
|
|
systemd-user-sessions.service |
23 |
|
|
networking.service |
24 |
|
|
+ mdmonitor.service |
25 |
|
|
)) |
26 |
|
|
{ |
27 |
|
|
symlink("../$unit", |
28 |
jpp |
1.3 |
@@ -664,6 +663,8 @@ |
29 |
jpp |
1.1 |
or die "Can't symlink to root/usr/lib/systemd/system/$target.target.wants/$unit: $!"; |
30 |
|
|
} |
31 |
|
|
} |
32 |
|
|
+symlink("mdmonitor.service", |
33 |
jpp |
1.2 |
+ "root/usr/lib/systemd/system/raidmonitor.service"); |
34 |
jpp |
1.1 |
|
35 |
|
|
# languages links |
36 |
|
|
foreach (qw(fr-be fr-lu fr-mc fr-ch)) |
37 |
|
|
diff -Nur e-smith-base-5.8.0.old/root/sbin/e-smith/systemd/mdmonitor-pre e-smith-base-5.8.0/root/sbin/e-smith/systemd/mdmonitor-pre |
38 |
|
|
--- e-smith-base-5.8.0.old/root/sbin/e-smith/systemd/mdmonitor-pre 1969-12-31 19:00:00.000000000 -0500 |
39 |
|
|
+++ e-smith-base-5.8.0/root/sbin/e-smith/systemd/mdmonitor-pre 2020-11-11 21:41:25.899000000 -0500 |
40 |
|
|
@@ -0,0 +1,10 @@ |
41 |
|
|
+#!/bin/sh |
42 |
|
|
+count=$(sed -n '/[0-9]\s\+[^ ]\+[^0-9]$/p;/[0-9]\s\+\(rd\|ida\|cciss\|i2o\)\/[^ ]\+[^0-9p][0-9]\+$/p' /proc/partitions | wc -l) |
43 |
|
|
+if [ $count -ge 2 ] |
44 |
|
|
+then |
45 |
|
|
+ exit 0 |
46 |
|
|
+else |
47 |
|
|
+ echo "Only $count drive(s) in this system - disabling raid monitoring" |
48 |
|
|
+ exit 1 |
49 |
|
|
+fi |
50 |
|
|
+ |
51 |
|
|
diff -Nur e-smith-base-5.8.0.old/root/usr/lib/systemd/system/mdmonitor.service.d/50koozali.conf e-smith-base-5.8.0/root/usr/lib/systemd/system/mdmonitor.service.d/50koozali.conf |
52 |
|
|
--- e-smith-base-5.8.0.old/root/usr/lib/systemd/system/mdmonitor.service.d/50koozali.conf 1969-12-31 19:00:00.000000000 -0500 |
53 |
|
|
+++ e-smith-base-5.8.0/root/usr/lib/systemd/system/mdmonitor.service.d/50koozali.conf 2020-11-11 21:45:02.207000000 -0500 |
54 |
|
|
@@ -0,0 +1,11 @@ |
55 |
|
|
+[Service] |
56 |
|
|
+#this one to erase previous |
57 |
|
|
+ExecStart= |
58 |
|
|
+#Koozali |
59 |
|
|
+ExecStartPre=/sbin/e-smith/service-status raidmonitor |
60 |
|
|
+ExecStartPre=/sbin/e-smith/systemd/mdmonitor-pre |
61 |
jpp |
1.4 |
+ExecStart=/sbin/mdadm --monitor --scan --program /sbin/e-smith/mdevent -f --pid-file=/var/run/mdadm/mdadm.pid |
62 |
jpp |
1.1 |
+ |
63 |
|
|
+[Install] |
64 |
|
|
+Alias=raidmonitor.service |
65 |
|
|
+WantedBy=sme-server.target |