[Pkg-fedora-ds-maintainers] 389-admin: Changes to 'master'
Timo Aaltonen
tjaalton at moszumanska.debian.org
Wed Oct 4 17:57:56 UTC 2017
Makefile.am | 4
VERSION.sh | 2
admserv/cfgstuff/console.conf.in | 4
admserv/cfgstuff/ds_removal.in | 7
admserv/cfgstuff/ds_unregister.in | 7
admserv/cfgstuff/restart-ds-admin.in | 12
admserv/cfgstuff/start-ds-admin.in | 87 ++--
admserv/cfgstuff/stop-ds-admin.in | 55 +-
admserv/newinst/src/AdminServer.pm.in | 93 ++--
admserv/newinst/src/AdminUtil.pm.in | 110 +++--
admserv/newinst/src/register-ds-admin.pl.in | 176 +++++----
admserv/newinst/src/register-ds-admin.res.in | 4
compile | 9
debian/389-admin.dirs | 1
debian/389-admin.dirsrv-admin.service | 19
debian/389-admin.examples | 1
debian/389-admin.postinst | 15
debian/389-admin.postrm | 11
debian/adm.conf | 10
debian/changelog | 16
debian/compat | 2
debian/control | 8
debian/copyright | 2
debian/patches/fix-hyphen-used-as-minus-sign.patch | 26 -
debian/patches/fix-mime-magic-path.diff | 11
debian/rules | 4
debian/source/local-options | 1
debian/watch | 2
install-sh | 366 ++++++++----------
m4/httpd.m4 | 2
m4/mod_nss.m4 | 2
man/man8/ds_removal.8 | 2
man/man8/ds_unregister.8 | 2
man/man8/register-ds-admin.pl.8 | 132 ++++--
missing | 405 +++++++--------------
wrappers/systemd.service.in | 2
36 files changed, 846 insertions(+), 766 deletions(-)
New commits:
commit 5626963edd6a123e6be5ef7ffe312d32f2926a58
Author: Timo Aaltonen <tjaalton at debian.org>
Date: Wed Oct 4 20:57:07 2017 +0300
releasing package 389-admin version 1.1.46-1
diff --git a/debian/changelog b/debian/changelog
index 11fa137..4078f85 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-389-admin (1.1.46-1) UNRELEASED; urgency=medium
+389-admin (1.1.46-1) unstable; urgency=medium
* New upstream release.
* rules, postinst: Don't fail the install when the unconfigured
@@ -12,7 +12,7 @@
* Fix systemd service to stop properly.
* Remove adm.conf example, it's useless.
- -- Timo Aaltonen <tjaalton at debian.org> Mon, 22 May 2017 11:02:51 +0300
+ -- Timo Aaltonen <tjaalton at debian.org> Wed, 04 Oct 2017 20:54:19 +0300
389-admin (1.1.43-1) unstable; urgency=medium
commit 27ff1d33aa4cbbcc62b0a00875e75fe3e524725e
Author: Timo Aaltonen <tjaalton at debian.org>
Date: Wed Oct 4 20:51:02 2017 +0300
Remove adm.conf example, it's useless.
diff --git a/debian/389-admin.examples b/debian/389-admin.examples
deleted file mode 100644
index 9070606..0000000
--- a/debian/389-admin.examples
+++ /dev/null
@@ -1 +0,0 @@
-debian/adm.conf
diff --git a/debian/adm.conf b/debian/adm.conf
deleted file mode 100644
index ac43864..0000000
--- a/debian/adm.conf
+++ /dev/null
@@ -1,10 +0,0 @@
-userdn: uid=admin, ou=Administrators, ou=TopologyManagement, o=NetscapeRoot
-sysuser: dirsrv
-sysgroup: dirsrv
-SuiteSpotUserID: dirsrv
-SuiteSpotGroup: dirsrv
-sie: cn=admin-serv-hostname, cn=389 Administration Server, cn=Server Group, cn=hostname.example.com, ou=example.com, o=NetscapeRoot
-ldapurl: ldap://hostname.example.com:389/o=NetscapeRoot
-ldapStart: /usr/lib/dirsrv/slapd-hostname/start-slapd
-isie: cn=389 Administration Server, cn=Server Group, cn=hostname.example.com, ou=example.com, o=NetscapeRoot
-AdminDomain: example.com
diff --git a/debian/changelog b/debian/changelog
index 8a24a69..11fa137 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,7 @@
* Bump policy to 4.1.1, no changes.
* dirs, postrm: Add a dir for logs, and remove all cruft on purge.
* Fix systemd service to stop properly.
+ * Remove adm.conf example, it's useless.
-- Timo Aaltonen <tjaalton at debian.org> Mon, 22 May 2017 11:02:51 +0300
commit 552e0637f1960dd40568fef70a31d73e438fccea
Author: Timo Aaltonen <tjaalton at debian.org>
Date: Wed Oct 4 20:48:02 2017 +0300
Fix systemd service to stop properly.
diff --git a/debian/389-admin.dirsrv-admin.service b/debian/389-admin.dirsrv-admin.service
index f9ae514..d82ffd6 100644
--- a/debian/389-admin.dirsrv-admin.service
+++ b/debian/389-admin.dirsrv-admin.service
@@ -11,7 +11,7 @@ EnvironmentFile=/etc/default/dirsrv-admin
ExecStart=/usr/sbin/apache2 -k start -f /etc/dirsrv/admin-serv/httpd.conf
ExecReload=/usr/sbin/apache2 -t
ExecReload=/bin/kill -HUP $MAINPID
-ExecStop=/usr/sbin/apache2 $OPTIONS -k stop
+ExecStop=/usr/sbin/apache2 $OPTIONS -k stop -f /etc/dirsrv/admin-serv/httpd.conf
# to raise the file descriptor limit
# LimitNOFILE=8192
diff --git a/debian/changelog b/debian/changelog
index 2b8a04a..8a24a69 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,7 @@
* Update upstream URLs.
* Bump policy to 4.1.1, no changes.
* dirs, postrm: Add a dir for logs, and remove all cruft on purge.
+ * Fix systemd service to stop properly.
-- Timo Aaltonen <tjaalton at debian.org> Mon, 22 May 2017 11:02:51 +0300
commit 1d63a83fe13a445a84865577ee346aac076ca61c
Author: Timo Aaltonen <tjaalton at debian.org>
Date: Wed Oct 4 20:37:22 2017 +0300
dirs, postrm: Add a dir for logs, and remove all cruft on purge.
diff --git a/debian/389-admin.dirs b/debian/389-admin.dirs
new file mode 100644
index 0000000..7a7dd86
--- /dev/null
+++ b/debian/389-admin.dirs
@@ -0,0 +1 @@
+/var/log/dirsrv/admin-serv
diff --git a/debian/389-admin.postrm b/debian/389-admin.postrm
new file mode 100644
index 0000000..b5b112b
--- /dev/null
+++ b/debian/389-admin.postrm
@@ -0,0 +1,11 @@
+#!/bin/sh
+set -e
+
+. /usr/share/debconf/confmodule
+
+if [ "$1" = "purge" ]; then
+ rm -f /etc/systemd/system/dirsrv.target.wants/dirsrv at admin.service
+ rm -rf /etc/dirsrv/admin-serv
+ rm -rf /var/log/dirsrv/admin-serv
+fi
+
diff --git a/debian/changelog b/debian/changelog
index 45b03ff..2b8a04a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,7 @@
* Bump debhelper compat to 10.
* Update upstream URLs.
* Bump policy to 4.1.1, no changes.
+ * dirs, postrm: Add a dir for logs, and remove all cruft on purge.
-- Timo Aaltonen <tjaalton at debian.org> Mon, 22 May 2017 11:02:51 +0300
commit af427d59922f9bd698f2b156745e70c7ae97e367
Author: Timo Aaltonen <tjaalton at debian.org>
Date: Wed Oct 4 20:33:44 2017 +0300
close a bug
diff --git a/debian/changelog b/debian/changelog
index 75eedb6..45b03ff 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,7 +2,7 @@
* New upstream release.
* rules, postinst: Don't fail the install when the unconfigured
- service doesn't start. (LP: #1652476)
+ service doesn't start. (Closes: 870032) (LP: #1652476)
* patches: Refreshed.
* local-options: Add VERSION.sh to extend-diff-ignore.
* Bump debhelper compat to 10.
commit 81a56c243727b0b576581246a24f628c2df3a0a0
Author: Timo Aaltonen <tjaalton at debian.org>
Date: Wed Oct 4 19:58:44 2017 +0300
Bump policy to 4.1.1, no changes.
diff --git a/debian/changelog b/debian/changelog
index bce80d8..75eedb6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,7 @@
* local-options: Add VERSION.sh to extend-diff-ignore.
* Bump debhelper compat to 10.
* Update upstream URLs.
+ * Bump policy to 4.1.1, no changes.
-- Timo Aaltonen <tjaalton at debian.org> Mon, 22 May 2017 11:02:51 +0300
diff --git a/debian/control b/debian/control
index ca54b5d..980fcd1 100644
--- a/debian/control
+++ b/debian/control
@@ -21,7 +21,7 @@ Build-Depends:
po-debconf,
quilt,
rename,
-Standards-Version: 3.9.8
+Standards-Version: 4.1.1
Homepage: https://pagure.io//389-admin
Vcs-Git: https://anonscm.debian.org/git/pkg-fedora-ds/389-admin.git
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-fedora-ds/389-admin.git
commit 5cb59edde67828b8372ae118f24ef2585fae835b
Author: Timo Aaltonen <tjaalton at debian.org>
Date: Wed Oct 4 19:57:35 2017 +0300
Update upstream URLs.
diff --git a/debian/changelog b/debian/changelog
index 9e46af0..bce80d8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,7 @@
* patches: Refreshed.
* local-options: Add VERSION.sh to extend-diff-ignore.
* Bump debhelper compat to 10.
+ * Update upstream URLs.
-- Timo Aaltonen <tjaalton at debian.org> Mon, 22 May 2017 11:02:51 +0300
diff --git a/debian/control b/debian/control
index 9757a78..ca54b5d 100644
--- a/debian/control
+++ b/debian/control
@@ -22,7 +22,7 @@ Build-Depends:
quilt,
rename,
Standards-Version: 3.9.8
-Homepage: http://directory.fedoraproject.org
+Homepage: https://pagure.io//389-admin
Vcs-Git: https://anonscm.debian.org/git/pkg-fedora-ds/389-admin.git
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-fedora-ds/389-admin.git
diff --git a/debian/copyright b/debian/copyright
index 306645d..e701bf7 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,6 +1,6 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-name: 389-admin
-Source: http://directory.fedoraproject.org/sources/
+Source: https://pagure.io//389-admin
Files: *
Copyright: 2001 Sun Microsystems, Inc.
diff --git a/debian/watch b/debian/watch
index 322c068..8213224 100644
--- a/debian/watch
+++ b/debian/watch
@@ -1,3 +1,3 @@
-# Git: https://git.fedorahosted.org/cgit/389/admin.git/
+# Git: https://pagure.io//389-admin.git
version=3
http://www.port389.org/binaries/389-admin-([0-9.]+)\.tar\.bz2
commit 18fe41b4f9102411eae44bbc57afc20d0b396c41
Author: Timo Aaltonen <tjaalton at debian.org>
Date: Wed Oct 4 19:55:29 2017 +0300
Bump debhelper compat to 10.
diff --git a/debian/changelog b/debian/changelog
index 2515e90..9e46af0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,7 @@
service doesn't start. (LP: #1652476)
* patches: Refreshed.
* local-options: Add VERSION.sh to extend-diff-ignore.
+ * Bump debhelper compat to 10.
-- Timo Aaltonen <tjaalton at debian.org> Mon, 22 May 2017 11:02:51 +0300
diff --git a/debian/compat b/debian/compat
index ec63514..f599e28 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-9
+10
diff --git a/debian/control b/debian/control
index 4201500..9757a78 100644
--- a/debian/control
+++ b/debian/control
@@ -7,9 +7,7 @@ Build-Depends:
389-ds-base-dev,
apache2-dev,
debconf-utils,
- debhelper (>= 9),
- dh-autoreconf,
- dh-systemd,
+ debhelper (>= 10),
libadminutil-dev,
libapache2-mod-nss,
libicu-dev,
diff --git a/debian/rules b/debian/rules
index ede0bf4..e519440 100755
--- a/debian/rules
+++ b/debian/rules
@@ -53,4 +53,4 @@ override_dh_shlibdeps:
dh_shlibdeps -l"debian/389-admin/usr/lib/$(DEB_HOST_MULTIARCH)/:debian/389-admin/usr/lib/$(DEB_HOST_MULTIARCH)/dirsrv"
%:
- dh $@ --with quilt,autoreconf,systemd --parallel --builddir build/
+ dh $@ --with quilt,systemd --parallel --builddir build/
commit 34990bd4b4529057861befb15be6a140b78b0416
Author: Timo Aaltonen <tjaalton at debian.org>
Date: Wed Oct 4 19:14:29 2017 +0300
local-options: Add VERSION.sh to extend-diff-ignore.
diff --git a/debian/changelog b/debian/changelog
index 9cf755c..2515e90 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,7 @@
* rules, postinst: Don't fail the install when the unconfigured
service doesn't start. (LP: #1652476)
* patches: Refreshed.
+ * local-options: Add VERSION.sh to extend-diff-ignore.
-- Timo Aaltonen <tjaalton at debian.org> Mon, 22 May 2017 11:02:51 +0300
diff --git a/debian/source/local-options b/debian/source/local-options
new file mode 100644
index 0000000..ae91206
--- /dev/null
+++ b/debian/source/local-options
@@ -0,0 +1 @@
+extend-diff-ignore = VERSION.sh
commit ce560de9a450f6f256701505937babbf0452d13e
Author: Timo Aaltonen <tjaalton at debian.org>
Date: Wed Oct 4 19:12:46 2017 +0300
patches: Refreshed.
diff --git a/debian/changelog b/debian/changelog
index 99e1f36..9cf755c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@
* New upstream release.
* rules, postinst: Don't fail the install when the unconfigured
service doesn't start. (LP: #1652476)
+ * patches: Refreshed.
-- Timo Aaltonen <tjaalton at debian.org> Mon, 22 May 2017 11:02:51 +0300
diff --git a/debian/patches/fix-hyphen-used-as-minus-sign.patch b/debian/patches/fix-hyphen-used-as-minus-sign.patch
index 8d70aed..194b8d7 100644
--- a/debian/patches/fix-hyphen-used-as-minus-sign.patch
+++ b/debian/patches/fix-hyphen-used-as-minus-sign.patch
@@ -27,32 +27,34 @@ Author: Benjamin Drung <benjamin.drung at profitbricks.com>
.PP
--- a/man/man8/register-ds-admin.pl.8
+++ b/man/man8/register-ds-admin.pl.8
-@@ -19,16 +19,16 @@
+@@ -19,7 +19,7 @@
register\-ds\-admin.pl \- Registers Directory Server instances with an Admin Server
.SH SYNOPSIS
.B register-ds-admin.pl
-[\fI--options\fR] \fI-- \fR[\fIargs\fR]
+[\fI\-\-options\fR] \fI-\- \fR[\fIargs\fR]
.SH DESCRIPTION
- Registers existing Directory Server instances with an existing Admin Server.
- This command does the set up necessary for the use of the Console to manage
- the Directory Server instances you are registering. You can register remote
- Directory Server instances to a local Admin Server, as well as register local
--Directory Server instances with a remote Admin Server - this allows a single
-+Directory Server instances with a remote Admin Server \- this allows a single
- console/Admin Server to manage all your Directory Servers on your network.
+ Registers existing Directory Server instances with an existing Admin Server.
+ This command does the set up necessary for the use of the Console to manage
+@@ -28,10 +28,10 @@ Directory Server instances with a local
+ Server. You can also create an Admin Server and register standalone instances
+ with it. You can register remote Directory Server instances to the local
+ Admin Server, as well as register local Directory Server instances with a
+-remote Admin Server - this allows a single Console/Admin Server to manage all
++remote Admin Server \- this allows a single Console/Admin Server to manage all
+ the Directory Servers in your network.
-Use this command with the \fB--update\fR option after an upgrade to refresh
-+Use this command with the \fB\-\-update\fR option after an upgrade to refresh
++Use this command with the \fB-\-update\fR option after an upgrade to refresh
the server information (version, build number, etc.) in the Console.
Can be run in interactive mode with different levels of verbosity, or
-@@ -66,7 +66,7 @@ Log setup messages to this file \- other
+@@ -69,7 +69,7 @@ Log setup messages to this file \- other
Update an existing installation (e.g. after upgrading packages)
.TP
.B \fB\-\-continue
-(update only) keep going despite errors (also --force)
+(update only) keep going despite errors (also \-\-force)
.PP
- For all options, you can also use the short name e.g. \fB\-h\fR, \fB\-d\fR, etc.
- For the \fB\-d\fR argument, specifying it more than once will increase the debug
+ For all options, you can also use the short name e.g. \fB\-h\fR, \fB\-d\fR, etc.
+ For the \fB\-d\fR argument, specifying it more than once will increase the debug
diff --git a/debian/patches/fix-mime-magic-path.diff b/debian/patches/fix-mime-magic-path.diff
index d05f2ae..24ad6d9 100644
--- a/debian/patches/fix-mime-magic-path.diff
+++ b/debian/patches/fix-mime-magic-path.diff
@@ -1,22 +1,15 @@
-diff --git a/m4/httpd.m4 b/m4/httpd.m4
-index b72054c..752eaa7 100644
--- a/m4/httpd.m4
+++ b/m4/httpd.m4
-@@ -61,11 +61,12 @@ esac
+@@ -61,11 +61,7 @@ esac
httpdconf=${httpd_root}/${httpd_conf_rel}
--mimemagic=`awk '"MIMEMagicFile" == $1" {print $2}' $httpdconf`
+-mimemagic=`awk '("MIMEMagicFile" == $1) {print $2}' $httpdconf`
-if test ! -f "$mimemagic" ; then
-# assume relative to root
- mimemagic=${httpd_root}/${mimemagic}
-fi
+mimemagic=/etc/apache2/magic
-+#mimemagic=`awk '"MIMEMagicFile" == $1" {print $2}' $httpdconf`
-+#if test ! -f "$mimemagic" ; then
-+## assume relative to root
-+# mimemagic=${httpd_root}/${mimemagic}
-+#fi
# check for mime.types file
httpdconfdir=`dirname $httpdconf`
commit 8830d1239b5a3f94ebf6fa3908c0056d22dbfa0b
Author: Timo Aaltonen <tjaalton at debian.org>
Date: Wed Oct 4 19:12:32 2017 +0300
update changelog
diff --git a/debian/changelog b/debian/changelog
index ea0fce6..99e1f36 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,6 @@
-389-admin (1.1.43-2) UNRELEASED; urgency=medium
+389-admin (1.1.46-1) UNRELEASED; urgency=medium
+ * New upstream release.
* rules, postinst: Don't fail the install when the unconfigured
service doesn't start. (LP: #1652476)
commit 327cb759be9948e176bc73a732846d91a689891c
Author: Timo Aaltonen <tjaalton at debian.org>
Date: Mon May 22 11:02:57 2017 +0300
rules, postinst: Don't fail the install when the unconfigured service doesn't start. (LP: #1652476)
diff --git a/debian/389-admin.postinst b/debian/389-admin.postinst
new file mode 100644
index 0000000..30284d1
--- /dev/null
+++ b/debian/389-admin.postinst
@@ -0,0 +1,15 @@
+#!/bin/sh
+set -e
+
+invoke_failure() {
+ # invoke-rc.d failed, likely because no instance has been configured yet
+ # but exit with an error if an instance is configured and the invoke failed
+ if [ -z $INSTANCES ]; then
+ echo "... because no instance has been configured yet."
+ else
+ exit 1
+ fi
+}
+
+
+#DEBHELPER#
diff --git a/debian/changelog b/debian/changelog
index e23463b..ea0fce6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+389-admin (1.1.43-2) UNRELEASED; urgency=medium
+
+ * rules, postinst: Don't fail the install when the unconfigured
+ service doesn't start. (LP: #1652476)
+
+ -- Timo Aaltonen <tjaalton at debian.org> Mon, 22 May 2017 11:02:51 +0300
+
389-admin (1.1.43-1) unstable; urgency=medium
* New upstream release.
diff --git a/debian/rules b/debian/rules
index edcdc0e..ede0bf4 100755
--- a/debian/rules
+++ b/debian/rules
@@ -47,7 +47,7 @@ override_dh_systemd_enable:
dh_systemd_enable -p389-admin --no-enable --name=dirsrv-admin dirsrv-admin.service
override_dh_installinit:
- dh_installinit --name dirsrv-admin -- defaults 15 85
+ dh_installinit --name dirsrv-admin --error-handler=invoke_failure -- defaults 15 85
override_dh_shlibdeps:
dh_shlibdeps -l"debian/389-admin/usr/lib/$(DEB_HOST_MULTIARCH)/:debian/389-admin/usr/lib/$(DEB_HOST_MULTIARCH)/dirsrv"
commit 1cdb17a9fb5115c1ec7fc88fa81445eb9accf325
Author: Timo Aaltonen <tjaalton at debian.org>
Date: Mon May 22 10:34:41 2017 +0300
really add the service file
diff --git a/debian/389-admin.dirsrv-admin.service b/debian/389-admin.dirsrv-admin.service
new file mode 100644
index 0000000..f9ae514
--- /dev/null
+++ b/debian/389-admin.dirsrv-admin.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=389 Administration Server.
+After=network.target dirsrv.target
+
+[Service]
+Type=forking
+PIDFile=/run/dirsrv/admin-serv.pid
+# to set the kerberos keytab
+# Environment=KRB5_KTNAME=/etc/dirsrv/myname.keytab
+EnvironmentFile=/etc/default/dirsrv-admin
+ExecStart=/usr/sbin/apache2 -k start -f /etc/dirsrv/admin-serv/httpd.conf
+ExecReload=/usr/sbin/apache2 -t
+ExecReload=/bin/kill -HUP $MAINPID
+ExecStop=/usr/sbin/apache2 $OPTIONS -k stop
+# to raise the file descriptor limit
+# LimitNOFILE=8192
+
+[Install]
+WantedBy=multi-user.target
commit ad1a4c7fc0f95fdc9d117dcd704a518a2a969d34
Author: Noriko Hosoi <nhosoi at redhat.com>
Date: Tue Nov 1 09:28:33 2016 -0700
bump version to 1.1.46
diff --git a/VERSION.sh b/VERSION.sh
index 4e1f314..1975cdd 100644
--- a/VERSION.sh
+++ b/VERSION.sh
@@ -11,7 +11,7 @@ vendorurl=http://port389.org
# PACKAGE_VERSION is constructed from these
VERSION_MAJOR=1
VERSION_MINOR=1
-VERSION_MAINT=45
+VERSION_MAINT=46
# if this is a PRERELEASE, set VERSION_PREREL
# otherwise, comment it out
# be sure to include the dot prefix in the prerel
commit 32d3339bd4f088da6cdb1a5f2441c5e57c184f96
Author: Mark Reynolds <mreynolds at redhat.com>
Date: Tue Oct 25 20:45:34 2016 -0400
Ticket 49015 - register-ds-admin.pl - silent install does not
register local instances
Bug Description: There is no way to specify how to register local instances with
a local configuration server when using silent install.
Fix Description: Revise the [register] directive section to allow "local instances".
Improved config file validation, and fixed other minor bugs.
Also updated the man page with INF parameter changes.
https://fedorahosted.org/389/ticket/49015
Reviewed by: wibrown & nhosoi(Thanks!!)
diff --git a/admserv/newinst/src/register-ds-admin.pl.in b/admserv/newinst/src/register-ds-admin.pl.in
index dd100d9..f8cc6c0 100644
--- a/admserv/newinst/src/register-ds-admin.pl.in
+++ b/admserv/newinst/src/register-ds-admin.pl.in
@@ -122,8 +122,8 @@ sub get_cred_from_inst
#
# Check the remaining instances
#
- my @insts = $mysetup->{inf}->{register}->{instance};
- if ($#insts){
+ my @insts = $mysetup->{inf}->{register}->{localinst};
+ if ($#insts >= 0 && $insts[0] ne ""){
my $i = 0;
for (; $i <= $#insts; $i++){
my @inst_parts = split('::', $insts[$i]);
@@ -159,6 +159,7 @@ my $dialogmgr;
my @dialogs;
my @silent_instances;
my @config_parts;
+my $remote_reg = 0;
#
# Continue with the setup...
@@ -174,9 +175,11 @@ my $res = new Resource("@propertydir@/register-ds-admin.res",
my $setup = new Setup($res);
if ($setup->{silent}){
#
- # To be silent we must have "General" & "admin", or just "register" directives
+ # To be silent we must have "General" & "register". If 'register" does not have
+ # a localinst/remotehost parameter, then there must be an 'admin' directive in the INF file
#
- if ( ($setup->{inf}->{General} && $setup->{inf}->{admin}) || $setup->{inf}->{register} ){
+ if ( ($setup->{inf}->{General} && $setup->{inf}->{register}) &&
+ ($setup->{inf}->{register}->{localinst} || $setup->{inf}->{admin} || $setup->{inf}->{register}->{remotehost})){
$silent = "yes";
} else {
# Missing required silent install directives
@@ -193,11 +196,11 @@ if ($setup->{inf}->{register}){
#
# [register]
# configinst= slapd-INSTANCE::cn=directory manager::myPassword
- # instance= slapd-INSTANCE2::cn=directory manager::myPassword
- # instance= slapd-INSTANCE3::cn=directory manager::myPassword
+ # localinst= slapd-INSTANCE2::cn=directory manager::myPassword
+ # localinst= slapd-INSTANCE3::cn=directory manager::myPassword
+ # localcertdir= /etc/dirsrv/slapd-INSTANCE
# remotehost= remote.server.com
# remoteport= 389
- # localcertdir= /etc/dirsrv/slapd-INSTANCE
# remotebinddn= cn=directory manager
# remotebindpw= password
# admindn= uid=admin,ou=Administrators,ou=TopologyManagement,o=NetscapeRoot
@@ -206,44 +209,88 @@ if ($setup->{inf}->{register}){
# destination= local|remote
#
- #
+ #
# Validate the silent registration parameters
#
if ( !$setup->{inf}->{register}->{configinst} || $setup->{inf}->{register}->{configinst} eq ""){
$setup->msg($FATAL, 'error_missing_parameter', "configinst");
$setup->doExit(1);
}
- if ( !$setup->{inf}->{register}->{remotehost} || $setup->{inf}->{register}->{remotehost} eq ""){
- $setup->msg($FATAL, 'error_missing_parameter', 'remotehost');
- $setup->doExit(1);
- }
- if ( !$setup->{inf}->{register}->{remoteport} ||$setup->{inf}->{register}->{remoteport} eq ""){
- $setup->msg($FATAL, 'error_missing_parameter', 'remoteport');
- $setup->doExit(1);
- }
- if ( !$setup->{inf}->{register}->{remotebinddn} || $setup->{inf}->{register}->{remotebinddn} eq ""){
- $setup->msg($FATAL, 'error_missing_parameter', 'remotebinddn');
- $setup->doExit(1);
- }
- if ( !$setup->{inf}->{register}->{remotebindpw} || $setup->{inf}->{register}->{remotebindpw} eq ""){
- $setup->msg($FATAL, 'error_missing_parameter', 'remotebindpw');
- $setup->doExit(1);
- }
- if ( !$setup->{inf}->{register}->{admindomain} || $setup->{inf}->{register}->{admindomain} eq ""){
- $setup->msg($FATAL, 'error_missing_parameter', 'admindomain');
- $setup->doExit(1);
- }
- if ( !$setup->{inf}->{register}->{admindn} || $setup->{inf}->{register}->{admindn} eq ""){
- $setup->msg($FATAL, 'error_missing_parameter', 'admindn');
- $setup->doExit(1);
- }
- if ( !$setup->{inf}->{register}->{adminpw} || $setup->{inf}->{register}->{adminpw} eq ""){
- $setup->msg($FATAL, 'error_missing_parameter', 'adminpw');
- $setup->doExit(1);
- }
- if ( !$setup->{inf}->{register}->{destination} || $setup->{inf}->{register}->{destination} eq ""){
- $setup->msg($FATAL, 'error_missing_parameter', 'destination');
- $setup->doExit(1);
+
+ #
+ # If 'remotehost' is set, then we are registering with a remote admin/config server.
+ # Otherwise, we are just registering local instances.
+ #
+ if ( $setup->{inf}->{register}->{remotehost} && $setup->{inf}->{register}->{remotehost} ne ""){
+ $remote_reg = 1;
+ if ( !$setup->{inf}->{register}->{remoteport} ||$setup->{inf}->{register}->{remoteport} eq ""){
+ $setup->msg($FATAL, 'error_missing_parameter', 'remoteport');
+ $setup->doExit(1);
+ }
+ if ( !$setup->{inf}->{register}->{remotebinddn} || $setup->{inf}->{register}->{remotebinddn} eq ""){
+ $setup->msg($FATAL, 'error_missing_parameter', 'remotebinddn');
+ $setup->doExit(1);
+ }
+ if ( !$setup->{inf}->{register}->{remotebindpw} || $setup->{inf}->{register}->{remotebindpw} eq ""){
+ $setup->msg($FATAL, 'error_missing_parameter', 'remotebindpw');
+ $setup->doExit(1);
+ }
+ if ( !$setup->{inf}->{register}->{admindomain} || $setup->{inf}->{register}->{admindomain} eq ""){
+ $setup->msg($FATAL, 'error_missing_parameter', 'admindomain');
+ $setup->doExit(1);
+ }
+ if ( !$setup->{inf}->{register}->{admindn} || $setup->{inf}->{register}->{admindn} eq ""){
+ $setup->msg($FATAL, 'error_missing_parameter', 'admindn');
+ $setup->doExit(1);
+ }
+ if ( !$setup->{inf}->{register}->{adminpw} || $setup->{inf}->{register}->{adminpw} eq ""){
+ $setup->msg($FATAL, 'error_missing_parameter', 'adminpw');
+ $setup->doExit(1);
+ }
+ if ( !$setup->{inf}->{register}->{destination} || $setup->{inf}->{register}->{destination} eq ""){
+ $setup->msg($FATAL, 'error_missing_parameter', 'destination');
+ $setup->doExit(1);
+ }
+ } elsif (!$setup->{inf}->{register}->{localinst} || $setup->{inf}->{register}->{localinst} eq ""){
+ if (!$setup->{inf}->{admin}){
+ # We expected a local instance to register since weare not providing
+ $setup->msg($FATAL, 'error_missing_parameter', 'localinst');
+ $setup->doExit(1);
+ }
+ } else {
+ #
+ # If we got here we assume this is a local registration, but we need to make sure
+ # that other remote parameters were not supplied. In that case we really don't know
+ # what the end user is trying to do - invalid config.
+ #
+ if ( $setup->{inf}->{register}->{remoteport} ){
+ $setup->msg($FATAL, 'error_unexpected_parameter', 'remoteport');
+ $setup->doExit(1);
+ }
+ if ( $setup->{inf}->{register}->{remotebinddn} ) {
+ $setup->msg($FATAL, 'error_unexpected_parameter', 'remotebinddn');
+ $setup->doExit(1);
+ }
+ if ( $setup->{inf}->{register}->{remotebindpw} ){
+ $setup->msg($FATAL, 'error_unexpected_parameter', 'remotebindpw');
+ $setup->doExit(1);
+ }
+ if ( $setup->{inf}->{register}->{admindomain} ){
+ $setup->msg($FATAL, 'error_unexpected_parameter', 'admindomain');
+ $setup->doExit(1);
+ }
+ if ( $setup->{inf}->{register}->{admindn} ){
+ $setup->msg($FATAL, 'error_unexpected_parameter', 'admindn');
+ $setup->doExit(1);
+ }
+ if ( $setup->{inf}->{register}->{adminpw} ){
+ $setup->msg($FATAL, 'error_unexpected_parameter', 'adminpw');
+ $setup->doExit(1);
+ }
+ if ( $setup->{inf}->{register}->{destination} ){
+ $setup->msg($FATAL, 'error_unexpected_parameter', 'destination');
+ $setup->doExit(1);
+ }
}
#
@@ -266,8 +313,8 @@ if ($setup->{inf}->{register}){
#
# Add the other instances (if any)
#
- @silent_instances = $setup->{inf}->{register}->{instance};
- if ($#silent_instances){
+ @silent_instances = $setup->{inf}->{register}->{localinst};
+ if ($#silent_instances >= 0 && $silent_instances[0] ne ""){
my $i = 0;
for (; $i <= $#silent_instances; $i++){
my @inst_parts = split('::', $silent_instances[$i]);
@@ -285,16 +332,18 @@ if ($setup->{inf}->{register}){
$setup->{inf}->{slapd}->{RootDN} = $config_parts[1];
$setup->{inf}->{slapd}->{RootDNPwd} = $config_parts[2];
- #
- # Set the remote registration parameters
- #
- $remote_host = $setup->{inf}->{register}->{remotehost};
- $remote_port = $setup->{inf}->{register}->{remoteport};
- $remote_binddn = $setup->{inf}->{register}->{remotebinddn};
- $remote_bindpw = $setup->{inf}->{register}->{remotebindpw};
- $local_certdir = $setup->{inf}->{register}->{localcertdir};
- $remote_admindomain = $setup->{inf}->{register}->{admindomain};
- $destination = $setup->{inf}->{register}->{destination};
+ if ($remote_reg){
+ #
+ # Set the remote registration parameters
+ #
+ $remote_host = $setup->{inf}->{register}->{remotehost};
+ $remote_port = $setup->{inf}->{register}->{remoteport};
+ $remote_binddn = $setup->{inf}->{register}->{remotebinddn};
+ $remote_bindpw = $setup->{inf}->{register}->{remotebindpw};
+ $local_certdir = $setup->{inf}->{register}->{localcertdir};
+ $remote_admindomain = $setup->{inf}->{register}->{admindomain};
+ $destination = $setup->{inf}->{register}->{destination};
+ }
$localrootdn = $config_parts[1];
$localrootpw = $config_parts[2];
}
@@ -432,7 +481,6 @@ if ( $#admConfKeys >= 4 ) # admserv.conf, console.conf, httpd.conf, nss.conf
if (!$setup->{inf}->{admin}->{config_dir}){
$setup->{inf}->{admin}->{config_dir} = "$instconfigdir/admin-serv";
}
-
#
# Read additional config from config DS
#
@@ -611,32 +659,32 @@ if ($silent eq "no"){
$setup->{inf}->{slapd}->{RootDNPwd} = reg_get_passwd($setup, 'input_rootdn_passwd', $new_confdsid);
$localrootpw = $setup->{inf}->{slapd}->{RootDNPwd};
$localrootdn = $setup->{inf}->{slapd}->{RootDN};
+} else {
+ # silent install always contains the proper root password from (configinst/localinst)
+ $setup->{inf}->{slapd}->{RootDNPwd} = $localrootpw;
}
-
-if ( ($#admConfKeys >= 0 && ($orig_confdsid ne $new_confdsid)) ||
- $#admConfKeys < 0 )
+if ( ($#admConfKeys >= 0 && $orig_confdsid ne $new_confdsid) ||
+ $#admConfKeys < 0 )
{
+ if(!$setup->{inf}->{slapd}->{RootDNPwd} || $setup->{inf}->{slapd}->{RootDNPwd} eq ""){
+ # silent install should have set this
+ $setup->{inf}->{slapd}->{RootDNPwd} = reg_get_passwd($setup, 'input_rootdn_passwd', $new_confdsid);
+ }
@errs = ();
# First, let's register the Configuration Directory itself
-
- if(!$setup->{inf}->{slapd}->{RootDNPwd}){
- $setup->{inf}->{slapd}->{RootDNPwd} = $localrootpw;
- }
while (!createConfigDS($setup->{inf}, \@errs))
{
foreach my $err (@errs)
{
- if ( $err eq "suffix_already_exists" || $err eq "error_creating_suffix_backend")
+ if ( $err eq "suffix_already_exists" || $err eq "error_creating_suffix_backend" ||
+ $err eq "error_connection_failed")
{
goto out;
}
}
- if(!$setup->{inf}->{slapd}->{RootDNPwd} || $setup->{inf}->{slapd}->{RootDNPwd} eq ""){
- # silent install should have set this
- $setup->{inf}->{slapd}->{RootDNPwd} = reg_get_passwd($setup, 'input_rootdn_passwd', $new_confdsid);
- }
@errs = ();
}
+
out:
}
diff --git a/admserv/newinst/src/register-ds-admin.res.in b/admserv/newinst/src/register-ds-admin.res.in
index f7c0e67..1f5f62f 100644
--- a/admserv/newinst/src/register-ds-admin.res.in
+++ b/admserv/newinst/src/register-ds-admin.res.in
@@ -46,11 +46,13 @@ error_missing_parameter = Silent install file missing required parameter '%s'\n
error_invalid_parameter = Silent install parameter '%s' is invalid\n
+error_unexpected_parameter = Unexpected install parameter '%s' - config is invalid\n
+
error_connection = Error connecting to host '%s' - %s\n
error_operation = Error while %s entry '%s' - %s\n
-error_silent_install = Silent setup misconfiguration. Must have 'General' and 'admin', or 'register' directives\n
+error_silent_install = Silent setup misconfiguration. Please see the man page for using a silent install file'\n
remote_register_error = The remote registration process failed!\n
diff --git a/man/man8/register-ds-admin.pl.8 b/man/man8/register-ds-admin.pl.8
index eb85bba..29337c8 100644
--- a/man/man8/register-ds-admin.pl.8
+++ b/man/man8/register-ds-admin.pl.8
@@ -21,12 +21,15 @@ register\-ds\-admin.pl \- Registers Directory Server instances with an Admin Ser
.B register-ds-admin.pl
[\fI--options\fR] \fI-- \fR[\fIargs\fR]
.SH DESCRIPTION
-Registers existing Directory Server instances with an existing Admin Server.
-This command does the set up necessary for the use of the Console to manage
-the Directory Server instances you are registering. You can register remote
-Directory Server instances to a local Admin Server, as well as register local
-Directory Server instances with a remote Admin Server - this allows a single
-console/Admin Server to manage all your Directory Servers on your network.
+Registers existing Directory Server instances with an existing Admin Server.
+This command does the set up necessary for the use of the Console to manage
+the Directory Server instances you are registering. You can register local
+Directory Server instances with a local Configuration Directory Server/Admin
+Server. You can also create an Admin Server and register standalone instances
+with it. You can register remote Directory Server instances to the local
+Admin Server, as well as register local Directory Server instances with a
+remote Admin Server - this allows a single Console/Admin Server to manage all
+the Directory Servers in your network.
Use this command with the \fB--update\fR option after an upgrade to refresh
the server information (version, build number, etc.) in the Console.
@@ -68,8 +71,8 @@ Update an existing installation (e.g. after upgrading packages)
.B \fB\-\-continue
(update only) keep going despite errors (also --force)
.PP
-For all options, you can also use the short name e.g. \fB\-h\fR, \fB\-d\fR, etc.
-For the \fB\-d\fR argument, specifying it more than once will increase the debug
+For all options, you can also use the short name e.g. \fB\-h\fR, \fB\-d\fR, etc.
+For the \fB\-d\fR argument, specifying it more than once will increase the debug
level e.g. \fB\-ddddd\fR
.PP
args:
@@ -85,20 +88,25 @@ or
.IP
"slapd.Suffix=dc=example,dc=com"
.PP
-Values passed in this manner will override values in an .inf file given with
+Values passed in this manner will override values in an .inf file given with
the \fB\-f\fR argument.
.SH Silent Mode (.inf file)
.PP
-Here is an example of an .inf file that registers a local Directory Server instance with a remote server over SSL:
+The .inf file use three directives depending on what you want to do: [General], [admin], and [register].
+The [admin] section is only needed if an Admin Server needs to be installed on the local system.
+.br
+
+Here is an example of creating an Admin Server, and turning a standalone Directory Server instance into
+a configuration instance. In this case we need the [General], [admin], and [register] directives
.IP
[General]
.br
FullMachineName= localhost.localdomain
.br
-SuiteSpotUserID= nobody
+SuiteSpotUserID= dirsrv
.br
-SuiteSpotGroup= nobody
+SuiteSpotGroup= dirsrv
.br
AdminDomain= redhat.com
.br
@@ -126,7 +134,69 @@ ServerAdminPwd= password
.br
configinst= slapd-localhost::cn=directory manager::password
.br
-instance= slapd-replica::cn=directory manager::password
+
+.PP
+Here is an example of an .inf file that registers two local Directory Server
+instances (slapi-replica, slapd-instance2) with the local Configuration
+Directory Server (slapd-localhost).
+.IP
+[General]
+.br
+FullMachineName= localhost.localdomain
+.br
+SuiteSpotUserID= dirsrv
+.br
+SuiteSpotGroup= dirsrv
+.br
+AdminDomain= redhat.com
+.br
+ConfigDirectoryAdminID= admin
+.br
+ConfigDirectoryAdminPwd= admin
+.br
+ConfigDirectoryLdapURL= ldap://localhost.localdomain:389/o=NetscapeRoot
+.br
+
+.br
+[register]
+.br
+configinst= slapd-localhost::cn=directory manager::password
+.br
+localinst= slapd-instance2::cn=directory manager::password
+.br
+localinst= slapd-replica::cn=directory manager::password
+.br
+
+.PP
More information about the Pkg-fedora-ds-maintainers
mailing list