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 2021-02-18 12:02:54.209000000 -0500 |
3 |
|
|
+++ e-smith-base-5.8.0/createlinks 2021-02-18 13:17:16.830000000 -0500 |
4 |
|
|
@@ -305,7 +305,6 @@ |
5 |
|
|
templates2events("/home/e-smith/ssl.pem/pem", $event); |
6 |
|
|
templates2events("/usr/lib/systemd/system/dhcpd.service.d/50koozali.conf", $event); |
7 |
|
|
event_link("fix-startup", $event, "05"); |
8 |
|
|
-event_link("systemd-default", $event, "05"); |
9 |
|
|
event_link("rotate_timestamped_logfiles", $event, "05"); |
10 |
|
|
event_link("init-accounts", $event, "05"); |
11 |
|
|
event_link("set-hostname", $event, "10"); |
12 |
|
|
@@ -319,6 +318,7 @@ |
13 |
|
|
event_link("conf-modules", $event, "30"); |
14 |
|
|
event_link("create-mnt-floppy", $event, "50"); |
15 |
|
|
event_link("conf-routes", $event, "89"); |
16 |
|
|
+event_link("systemd-default", $event, "88"); |
17 |
|
|
event_link("systemd-isolate", $event, "89"); |
18 |
|
|
event_link("systemd-reload", $event, "89"); |
19 |
|
|
|
20 |
|
|
@@ -336,11 +336,11 @@ |
21 |
|
|
|
22 |
|
|
templates2events("/etc/smartd.conf", $event); |
23 |
|
|
templates2events("/home/e-smith/ssl.pem/pem", $event); |
24 |
|
|
-event_link("systemd-default", $event, "05"); |
25 |
|
|
event_link("set-hostname", $event, "10"); |
26 |
|
|
event_link("user-rsshd", $event, "16"); |
27 |
|
|
event_link("conf-modules", $event, "30"); |
28 |
|
|
event_link("conf-startup", $event, "60"); |
29 |
|
|
+event_link("systemd-default", $event, "88"); |
30 |
|
|
event_link("systemd-reload", $event, "89"); |
31 |
|
|
event_link("reset-unsavedflag", $event, "95"); |
32 |
|
|
|
33 |
|
|
@@ -355,12 +355,12 @@ |
34 |
|
|
|
35 |
|
|
templates2events("/etc/smartd.conf", $event); |
36 |
|
|
templates2events("/home/e-smith/ssl.pem/pem", $event); |
37 |
|
|
-event_link("systemd-default", $event, "05"); |
38 |
|
|
event_link("rmmod-bonding", $event, "10"); |
39 |
|
|
event_link("set-hostname", $event, "10"); |
40 |
|
|
event_link("user-rsshd", $event, "16"); |
41 |
|
|
event_link("conf-modules", $event, "30"); |
42 |
|
|
event_link("conf-startup", $event, "60"); |
43 |
|
|
+event_link("systemd-default", $event, "88"); |
44 |
|
|
event_link("conf-routes", $event, "89"); |
45 |
|
|
event_link("systemd-reload", $event, "89"); |
46 |
|
|
event_link("reset-unsavedflag", $event, "95"); |
47 |
|
|
@@ -372,9 +372,9 @@ |
48 |
|
|
|
49 |
|
|
templates2events("/etc/nsswitch.conf", $event); |
50 |
|
|
templates2events("/etc/pam.d/system-auth", $event); |
51 |
|
|
-event_link("systemd-default", $event, "05"); |
52 |
|
|
event_link("user-lock-passwd", $event, "15"); |
53 |
|
|
event_link("user-modify-unix", $event, "15"); |
54 |
|
|
+event_link("systemd-default", $event, "88"); |
55 |
|
|
event_link("systemd-reload", $event, "89"); |
56 |
|
|
|
57 |
|
|
#-------------------------------------------------- |
58 |
|
|
@@ -407,7 +407,6 @@ |
59 |
|
|
|
60 |
|
|
$event = "halt"; |
61 |
|
|
|
62 |
|
|
-event_link("systemd-default", $event, "05"); |
63 |
|
|
event_link("halt", $event, "70"); |
64 |
|
|
|
65 |
|
|
#-------------------------------------------------- |
66 |
|
|
@@ -443,7 +442,6 @@ |
67 |
|
|
|
68 |
|
|
templates2events("/usr/lib/systemd/system/dhcpd.service.d/50koozali.conf", $event); |
69 |
|
|
event_link("fix-startup", $event, "05"); |
70 |
|
|
-event_link("systemd-default", $event, "05"); |
71 |
|
|
event_link("rotate_timestamped_logfiles", $event, "05"); |
72 |
|
|
event_link("init-accounts", $event, "05"); |
73 |
|
|
event_link("init-passwords", $event, "10"); |
74 |
|
|
@@ -451,6 +449,7 @@ |
75 |
|
|
event_link("user-rsshd", $event, "16"); |
76 |
|
|
event_link("conf-modules", $event, "30"); |
77 |
|
|
event_link("create-mnt-floppy", $event, "50"); |
78 |
|
|
+event_link("systemd-default", $event, "88"); |
79 |
|
|
event_link("systemd-reload", $event, "89"); |
80 |
|
|
|
81 |
|
|
#-------------------------------------------------- |
82 |
|
|
@@ -461,7 +460,6 @@ |
83 |
|
|
|
84 |
|
|
templates2events("/usr/lib/systemd/system/dhcpd.service.d/50koozali.conf", $event); |
85 |
|
|
event_link("fix-startup", $event, "05"); |
86 |
|
|
-event_link("systemd-default", $event, "05"); |
87 |
|
|
event_link("rotate_timestamped_logfiles", $event, "05"); |
88 |
|
|
event_link("init-accounts", $event, "05"); |
89 |
|
|
event_link("conf-startup", $event, "10"); |
90 |
|
|
@@ -473,6 +471,7 @@ |
91 |
|
|
event_link("conf-modules", $event, "30"); |
92 |
|
|
event_link("create-mnt-floppy", $event, "50"); |
93 |
|
|
event_link("copy-anaconda-logs", $event, "90"); |
94 |
|
|
+event_link("systemd-default", $event, "88"); |
95 |
|
|
event_link("systemd-reload", $event, "89"); |
96 |
|
|
|
97 |
|
|
#-------------------------------------------------- |
98 |
|
|
@@ -481,7 +480,6 @@ |
99 |
|
|
|
100 |
|
|
$event = "reboot"; |
101 |
|
|
|
102 |
|
|
-event_link("systemd-default", $event, "05"); |
103 |
|
|
safe_symlink("stop", "root/etc/e-smith/events/$event/services2adjust/wan"); |
104 |
|
|
event_link("reboot", $event, "99"); |
105 |
|
|
|
106 |
|
|
@@ -492,6 +490,8 @@ |
107 |
|
|
$event = "remoteaccess-update"; |
108 |
|
|
|
109 |
|
|
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/dhcpd"); |
110 |
|
|
+event_link("systemd-default", $event, "88"); |
111 |
|
|
+event_link("systemd-reload", $event, "89"); |
112 |
|
|
|
113 |
|
|
#-------------------------------------------------- |
114 |
|
|
# actions for user-create event |
115 |
|
|
@@ -613,6 +613,16 @@ |
116 |
|
|
# important one), and restart server |
117 |
|
|
#-------------------------------------------------- |
118 |
|
|
$event = "email-update"; |
119 |
|
|
+event_link("systemd-default", $event, "88"); |
120 |
|
|
+event_link("systemd-reload", $event, "89"); |
121 |
|
|
+ |
122 |
|
|
+#-------------------------------------------------- |
123 |
|
|
+# actions for webapps-update event |
124 |
|
|
+#-------------------------------------------------- |
125 |
|
|
+ |
126 |
|
|
+$event = "webapps-update"; |
127 |
|
|
+event_link("systemd-default", $event, "88"); |
128 |
|
|
+event_link("systemd-reload", $event, "89"); |
129 |
|
|
|
130 |
|
|
|
131 |
|
|
# Set up links to daemontools. |
132 |
|
|
@@ -648,6 +658,13 @@ |
133 |
|
|
or die "Can't symlink to root/usr/lib/systemd/system/$target.target.wants/$unit: $!"; |
134 |
|
|
} |
135 |
|
|
} |
136 |
|
|
+ |
137 |
|
|
+foreach my $target (qw(halt reboot shutdown)) |
138 |
|
|
+{ |
139 |
|
|
+ $unit="bootstrap-fix.service"; |
140 |
|
|
+ safe_symlink("../$unit", "root/usr/lib/systemd/system/$target.target.wants/$unit"); |
141 |
|
|
+} |
142 |
|
|
+ |
143 |
|
|
$unit="bootstrap-console.service"; |
144 |
|
|
$target="basic"; |
145 |
|
|
symlink("../$unit", |
146 |
|
|
diff -Nur e-smith-base-5.8.0.old/root/etc/e-smith/events/actions/systemd-default e-smith-base-5.8.0/root/etc/e-smith/events/actions/systemd-default |
147 |
|
|
--- e-smith-base-5.8.0.old/root/etc/e-smith/events/actions/systemd-default 2021-02-18 12:02:54.192000000 -0500 |
148 |
|
|
+++ e-smith-base-5.8.0/root/etc/e-smith/events/actions/systemd-default 2021-02-18 12:10:24.588000000 -0500 |
149 |
|
|
@@ -22,6 +22,19 @@ |
150 |
|
|
my %files; |
151 |
|
|
my @WantedBy; |
152 |
|
|
|
153 |
|
|
+# expand preset file |
154 |
|
|
+esmith::templates::processTemplate({ |
155 |
|
|
+ MORE_DATA => { }, |
156 |
|
|
+ TEMPLATE_PATH => $filename, |
157 |
|
|
+ OUTPUT_FILENAME => $filename, |
158 |
|
|
+ }); |
159 |
|
|
+# expand content of sme-server.target.d |
160 |
|
|
+esmith::templates::processTemplate({ |
161 |
|
|
+ MORE_DATA => { }, |
162 |
|
|
+ TEMPLATE_PATH => $filename2, |
163 |
|
|
+ OUTPUT_FILENAME => $filename2, |
164 |
|
|
+ }); |
165 |
|
|
+ |
166 |
|
|
# make sure our target is enabled |
167 |
|
|
system("/usr/bin/systemctl enable sme-server.target"); |
168 |
|
|
# force the main default target in /usr/lib |
169 |
|
|
@@ -38,6 +51,7 @@ |
170 |
|
|
die("Can't create symlink \"$new_qfn\": $!\n"); |
171 |
|
|
} |
172 |
|
|
} |
173 |
|
|
+ |
174 |
|
|
# we let the dedicated systemd command tryin to do what we will do later in this script |
175 |
|
|
# as up to systemd 236 it is bugged see: |
176 |
|
|
# https://github.com/systemd/systemd/pull/7158 and https://github.com/systemd/systemd/pull/7289 |
177 |
|
|
@@ -45,19 +59,6 @@ |
178 |
|
|
# in case preset-all messed up with our default target |
179 |
|
|
system("/usr/bin/systemctl set-default sme-server.target"); |
180 |
|
|
|
181 |
|
|
- |
182 |
|
|
-esmith::templates::processTemplate({ |
183 |
|
|
- MORE_DATA => { }, |
184 |
|
|
- TEMPLATE_PATH => $filename, |
185 |
|
|
- OUTPUT_FILENAME => $filename, |
186 |
|
|
- }); |
187 |
|
|
-esmith::templates::processTemplate({ |
188 |
|
|
- MORE_DATA => { }, |
189 |
|
|
- TEMPLATE_PATH => $filename2, |
190 |
|
|
- OUTPUT_FILENAME => $filename2, |
191 |
|
|
- }); |
192 |
|
|
- |
193 |
|
|
- |
194 |
|
|
# list both preset directories |
195 |
|
|
# seek files to be removed from usr/lib if same basename exist |
196 |
|
|
foreach my $d (@presetdirpaths) { |
197 |
|
|
@@ -165,7 +166,6 @@ |
198 |
|
|
} |
199 |
|
|
} |
200 |
|
|
|
201 |
|
|
- |
202 |
|
|
# and we add wanted enabled services |
203 |
|
|
# we only do it for sme-server.target, ignoring the remaining of WantedBy |
204 |
|
|
foreach my $service (sort keys %services) { |
205 |
|
|
@@ -183,8 +183,6 @@ |
206 |
|
|
} |
207 |
|
|
} |
208 |
|
|
|
209 |
|
|
- |
210 |
|
|
- |
211 |
|
|
# do something about /usr/lib/systemd/system/sme-server.target.wants/ |
212 |
|
|
# we check for rpm owned and not rpm owned |
213 |
|
|
# we only inform there, we do not do anything else |
214 |
|
|
diff -Nur e-smith-base-5.8.0.old/root/sbin/e-smith/bootstrap-console e-smith-base-5.8.0/root/sbin/e-smith/bootstrap-console |
215 |
|
|
--- e-smith-base-5.8.0.old/root/sbin/e-smith/bootstrap-console 2021-02-18 12:02:53.985000000 -0500 |
216 |
|
|
+++ e-smith-base-5.8.0/root/sbin/e-smith/bootstrap-console 2021-02-18 12:07:44.266000000 -0500 |
217 |
|
|
@@ -51,11 +51,6 @@ |
218 |
|
|
esmith::console::save_config->new->doit($console, $db); |
219 |
|
|
} |
220 |
|
|
|
221 |
|
|
-$ARGV[0] = 'tty'; |
222 |
|
|
-$console = esmith::console->new(); |
223 |
|
|
-use esmith::console::startup; |
224 |
|
|
-esmith::console::startup->new->doit($console,$db); |
225 |
|
|
- |
226 |
|
|
system("/usr/bin/tput", "clear"); |
227 |
|
|
exit (0); |
228 |
|
|
|
229 |
|
|
diff -Nur e-smith-base-5.8.0.old/root/usr/lib/systemd/system/bootstrap-fix.service e-smith-base-5.8.0/root/usr/lib/systemd/system/bootstrap-fix.service |
230 |
|
|
--- e-smith-base-5.8.0.old/root/usr/lib/systemd/system/bootstrap-fix.service 1969-12-31 19:00:00.000000000 -0500 |
231 |
|
|
+++ e-smith-base-5.8.0/root/usr/lib/systemd/system/bootstrap-fix.service 2021-02-18 13:01:09.688000000 -0500 |
232 |
|
|
@@ -0,0 +1,13 @@ |
233 |
|
|
+[Unit] |
234 |
|
|
+Description=SME server bootup fix |
235 |
|
|
+DefaultDependencies=no |
236 |
|
|
+ |
237 |
|
|
+[Service] |
238 |
|
|
+Environment=HOME=/root |
239 |
|
|
+WorkingDirectory=/root |
240 |
|
|
+ExecStart=/etc/e-smith/events/actions/systemd-default |
241 |
|
|
+Type=oneshot |
242 |
|
|
+ |
243 |
|
|
+[Install] |
244 |
|
|
+WantedBy=basic.target reboot.target shutdown.target halt.target |
245 |
|
|
+ |