1 |
diff -Nur e-smith-samba-2.6.0.old/createlinks e-smith-samba-2.6.0/createlinks |
2 |
--- e-smith-samba-2.6.0.old/createlinks 2021-01-01 18:57:02.072000000 -0500 |
3 |
+++ e-smith-samba-2.6.0/createlinks 2021-01-01 23:24:12.627000000 -0500 |
4 |
@@ -19,6 +19,7 @@ |
5 |
post-install |
6 |
post-upgrade |
7 |
workgroup-update |
8 |
+ e-smith-samba-update |
9 |
)); |
10 |
} |
11 |
|
12 |
@@ -27,11 +28,11 @@ |
13 |
/etc/krb5.conf |
14 |
)) |
15 |
{ |
16 |
- templates2events($file, qw(console-save bootstrap-console-save)); |
17 |
+ templates2events($file, qw(console-save bootstrap-console-save e-smith-samba-update)); |
18 |
} |
19 |
|
20 |
foreach (qw(console-save bootstrap-console-save bootstrap-ldap-save |
21 |
- post-install post-upgrade workgroup-update)) |
22 |
+ post-install post-upgrade workgroup-update e-smith-samba-update)) |
23 |
{ |
24 |
event_link('store-ldap-smbpasswd', $_, "06"); |
25 |
} |
26 |
@@ -111,11 +112,10 @@ |
27 |
$event = "pre-restore"; |
28 |
event_link("delete-smbpasswd", $event, "90"); |
29 |
|
30 |
-# Link smbd and nmbd to daemontools. |
31 |
-safe_symlink("daemontools", "root/etc/rc.d/init.d/smbd"); |
32 |
-safe_symlink("daemontools", "root/etc/rc.d/init.d/nmbd"); |
33 |
- |
34 |
-safe_symlink("../init.d/supervise/smb", "root/etc/rc.d/rc7.d/S91smb"); |
35 |
-safe_symlink("../init.d/supervise/smb", "root/etc/rc.d/rc6.d/K35smb"); |
36 |
-safe_symlink("../init.d/supervise/smb", "root/etc/rc.d/rc1.d/K35smb"); |
37 |
-safe_symlink("../init.d/supervise/smb", "root/etc/rc.d/rc0.d/K35smb"); |
38 |
+$event = "e-smith-samba-update"; |
39 |
+event_link("user-create-profiledir", $event, "20"); |
40 |
+safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/smbd"); |
41 |
+safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/nmbd"); |
42 |
+# systemd-specific action mandatory for this package-update event |
43 |
+event_link("systemd-reload", $event, "89"); |
44 |
+event_link("systemd-default", $event, "88"); |
45 |
diff -Nur e-smith-samba-2.6.0.old/root/sbin/e-smith/systemd/nmbd-prepare e-smith-samba-2.6.0/root/sbin/e-smith/systemd/nmbd-prepare |
46 |
--- e-smith-samba-2.6.0.old/root/sbin/e-smith/systemd/nmbd-prepare 1969-12-31 19:00:00.000000000 -0500 |
47 |
+++ e-smith-samba-2.6.0/root/sbin/e-smith/systemd/nmbd-prepare 2021-01-01 22:52:33.288000000 -0500 |
48 |
@@ -0,0 +1,31 @@ |
49 |
+#!/bin/sh |
50 |
+ |
51 |
+# Source networking configuration. |
52 |
+. /etc/sysconfig/network |
53 |
+ |
54 |
+#if [ -f /etc/sysconfig/samba ]; then |
55 |
+# . /etc/sysconfig/samba |
56 |
+#fi |
57 |
+# We currently don't care about /etc/sysconfig/samba, but that may change. |
58 |
+ |
59 |
+status=$(/sbin/e-smith/config getprop smb status) |
60 |
+if [ "$status" = "disabled" ] |
61 |
+then |
62 |
+ /sbin/e-smith/config setprop nmbd status disabled |
63 |
+ exit 1 |
64 |
+fi |
65 |
+ |
66 |
+nmbd=/usr/sbin/nmbd |
67 |
+ |
68 |
+[ -f $nmbd ] || exit 1 |
69 |
+ |
70 |
+# Check that networking is up. |
71 |
+[ ${NETWORKING} = "no" ] && exit 1 |
72 |
+ |
73 |
+# Check that smb.conf exists. |
74 |
+[ -f /etc/samba/smb.conf ] || exit 1 |
75 |
+ |
76 |
+# Check that we can write to it... so non-root users stop here |
77 |
+[ -w /etc/samba/smb.conf ] || exit 1 |
78 |
+ |
79 |
+exit 0 |
80 |
diff -Nur e-smith-samba-2.6.0.old/root/sbin/e-smith/systemd/smbd-prepare e-smith-samba-2.6.0/root/sbin/e-smith/systemd/smbd-prepare |
81 |
--- e-smith-samba-2.6.0.old/root/sbin/e-smith/systemd/smbd-prepare 1969-12-31 19:00:00.000000000 -0500 |
82 |
+++ e-smith-samba-2.6.0/root/sbin/e-smith/systemd/smbd-prepare 2021-01-01 22:52:39.807000000 -0500 |
83 |
@@ -0,0 +1,43 @@ |
84 |
+#!/bin/sh |
85 |
+ |
86 |
+# Source networking configuration. |
87 |
+. /etc/sysconfig/network |
88 |
+ |
89 |
+#if [ -f /etc/sysconfig/samba ]; then |
90 |
+# . /etc/sysconfig/samba |
91 |
+#fi |
92 |
+# We currently don't care about /etc/sysconfig/samba, but that may change. |
93 |
+ |
94 |
+ldapauth=$(/sbin/e-smith/config getprop ldap Authentication || echo disabled) |
95 |
+ |
96 |
+status=$(/sbin/e-smith/config getprop smb status) |
97 |
+if [ "$status" = "disabled" ] |
98 |
+then |
99 |
+ /sbin/e-smith/config setprop smbd status disabled |
100 |
+ exit 1 |
101 |
+fi |
102 |
+ |
103 |
+smbd=/usr/sbin/smbd |
104 |
+ |
105 |
+[ -f $smbd ] || exit 1 |
106 |
+ |
107 |
+# Check that networking is up. |
108 |
+[ ${NETWORKING} = "no" ] && exit 1 |
109 |
+ |
110 |
+# Check that smb.conf exists. |
111 |
+[ -f /etc/samba/smb.conf ] || exit 1 |
112 |
+ |
113 |
+# Check that we can write to it... so non-root users stop here |
114 |
+[ -w /etc/samba/smb.conf ] || exit 1 |
115 |
+ |
116 |
+# Delete the printing.tdb file if it exists to force it to rebuild. |
117 |
+rm -f /var/cache/samba/printing.tdb |
118 |
+ |
119 |
+# Backup critical tdb files |
120 |
+for tdb in /etc/samba/*.tdb \ |
121 |
+ /var/lib/samba/*.tdb |
122 |
+do |
123 |
+ [ -r "$tdb" ] && tdbbackup -l "$tdb" .bak |
124 |
+done |
125 |
+ |
126 |
+exit 0 |
127 |
diff -Nur e-smith-samba-2.6.0.old/root/usr/lib/systemd/system/nmbd.service e-smith-samba-2.6.0/root/usr/lib/systemd/system/nmbd.service |
128 |
--- e-smith-samba-2.6.0.old/root/usr/lib/systemd/system/nmbd.service 1969-12-31 19:00:00.000000000 -0500 |
129 |
+++ e-smith-samba-2.6.0/root/usr/lib/systemd/system/nmbd.service 2021-01-01 22:59:33.744000000 -0500 |
130 |
@@ -0,0 +1,23 @@ |
131 |
+[Unit] |
132 |
+# When systemd stops or restarts the smb.service, the action is propagated to this unit |
133 |
+PartOf=smb.service |
134 |
+# Start this unit after the smb.service start |
135 |
+After=smb.service |
136 |
+ |
137 |
+[Service] |
138 |
+Type=notify |
139 |
+NotifyAccess=all |
140 |
+PIDFile=/run/nmbd.pid |
141 |
+EnvironmentFile=-/etc/sysconfig/samba |
142 |
+ExecStartPre=/sbin/e-smith/service-status nmbd |
143 |
+ExecStartPre=-/sbin/e-smith/expand-template /etc/samba/smb.conf |
144 |
+ExecStartPre=-/sbin/e-smith/expand-template /etc/samba/smbusers |
145 |
+ExecStartPre=/sbin/e-smith/systemd/nmbd-prepare |
146 |
+ExecStart=/usr/sbin/nmbd --foreground --no-process-group $NMBDOPTIONS |
147 |
+ExecReload=/bin/kill -HUP $MAINPID |
148 |
+LimitCORE=infinity |
149 |
+Environment=KRB5CCNAME=FILE:/run/samba/krb5cc_samba |
150 |
+Restart=always |
151 |
+ |
152 |
+[Install] |
153 |
+WantedBy=sme-server.target |
154 |
diff -Nur e-smith-samba-2.6.0.old/root/usr/lib/systemd/system/nmb.service.d/50koozali.conf e-smith-samba-2.6.0/root/usr/lib/systemd/system/nmb.service.d/50koozali.conf |
155 |
--- e-smith-samba-2.6.0.old/root/usr/lib/systemd/system/nmb.service.d/50koozali.conf 1969-12-31 19:00:00.000000000 -0500 |
156 |
+++ e-smith-samba-2.6.0/root/usr/lib/systemd/system/nmb.service.d/50koozali.conf 2021-01-01 23:00:56.573000000 -0500 |
157 |
@@ -0,0 +1,10 @@ |
158 |
+# disabled as conlfict with KOOZALI SME SERVER samba |
159 |
+[Service] |
160 |
+Type=oneshot |
161 |
+ExecStart= |
162 |
+ExecStart=/bin/false |
163 |
+ExecReload= |
164 |
+ |
165 |
+[Install] |
166 |
+WantedBy= |
167 |
+ |
168 |
diff -Nur e-smith-samba-2.6.0.old/root/usr/lib/systemd/system/smbd.service e-smith-samba-2.6.0/root/usr/lib/systemd/system/smbd.service |
169 |
--- e-smith-samba-2.6.0.old/root/usr/lib/systemd/system/smbd.service 1969-12-31 19:00:00.000000000 -0500 |
170 |
+++ e-smith-samba-2.6.0/root/usr/lib/systemd/system/smbd.service 2021-01-01 22:55:00.045000000 -0500 |
171 |
@@ -0,0 +1,28 @@ |
172 |
+[Unit] |
173 |
+Description=Samba SMB Daemon |
174 |
+Documentation=man:smbd(8) man:samba(7) man:smb.conf(5) |
175 |
+Wants=network-online.target |
176 |
+After=network.target network-online.target nmb.service winbind.service |
177 |
+# When systemd stops or restarts the smb.service, the action is propagated to this unit |
178 |
+PartOf=smb.service |
179 |
+# Start this unit after the smb.service start |
180 |
+After=smb.service |
181 |
+ |
182 |
+[Service] |
183 |
+Type=notify |
184 |
+NotifyAccess=all |
185 |
+PIDFile=/run/smbd.pid |
186 |
+LimitNOFILE=16384 |
187 |
+EnvironmentFile=-/etc/sysconfig/samba |
188 |
+ExecStartPre=/sbin/e-smith/service-status smbd |
189 |
+ExecStartPre=-/sbin/e-smith/expand-template /etc/samba/smb.conf |
190 |
+ExecStartPre=-/sbin/e-smith/expand-template /etc/samba/smbusers |
191 |
+ExecStartPre=/sbin/e-smith/systemd/smbd-prepare |
192 |
+ExecStart=/usr/sbin/smbd --foreground --no-process-group $SMBDOPTIONS |
193 |
+ExecReload=/bin/kill -HUP $MAINPID |
194 |
+LimitCORE=infinity |
195 |
+Environment=KRB5CCNAME=FILE:/run/samba/krb5cc_samba |
196 |
+Restart=always |
197 |
+ |
198 |
+[Install] |
199 |
+WantedBy=sme-server.target |
200 |
diff -Nur e-smith-samba-2.6.0.old/root/usr/lib/systemd/system/smb.service.d/50koozali.conf e-smith-samba-2.6.0/root/usr/lib/systemd/system/smb.service.d/50koozali.conf |
201 |
--- e-smith-samba-2.6.0.old/root/usr/lib/systemd/system/smb.service.d/50koozali.conf 1969-12-31 19:00:00.000000000 -0500 |
202 |
+++ e-smith-samba-2.6.0/root/usr/lib/systemd/system/smb.service.d/50koozali.conf 2021-01-01 23:04:31.977000000 -0500 |
203 |
@@ -0,0 +1,25 @@ |
204 |
+[Unit] |
205 |
+Description=Samba SMB Daemon global service for Koozali SME Server |
206 |
+ |
207 |
+[Service] |
208 |
+Type=oneshot |
209 |
+#NotifyAccess= |
210 |
+#PIDFile= |
211 |
+#LimitNOFILE= |
212 |
+#EnvironmentFile= |
213 |
+ExecStartPre=/sbin/e-smith/service-status smb |
214 |
+ExecStartPre=-/sbin/e-smith/expand-template /etc/samba/smb.conf |
215 |
+ExecStartPre=-/sbin/e-smith/expand-template /etc/samba/smbusers |
216 |
+ExecStart= |
217 |
+# Execute a dummy program |
218 |
+ExecStart=/bin/true |
219 |
+ |
220 |
+ExecReload= |
221 |
+#LimitCORE= |
222 |
+# This service shall be considered active after start |
223 |
+RemainAfterExit=yes |
224 |
+ |
225 |
+[Install] |
226 |
+WantedBy= |
227 |
+WantedBy=sme-server.target |
228 |
+ |