/[smeserver]/rpms/e-smith-samba/sme10/e-smith-samba-2.6.0-bz11118-bz11117-bz11157-systemd-update.patch
ViewVC logotype

Contents of /rpms/e-smith-samba/sme10/e-smith-samba-2.6.0-bz11118-bz11117-bz11157-systemd-update.patch

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


Revision 1.1 - (show annotations) (download)
Sat Jan 2 04:32:48 2021 UTC (3 years, 5 months ago) by jpp
Branch: MAIN
CVS Tags: e-smith-samba-2_6_0-14_el7_sme
* Fri Jan 01 2021 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-14.sme
- migrate nmbd to systemd [SME: 11118]
- migrate smbd to systemd [SME: 11117]
  create generik smb.service service
- create e-smith-samba-update event [SME: 11157]

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,22 @@
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 +
151 +[Install]
152 +WantedBy=sme-server.target
153 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
154 --- 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
155 +++ e-smith-samba-2.6.0/root/usr/lib/systemd/system/nmb.service.d/50koozali.conf 2021-01-01 23:00:56.573000000 -0500
156 @@ -0,0 +1,10 @@
157 +# disabled as conlfict with KOOZALI SME SERVER samba
158 +[Service]
159 +Type=oneshot
160 +ExecStart=
161 +ExecStart=/bin/false
162 +ExecReload=
163 +
164 +[Install]
165 +WantedBy=
166 +
167 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
168 --- e-smith-samba-2.6.0.old/root/usr/lib/systemd/system/smbd.service 1969-12-31 19:00:00.000000000 -0500
169 +++ e-smith-samba-2.6.0/root/usr/lib/systemd/system/smbd.service 2021-01-01 22:55:00.045000000 -0500
170 @@ -0,0 +1,27 @@
171 +[Unit]
172 +Description=Samba SMB Daemon
173 +Documentation=man:smbd(8) man:samba(7) man:smb.conf(5)
174 +Wants=network-online.target
175 +After=network.target network-online.target nmb.service winbind.service
176 +# When systemd stops or restarts the smb.service, the action is propagated to this unit
177 +PartOf=smb.service
178 +# Start this unit after the smb.service start
179 +After=smb.service
180 +
181 +[Service]
182 +Type=notify
183 +NotifyAccess=all
184 +PIDFile=/run/smbd.pid
185 +LimitNOFILE=16384
186 +EnvironmentFile=-/etc/sysconfig/samba
187 +ExecStartPre=/sbin/e-smith/service-status smbd
188 +ExecStartPre=-/sbin/e-smith/expand-template /etc/samba/smb.conf
189 +ExecStartPre=-/sbin/e-smith/expand-template /etc/samba/smbusers
190 +ExecStartPre=/sbin/e-smith/systemd/smbd-prepare
191 +ExecStart=/usr/sbin/smbd --foreground --no-process-group $SMBDOPTIONS
192 +ExecReload=/bin/kill -HUP $MAINPID
193 +LimitCORE=infinity
194 +Environment=KRB5CCNAME=FILE:/run/samba/krb5cc_samba
195 +
196 +[Install]
197 +WantedBy=sme-server.target
198 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
199 --- 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
200 +++ e-smith-samba-2.6.0/root/usr/lib/systemd/system/smb.service.d/50koozali.conf 2021-01-01 23:04:31.977000000 -0500
201 @@ -0,0 +1,25 @@
202 +[Unit]
203 +Description=Samba SMB Daemon global service for Koozali SME Server
204 +
205 +[Service]
206 +Type=oneshot
207 +NotifyAccess=
208 +PIDFile=
209 +LimitNOFILE=
210 +EnvironmentFile=
211 +ExecStartPre=/sbin/e-smith/service-status smb
212 +ExecStartPre=-/sbin/e-smith/expand-template /etc/samba/smb.conf
213 +ExecStartPre=-/sbin/e-smith/expand-template /etc/samba/smbusers
214 +ExecStart=
215 +# Execute a dummy program
216 +ExecStart=/bin/true
217 +
218 +ExecReload=
219 +LimitCORE=
220 +# This service shall be considered active after start
221 +RemainAfterExit=yes
222 +
223 +[Install]
224 +WantedBy=
225 +WantedBy=sme-server.target
226 +

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