1 |
commit: 144dd19d2673d21893ab31bda4651de7efc66d1c |
2 |
Author: Wes Cilldhaire <wes <AT> sol1 <DOT> com <DOT> au> |
3 |
AuthorDate: Tue Mar 1 03:03:14 2016 +0000 |
4 |
Commit: Ian Delaney <idella4 <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Mar 1 03:03:14 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=144dd19d |
7 |
|
8 |
net-nds/389-ds-base: Version bump to 1.3.4.8 |
9 |
|
10 |
Deps on db4.8 specifically, being the current stable, instead of |
11 |
trying to determine best installed version <6 at configure time, as |
12 |
discussed with various devs on irc. |
13 |
|
14 |
Additionally, 1.3.4.7 is vuln to CVE-2016-0741 and will be removed |
15 |
in the next commit. Upstream has advised that they will not be |
16 |
providing a patch against 1.3.4.7 and request users to upgrade |
17 |
to 1.3.4.8 |
18 |
|
19 |
Acked-by: wibrown <AT> redhat.com |
20 |
|
21 |
Package-Manager: portage-2.2.27 |
22 |
|
23 |
net-nds/389-ds-base/389-ds-base-1.3.4.8.ebuild | 143 ++++++++ |
24 |
net-nds/389-ds-base/Manifest | 1 + |
25 |
.../389-ds-base-1.3.4-no-instance-script.patch | 396 +++++++++++++++++++++ |
26 |
3 files changed, 540 insertions(+) |
27 |
|
28 |
diff --git a/net-nds/389-ds-base/389-ds-base-1.3.4.8.ebuild b/net-nds/389-ds-base/389-ds-base-1.3.4.8.ebuild |
29 |
new file mode 100644 |
30 |
index 0000000..02ee08a |
31 |
--- /dev/null |
32 |
+++ b/net-nds/389-ds-base/389-ds-base-1.3.4.8.ebuild |
33 |
@@ -0,0 +1,143 @@ |
34 |
+# Copyright 1999-2016 Gentoo Foundation |
35 |
+# Distributed under the terms of the GNU General Public License v2 |
36 |
+# $Id$ |
37 |
+ |
38 |
+EAPI=5 |
39 |
+ |
40 |
+WANT_AUTOMAKE="1.9" |
41 |
+ |
42 |
+inherit user eutils multilib flag-o-matic autotools |
43 |
+ |
44 |
+DESCRIPTION="389 Directory Server (core librares and daemons )" |
45 |
+HOMEPAGE="http://port389.org/" |
46 |
+SRC_URI="http://directory.fedoraproject.org/sources/${P}.tar.bz2" |
47 |
+ |
48 |
+LICENSE="GPL-3" |
49 |
+SLOT="0" |
50 |
+KEYWORDS="~amd64 ~x86" |
51 |
+IUSE="autobind auto-dn-suffix debug doc +pam-passthru +dna +ldapi +bitwise +presence kerberos selinux" |
52 |
+ |
53 |
+# Pinned to db:4.8 as it is the current stable, can change to a later db version < 6 when they stabilize. |
54 |
+# The --with-db-inc line in econf will need to be updated as well when changing db version. |
55 |
+COMMON_DEPEND=" |
56 |
+ sys-libs/db:4.8 |
57 |
+ >=dev-libs/cyrus-sasl-2.1.19 |
58 |
+ >=net-analyzer/net-snmp-5.1.2 |
59 |
+ >=dev-libs/icu-3.4:= |
60 |
+ dev-libs/nss[utils] |
61 |
+ dev-libs/nspr |
62 |
+ dev-libs/svrcore |
63 |
+ dev-libs/openssl:0= |
64 |
+ dev-libs/libpcre:3 |
65 |
+ >=dev-perl/perl-mozldap-1.5.3 |
66 |
+ dev-perl/NetAddr-IP |
67 |
+ net-nds/openldap |
68 |
+ sys-libs/pam |
69 |
+ sys-libs/zlib |
70 |
+ kerberos? ( >=app-crypt/mit-krb5-1.7-r100[openldap] )" |
71 |
+ |
72 |
+DEPEND="${COMMON_DEPEND} |
73 |
+ virtual/pkgconfig |
74 |
+ sys-devel/libtool |
75 |
+ doc? ( app-doc/doxygen ) |
76 |
+ sys-apps/sed" |
77 |
+RDEPEND="${COMMON_DEPEND} |
78 |
+ selinux? ( sec-policy/selinux-dirsrv ) |
79 |
+ virtual/perl-Time-Local |
80 |
+ virtual/perl-MIME-Base64" |
81 |
+ |
82 |
+pkg_setup() { |
83 |
+ enewgroup dirsrv |
84 |
+ enewuser dirsrv -1 -1 -1 dirsrv |
85 |
+} |
86 |
+ |
87 |
+src_prepare() { |
88 |
+ #0001-Ticket-47840-add-configure-option-to-disable-instanc.patch |
89 |
+ epatch "${FILESDIR}/389-ds-base-1.3.4-no-instance-script.patch" |
90 |
+ |
91 |
+ # as per 389 documentation, when 64bit, export USE_64 |
92 |
+ use amd64 && export USE_64=1 |
93 |
+ |
94 |
+ # This will be changed in 1.3.5.X |
95 |
+ sed -i -e 's/nobody/dirsrv/g' configure.ac || die "sed failed on configure.ac" |
96 |
+ eautoreconf |
97 |
+ |
98 |
+ append-lfs-flags |
99 |
+} |
100 |
+ |
101 |
+src_configure() { |
102 |
+ local myconf="" |
103 |
+ |
104 |
+ # for 1.3.5.X, will add --enable-gcc-security. |
105 |
+ # auto-dn-suffix currently throws warning in configure script, |
106 |
+ # see https://fedorahosted.org/389/ticket/48710 |
107 |
+ econf \ |
108 |
+ $(use_enable debug) \ |
109 |
+ $(use_enable pam-passthru) \ |
110 |
+ $(use_enable ldapi) \ |
111 |
+ $(use_enable autobind) \ |
112 |
+ $(use_enable dna) \ |
113 |
+ $(use_enable bitwise) \ |
114 |
+ $(use_enable presence) \ |
115 |
+ $(use_with kerberos) \ |
116 |
+ $(use_enable debug) \ |
117 |
+ $(use_enable auto-dn-suffix) \ |
118 |
+ --enable-maintainer-mode \ |
119 |
+ --with-fhs \ |
120 |
+ --with-openldap \ |
121 |
+ --sbindir=/usr/sbin \ |
122 |
+ --bindir=/usr/bin \ |
123 |
+ --with-db-inc=/usr/include/db4.8 |
124 |
+ |
125 |
+} |
126 |
+ |
127 |
+src_compile() { |
128 |
+ default |
129 |
+ if use doc; then |
130 |
+ doxygen slapi.doxy || die "cannot run doxygen" |
131 |
+ fi |
132 |
+} |
133 |
+ |
134 |
+src_install () { |
135 |
+ emake DESTDIR="${D}" install |
136 |
+ |
137 |
+ # remove redhat style init script |
138 |
+ rm -rf "${D}"/etc/rc.d || die |
139 |
+ # Needs a config option to remove this. |
140 |
+ rm -rf "${D}"/etc/default || die |
141 |
+ |
142 |
+ # and install gentoo style init script |
143 |
+ # Get these merged upstream |
144 |
+ newinitd "${FILESDIR}"/389-ds.initd-r1 389-ds |
145 |
+ newinitd "${FILESDIR}"/389-ds-snmp.initd 389-ds-snmp |
146 |
+ |
147 |
+ # cope with libraries being in /usr/lib/dirsrv |
148 |
+ dodir /etc/env.d |
149 |
+ echo "LDPATH=/usr/$(get_libdir)/dirsrv" > "${D}"/etc/env.d/08dirsrv |
150 |
+ |
151 |
+ if use doc; then |
152 |
+ cd "${S}" || die |
153 |
+ docinto html/ |
154 |
+ dodoc -r docs/html/. |
155 |
+ fi |
156 |
+} |
157 |
+ |
158 |
+pkg_postinst() { |
159 |
+ echo |
160 |
+ elog "If you are planning to use 389-ds-snmp (ldap-agent)," |
161 |
+ elog "make sure to properly configure: /etc/dirsrv/config/ldap-agent.conf" |
162 |
+ elog "adding proper 'server' entries, and adding the lines below to" |
163 |
+ elog " => /etc/snmp/snmpd.conf" |
164 |
+ elog |
165 |
+ elog "master agentx" |
166 |
+ elog "agentXSocket /var/agentx/master" |
167 |
+ elog |
168 |
+ elog "To start 389 Directory Server (LDAP service) at boot:" |
169 |
+ elog |
170 |
+ elog " rc-update add 389-ds default" |
171 |
+ elog |
172 |
+ elog "If you are upgrading from previous 1.2.6 release candidates" |
173 |
+ elog "please see:" |
174 |
+ elog "http://directory.fedoraproject.org/wiki/Subtree_Rename#warning:_upgrade_from_389_v1.2.6_.28a.3F.2C_rc1_.7E_rc6.29_to_v1.2.6_rc6_or_newer" |
175 |
+ echo |
176 |
+} |
177 |
|
178 |
diff --git a/net-nds/389-ds-base/Manifest b/net-nds/389-ds-base/Manifest |
179 |
index 57022ec..1d77e26 100644 |
180 |
--- a/net-nds/389-ds-base/Manifest |
181 |
+++ b/net-nds/389-ds-base/Manifest |
182 |
@@ -1 +1,2 @@ |
183 |
DIST 389-ds-base-1.3.4.7.tar.bz2 3397520 SHA256 08dae55ed0732e8d316bb65910c74ee913fc215c3436299239e362a3670e76e6 SHA512 02159ce8e9d1e5797d6d6952202b430429bf750179279348430333f7a4b557e305a2041a1e4e7ffe652d34825c9678d3fbf8a3eaea401f257bd922034dbce875 WHIRLPOOL 97af90f6b3f01a2a11e236f1141d1851016711f69b618f2e3122715e8575541040aa09c03f66f7a20cca9e2136bb2d3612c8fcec16b616f981dba39c4f449453 |
184 |
+DIST 389-ds-base-1.3.4.8.tar.bz2 3396105 SHA256 a00468afcfa50de375f921a827a04dd53b6a11b632982bb0db98cafca509e701 SHA512 ac85223cb38d4cebb3ff61b23e3c0312b0cd30a0c6bf0d9644842c6ecfbc9379ea4a639c80b3e78a13a67f273342fec78e9ecf4672cc72e289d72d74c2fa0d8f WHIRLPOOL 4c7645be5b70c108ef437aaf6d50293a99fa6a552c859f649904c6974c8830e5bf96286a0f998c5d187c1f66f3e0922bbe1e756889e6b0a33e8d9db56f0aa005 |
185 |
|
186 |
diff --git a/net-nds/389-ds-base/files/389-ds-base-1.3.4-no-instance-script.patch b/net-nds/389-ds-base/files/389-ds-base-1.3.4-no-instance-script.patch |
187 |
new file mode 100644 |
188 |
index 0000000..8af7ad2 |
189 |
--- /dev/null |
190 |
+++ b/net-nds/389-ds-base/files/389-ds-base-1.3.4-no-instance-script.patch |
191 |
@@ -0,0 +1,396 @@ |
192 |
+From 7b75e7a4c60637a86acf6c757f207550294279ef Mon Sep 17 00:00:00 2001 |
193 |
+From: William Brown <wibrown@××××××.com> |
194 |
+Date: Wed, 28 Oct 2015 14:25:26 +1000 |
195 |
+Subject: [PATCH] Ticket 47840 - add configure option to disable instance |
196 |
+ specific scripts https://fedorahosted.org/389/ticket/47840 |
197 |
+MIME-Version: 1.0 |
198 |
+Content-Type: text/plain; charset=UTF-8 |
199 |
+Content-Transfer-Encoding: 8bit |
200 |
+ |
201 |
+Bug Description: Now that ​https://fedorahosted.org/389/ticket/528 is |
202 |
+fixed, the next step is to allow building the server with the instance specific |
203 |
+scripts disabled. |
204 |
+ |
205 |
+Fix Description: Instead of defining a configure option, we provide a new |
206 |
+option in setup-ds.pl, slapd.InstScriptsEnabled, which defaults to false. All |
207 |
+new installs of 389 will NOT install with a inst_dir nor the scripts that are in |
208 |
+that directory. |
209 |
+ |
210 |
+Additionally, this change fixes setup-ds.pl to correctly use the sbindir scripts |
211 |
+to start/stop the server instance during installation. |
212 |
+ |
213 |
+Finally, we add support for setup-ds.pl so that in --update if the inst_dir |
214 |
+exists, scripts will be updated, but if it does not exist, no action is taken. |
215 |
+ |
216 |
+In time, we will alter --update to *remove* the scripts within inst_dir during |
217 |
+the update (We have no way of knowing if a customer has put custom scripts in |
218 |
+inst_dir) |
219 |
+ |
220 |
+Example: |
221 |
+/opt/dirsrv/sbin/setup-ds.pl slapd.InstScriptsEnabled=false |
222 |
+ |
223 |
+Author: wibrown |
224 |
+ |
225 |
+Review by: nhosoi (Thanks!) |
226 |
+--- |
227 |
+ ldap/admin/src/scripts/DSCreate.pm.in | 204 +++++++++++++++++++-------------- |
228 |
+ ldap/admin/src/scripts/DSUpdate.pm.in | 12 +- |
229 |
+ ldap/admin/src/scripts/setup-ds.res.in | 1 + |
230 |
+ 3 files changed, 124 insertions(+), 93 deletions(-) |
231 |
+ |
232 |
+diff --git a/ldap/admin/src/scripts/DSCreate.pm.in b/ldap/admin/src/scripts/DSCreate.pm.in |
233 |
+index 3ce5a73..6425be4 100644 |
234 |
+--- a/ldap/admin/src/scripts/DSCreate.pm.in |
235 |
++++ b/ldap/admin/src/scripts/DSCreate.pm.in |
236 |
+@@ -130,6 +130,15 @@ sub sanityCheckParams { |
237 |
+ return @errs; |
238 |
+ } |
239 |
+ |
240 |
++ # We need to make sure this value is lowercase |
241 |
++ $inf->{slapd}->{InstScriptsEnabled} = lc $inf->{slapd}->{InstScriptsEnabled}; |
242 |
++ |
243 |
++ if ("true" ne $inf->{slapd}->{InstScriptsEnabled} && "false" ne $inf->{slapd}->{InstScriptsEnabled}) { |
244 |
++ debug(1, "InstScriptsEnabled is not a valid boolean"); |
245 |
++ return ('error_invalid_boolean', $inf->{slapd}->{InstScriptsEnabled}); |
246 |
++ } |
247 |
++ |
248 |
++ |
249 |
+ return (); |
250 |
+ } |
251 |
+ |
252 |
+@@ -204,13 +213,17 @@ sub makeDSDirs { |
253 |
+ my $mode = getMode($inf, 7); |
254 |
+ my @errs; |
255 |
+ |
256 |
++ my @dsdirs = qw(config_dir schema_dir log_dir lock_dir run_dir tmp_dir cert_dir db_dir ldif_dir bak_dir); |
257 |
++ if ($inf->{slapd}->{InstScriptsEnabled} eq "true") { |
258 |
++ @dsdirs = qw(inst_dir config_dir schema_dir log_dir lock_dir run_dir tmp_dir cert_dir db_dir ldif_dir bak_dir); |
259 |
++ } |
260 |
++ |
261 |
+ # These paths are owned by the SuiteSpotGroup |
262 |
+ # This allows the admin server to run as a different, |
263 |
+ # more privileged user than the directory server, but |
264 |
+ # still allows the admin server to manage directory |
265 |
+ # server files/dirs without being root |
266 |
+- for my $kw (qw(inst_dir config_dir schema_dir log_dir lock_dir run_dir tmp_dir |
267 |
+- cert_dir db_dir ldif_dir bak_dir)) { |
268 |
++ for my $kw (@dsdirs) { |
269 |
+ my $dir = $inf->{slapd}->{$kw}; |
270 |
+ @errs = makePaths($dir, $mode, $inf->{General}->{SuiteSpotUserID}, |
271 |
+ $inf->{General}->{SuiteSpotGroup}); |
272 |
+@@ -262,56 +275,66 @@ sub createInstanceScripts { |
273 |
+ my $myperl = "!$perlexec"; |
274 |
+ my $mydevnull = (-f "/dev/null" ? " /dev/null " : " NUL "); |
275 |
+ |
276 |
+- # determine initconfig_dir |
277 |
+- my $initconfig_dir = $inf->{slapd}->{initconfig_dir} || get_initconfigdir($inf->{General}->{prefix}); |
278 |
+- |
279 |
+- my %maptable = ( |
280 |
+- "DS-ROOT" => $inf->{General}->{prefix}, |
281 |
+- "SEP" => "/", # works on all platforms |
282 |
+- "SERVER-NAME" => $inf->{General}->{FullMachineName}, |
283 |
+- "SERVER-PORT" => $inf->{slapd}->{ServerPort}, |
284 |
+- "PERL-EXEC" => $myperl, |
285 |
+- "DEV-NULL" => $mydevnull, |
286 |
+- "ROOT-DN" => $inf->{slapd}->{RootDN}, |
287 |
+- "LDIF-DIR" => $inf->{slapd}->{ldif_dir}, |
288 |
+- "SERV-ID" => $inf->{slapd}->{ServerIdentifier}, |
289 |
+- "BAK-DIR" => $inf->{slapd}->{bak_dir}, |
290 |
+- "SERVER-DIR" => $inf->{General}->{ServerRoot}, |
291 |
+- "CONFIG-DIR" => $inf->{slapd}->{config_dir}, |
292 |
+- "INITCONFIG-DIR" => $initconfig_dir, |
293 |
+- "INST-DIR" => $inf->{slapd}->{inst_dir}, |
294 |
+- "RUN-DIR" => $inf->{slapd}->{run_dir}, |
295 |
+- "PRODUCT-NAME" => "slapd", |
296 |
+- "SERVERBIN-DIR" => $inf->{slapd}->{sbindir}, |
297 |
+- "DB-DIR" => $inf->{slapd}->{db_dir} |
298 |
+- ); |
299 |
+- |
300 |
+- my $dir = "$inf->{General}->{prefix}@taskdir@"; |
301 |
+- for my $file (glob("$dir/template-*")) { |
302 |
+- my $basename = $file; |
303 |
+- $basename =~ s/^.*template-//; |
304 |
+- my $destfile = "$inf->{slapd}->{inst_dir}/$basename"; |
305 |
+- |
306 |
+- next if ($skip and -f $destfile); # in skip mode, skip files that already exist |
307 |
+- |
308 |
+- if (!open(SRC, "< $file")) { |
309 |
+- return ("error_opening_scripttmpl", $file, $!); |
310 |
+- } |
311 |
+- if (!open(DEST, "> $destfile")) { |
312 |
+- return ("error_opening_scripttmpl", $destfile, $!); |
313 |
+- } |
314 |
+- my $contents; # slurp entire file into memory |
315 |
+- read SRC, $contents, int(-s $file); |
316 |
+- close(SRC); |
317 |
+- while (my ($key, $val) = each %maptable) { |
318 |
+- $contents =~ s/\{\{$key\}\}/$val/g; |
319 |
+- } |
320 |
+- print DEST $contents; |
321 |
+- close(DEST); |
322 |
+- my @errs = changeOwnerMode($inf, 5, $destfile); |
323 |
+- if (@errs) { |
324 |
+- return @errs; |
325 |
++ # If we have InstScriptsEnabled, we likely have setup.inf or the argument. |
326 |
++ # However, during an upgrade, we need to know if we should upgrade the template files or not. |
327 |
++ # For now, the easiest way is to check to if the directory exists, and if is does, we assume we want to upgrade / create the updated scripts. |
328 |
++ if ($inf->{slapd}->{InstScriptsEnabled} eq "true" || -d $inf->{slapd}->{inst_dir} ) { |
329 |
++ debug(1, "Creating or updating instance directory scripts\n"); |
330 |
++ # determine initconfig_dir |
331 |
++ my $initconfig_dir = $inf->{slapd}->{initconfig_dir} || get_initconfigdir($inf->{General}->{prefix}); |
332 |
++ |
333 |
++ my %maptable = ( |
334 |
++ "DS-ROOT" => $inf->{General}->{prefix}, |
335 |
++ "SEP" => "/", # works on all platforms |
336 |
++ "SERVER-NAME" => $inf->{General}->{FullMachineName}, |
337 |
++ "SERVER-PORT" => $inf->{slapd}->{ServerPort}, |
338 |
++ "PERL-EXEC" => $myperl, |
339 |
++ "DEV-NULL" => $mydevnull, |
340 |
++ "ROOT-DN" => $inf->{slapd}->{RootDN}, |
341 |
++ "LDIF-DIR" => $inf->{slapd}->{ldif_dir}, |
342 |
++ "SERV-ID" => $inf->{slapd}->{ServerIdentifier}, |
343 |
++ "BAK-DIR" => $inf->{slapd}->{bak_dir}, |
344 |
++ "SERVER-DIR" => $inf->{General}->{ServerRoot}, |
345 |
++ "CONFIG-DIR" => $inf->{slapd}->{config_dir}, |
346 |
++ "INITCONFIG-DIR" => $initconfig_dir, |
347 |
++ "INST-DIR" => $inf->{slapd}->{inst_dir}, |
348 |
++ "RUN-DIR" => $inf->{slapd}->{run_dir}, |
349 |
++ "PRODUCT-NAME" => "slapd", |
350 |
++ "SERVERBIN-DIR" => $inf->{slapd}->{sbindir}, |
351 |
++ "DB-DIR" => $inf->{slapd}->{db_dir} |
352 |
++ ); |
353 |
++ |
354 |
++ |
355 |
++ my $dir = "$inf->{General}->{prefix}@taskdir@"; |
356 |
++ for my $file (glob("$dir/template-*")) { |
357 |
++ my $basename = $file; |
358 |
++ $basename =~ s/^.*template-//; |
359 |
++ my $destfile = "$inf->{slapd}->{inst_dir}/$basename"; |
360 |
++ debug(1, "$destfile\n"); |
361 |
++ |
362 |
++ next if ($skip and -f $destfile); # in skip mode, skip files that already exist |
363 |
++ |
364 |
++ if (!open(SRC, "< $file")) { |
365 |
++ return ("error_opening_scripttmpl", $file, $!); |
366 |
++ } |
367 |
++ if (!open(DEST, "> $destfile")) { |
368 |
++ return ("error_opening_scripttmpl", $destfile, $!); |
369 |
++ } |
370 |
++ my $contents; # slurp entire file into memory |
371 |
++ read SRC, $contents, int(-s $file); |
372 |
++ close(SRC); |
373 |
++ while (my ($key, $val) = each %maptable) { |
374 |
++ $contents =~ s/\{\{$key\}\}/$val/g; |
375 |
++ } |
376 |
++ print DEST $contents; |
377 |
++ close(DEST); |
378 |
++ my @errs = changeOwnerMode($inf, 5, $destfile); |
379 |
++ if (@errs) { |
380 |
++ return @errs; |
381 |
++ } |
382 |
+ } |
383 |
++ } else { |
384 |
++ debug(1, "No instance directory scripts will be updated or created\n"); |
385 |
+ } |
386 |
+ |
387 |
+ return (); |
388 |
+@@ -639,7 +662,7 @@ sub initDatabase { |
389 |
+ return (); |
390 |
+ } |
391 |
+ |
392 |
+- my $cmd = "$inf->{slapd}->{inst_dir}/ldif2db -n $inf->{slapd}->{ds_bename} -i \'$ldiffile\'"; |
393 |
++ my $cmd = "$inf->{slapd}->{sbindir}/ldif2db -Z $inf->{slapd}->{ServerIdentifier} -n $inf->{slapd}->{ds_bename} -i \'$ldiffile\'"; |
394 |
+ $? = 0; # clear error condition |
395 |
+ my $output = `$cmd 2>&1`; |
396 |
+ my $result = $?; |
397 |
+@@ -662,7 +685,7 @@ sub startServer { |
398 |
+ my @errs; |
399 |
+ # get error log |
400 |
+ my $errLog = "$inf->{slapd}->{log_dir}/errors"; |
401 |
+- my $startcmd = "$inf->{slapd}->{inst_dir}/start-slapd"; |
402 |
++ my $startcmd = "$inf->{slapd}->{sbindir}/start-dirsrv $inf->{slapd}->{ServerIdentifier}"; |
403 |
+ if ("@systemdsystemunitdir@" and (getLogin() eq 'root')) { |
404 |
+ $startcmd = "/bin/systemctl start @package_name@\@$inf->{slapd}->{ServerIdentifier}.service"; |
405 |
+ } |
406 |
+@@ -875,6 +898,10 @@ sub setDefaults { |
407 |
+ "@datadir@", |
408 |
+ $inf->{General}->{prefix}); |
409 |
+ |
410 |
++ if (!defined($inf->{slapd}->{InstScriptsEnabled})) { |
411 |
++ $inf->{slapd}->{InstScriptsEnabled} = "false"; |
412 |
++ } |
413 |
++ |
414 |
+ if (!defined($inf->{slapd}->{inst_dir})) { |
415 |
+ $inf->{slapd}->{inst_dir} = "$inf->{General}->{ServerRoot}/slapd-$servid"; |
416 |
+ } |
417 |
+@@ -975,9 +1002,12 @@ sub updateSelinuxPolicy { |
418 |
+ system("restorecon -R $localstatedir/lib/@PACKAGE_NAME@"); |
419 |
+ } |
420 |
+ |
421 |
++ my @inst_dirs = qw(config_dir schema_dir log_dir lock_dir run_dir tmp_dir cert_dir db_dir ldif_dir bak_dir); |
422 |
++ if ($inf->{slapd}->{InstScriptsEnabled} eq "true") { |
423 |
++ @inst_dirs = qw(inst_dir config_dir schema_dir log_dir lock_dir run_dir tmp_dir cert_dir db_dir ldif_dir bak_dir); |
424 |
++ } |
425 |
+ # run restorecon on all instance directories we created |
426 |
+- for my $kw (qw(inst_dir config_dir schema_dir log_dir lock_dir run_dir tmp_dir |
427 |
+- cert_dir db_dir ldif_dir bak_dir)) { |
428 |
++ for my $kw (@inst_dirs) { |
429 |
+ my $dir = $inf->{slapd}->{$kw}; |
430 |
+ system("restorecon -R $dir"); |
431 |
+ } |
432 |
+@@ -1231,14 +1261,14 @@ sub createDSInstance { |
433 |
+ } |
434 |
+ |
435 |
+ sub stopServer { |
436 |
+- my $instancedir = shift; |
437 |
+- my $prog = $instancedir . "/stop-slapd"; |
438 |
++ my $instance = shift; |
439 |
++ my $prog = "@sbindir@/stop-dirsrv"; |
440 |
+ if (-x $prog) { |
441 |
+ $? = 0; |
442 |
+ # run the stop command |
443 |
+- my $output = `$prog 2>&1`; |
444 |
++ my $output = `$prog $instance 2>&1`; |
445 |
+ my $status = $?; |
446 |
+- debug(3, "stopping server $instancedir returns status $status: output $output\n"); |
447 |
++ debug(3, "stopping server $instance returns status $status: output $output\n"); |
448 |
+ if ($status) { |
449 |
+ debug(1,"Warning: Could not stop directory server: status $status: output $output\n"); |
450 |
+ # if the server is not running, that's ok |
451 |
+@@ -1254,7 +1284,7 @@ sub stopServer { |
452 |
+ return; |
453 |
+ } |
454 |
+ |
455 |
+- debug(1, "Successfully stopped server $instancedir\n"); |
456 |
++ debug(1, "Successfully stopped server $instance\n"); |
457 |
+ return 1; |
458 |
+ } |
459 |
+ |
460 |
+@@ -1331,23 +1361,16 @@ sub removeDSInstance { |
461 |
+ $conn->close(); |
462 |
+ |
463 |
+ # stop the server |
464 |
+- my $instdir = ""; |
465 |
+- if ($entry) { |
466 |
+- foreach my $path ( @{$entry->{"nsslapd-instancedir"}} ) |
467 |
+- { |
468 |
+- if (!stopServer($path)) { |
469 |
+- if ($force) { |
470 |
+- debug(1, "Warning: Could not stop directory server - Error: $! - forcing continue\n"); |
471 |
+- } elsif ($! == ENOENT) { # stop script not found or server not running |
472 |
+- debug(1, "Warning: Could not stop directory server: already removed or not running\n"); |
473 |
+- push @errs, [ 'error_stopping_server', $path, $! ]; |
474 |
+- } else { # real error |
475 |
+- debug(1, "Error: Could not stop directory server - aborting - use -f flag to force removal\n"); |
476 |
+- push @errs, [ 'error_stopping_server', $path, $! ]; |
477 |
+- return @errs; |
478 |
+- } |
479 |
+- } |
480 |
+- $instdir = $path; |
481 |
++ if (!stopServer($inst)) { |
482 |
++ if ($force) { |
483 |
++ debug(1, "Warning: Could not stop directory server - Error: $! - forcing continue\n"); |
484 |
++ } elsif ($! == ENOENT) { # stop script not found or server not running |
485 |
++ debug(1, "Warning: Could not stop directory server: already removed or not running\n"); |
486 |
++ push @errs, [ 'error_stopping_server', $inst, $! ]; |
487 |
++ } else { # real error |
488 |
++ debug(1, "Error: Could not stop directory server - aborting - use -f flag to force removal\n"); |
489 |
++ push @errs, [ 'error_stopping_server', $inst, $! ]; |
490 |
++ return @errs; |
491 |
+ } |
492 |
+ } |
493 |
+ |
494 |
+@@ -1363,18 +1386,25 @@ sub removeDSInstance { |
495 |
+ push @errs, remove_tree($entry, "nsslapd-errorlog", $instname, 1); |
496 |
+ } |
497 |
+ |
498 |
+- # instance dir |
499 |
+- if ( -d $instdir && $instdir =~ /$instname/ ) |
500 |
+- { |
501 |
+- # clean up pid files (if any) |
502 |
+- remove_pidfile("STARTPIDFILE", $inst, $instdir, $instname, $rundir, $product_name); |
503 |
+- remove_pidfile("PIDFILE", $inst, $instdir, $instname, $rundir, $product_name); |
504 |
+ |
505 |
+- my $rc = rmtree($instdir); |
506 |
+- if ( 0 == $rc ) |
507 |
++ # instance dir |
508 |
++ my $instdir = ""; |
509 |
++ if ($entry) { |
510 |
++ foreach my $instdir ( @{$entry->{"nsslapd-instancedir"}} ) |
511 |
+ { |
512 |
+- push @errs, [ 'error_removing_path', $instdir, $! ]; |
513 |
+- debug(1, "Warning: $instdir was not removed. Error: $!\n"); |
514 |
++ if ( -d $instdir && $instdir =~ /$instname/ ) |
515 |
++ { |
516 |
++ # clean up pid files (if any) |
517 |
++ remove_pidfile("STARTPIDFILE", $inst, $instdir, $instname, $rundir, $product_name); |
518 |
++ remove_pidfile("PIDFILE", $inst, $instdir, $instname, $rundir, $product_name); |
519 |
++ |
520 |
++ my $rc = rmtree($instdir); |
521 |
++ if ( 0 == $rc ) |
522 |
++ { |
523 |
++ push @errs, [ 'error_removing_path', $instdir, $! ]; |
524 |
++ debug(1, "Warning: $instdir was not removed. Error: $!\n"); |
525 |
++ } |
526 |
++ } |
527 |
+ } |
528 |
+ } |
529 |
+ # Finally, config dir |
530 |
+diff --git a/ldap/admin/src/scripts/DSUpdate.pm.in b/ldap/admin/src/scripts/DSUpdate.pm.in |
531 |
+index be1e67c..e84a9a9 100644 |
532 |
+--- a/ldap/admin/src/scripts/DSUpdate.pm.in |
533 |
++++ b/ldap/admin/src/scripts/DSUpdate.pm.in |
534 |
+@@ -226,10 +226,10 @@ sub updateDS { |
535 |
+ for my $upd (@updates) { |
536 |
+ my @localerrs; |
537 |
+ if ($upd->{$PRE_STAGE}) { |
538 |
+- debug(1, "Running stage $PRE_STAGE update ", $upd->{path}, "\n"); |
539 |
++ debug(1, "Running updateDS stage $PRE_STAGE update ", $upd->{path}, "\n"); |
540 |
+ @localerrs = &{$upd->{$PRE_STAGE}}($inf, $setup->{configdir}); |
541 |
+ } elsif ($upd->{file}) { |
542 |
+- debug(1, "Running stage $PRE_STAGE update ", $upd->{path}, "\n"); |
543 |
++ debug(1, "Running updateDS stage $PRE_STAGE update ", $upd->{path}, "\n"); |
544 |
+ @localerrs = processUpdate($upd, $inf, $setup->{configdir}, $PRE_STAGE); |
545 |
+ } |
546 |
+ if (@localerrs) { |
547 |
+@@ -276,10 +276,10 @@ sub updateDS { |
548 |
+ for my $upd (@updates) { |
549 |
+ my @localerrs; |
550 |
+ if ($upd->{$POST_STAGE}) { |
551 |
+- debug(1, "Running stage $POST_STAGE update ", $upd->{path}, "\n"); |
552 |
++ debug(1, "Running updateDS stage $POST_STAGE update ", $upd->{path}, "\n"); |
553 |
+ @localerrs = &{$upd->{$POST_STAGE}}($inf, $setup->{configdir}); |
554 |
+ } elsif ($upd->{file}) { |
555 |
+- debug(1, "Running stage $POST_STAGE update ", $upd->{path}, "\n"); |
556 |
++ debug(1, "Running updateDS stage $POST_STAGE update ", $upd->{path}, "\n"); |
557 |
+ @localerrs = processUpdate($upd, $inf, $setup->{configdir}, $POST_STAGE); |
558 |
+ } |
559 |
+ if (@localerrs) { |
560 |
+@@ -385,10 +385,10 @@ sub updateDSInstance { |
561 |
+ for my $upd (@{$updates}) { |
562 |
+ my @localerrs; |
563 |
+ if ($upd->{$stage}) { |
564 |
+- debug(1, "Running stage $stage update ", $upd->{path}, "\n"); |
565 |
++ debug(1, "Running updateDSInstance stage $stage update ", $upd->{path}, "\n"); |
566 |
+ @localerrs = &{$upd->{$stage}}($inf, $inst, $dseldif, $conn); |
567 |
+ } elsif ($upd->{file}) { |
568 |
+- debug(1, "Running stage $stage update ", $upd->{path}, "\n"); |
569 |
++ debug(1, "Running updateDSInstance stage $stage update ", $upd->{path}, "\n"); |
570 |
+ @localerrs = processUpdate($upd, $inf, $configdir, $stage, |
571 |
+ $inst, $dseldif, $conn); |
572 |
+ } |
573 |
+diff --git a/ldap/admin/src/scripts/setup-ds.res.in b/ldap/admin/src/scripts/setup-ds.res.in |
574 |
+index 7134e25..fa37567 100644 |
575 |
+--- a/ldap/admin/src/scripts/setup-ds.res.in |
576 |
++++ b/ldap/admin/src/scripts/setup-ds.res.in |
577 |
+@@ -116,6 +116,7 @@ error_creating_file = Could not create file '%s'. Error: %s\n |
578 |
+ error_copying_file = Could not copy file '%s' to '%s'. Error: %s\n |
579 |
+ error_enabling_feature = Could not enable the directory server feature '%s'. Error: %s\n |
580 |
+ error_importing_ldif = Could not import LDIF file '%s'. Error: %s. Output: %s\n |
581 |
++error_invalid_boolean = Could not convert value '%s' to boolean. Valid values are true or false.\n |
582 |
+ error_starting_server = Could not start the directory server using command '%s'. The last line from the error log was '%s'. Error: %s\n |
583 |
+ error_stopping_server = Could not stop the directory server '%s'. Error: %s\n |
584 |
+ error_missing_userid = The SuiteSpotUserID is missing. This must be set to valid user\n |
585 |
+-- |
586 |
+2.4.3 |
587 |
+ |