Hide Forgot
Description of problem: db2ldif -s <suffix1> -s <suffix2> or db2ldif -n <backend1> -n <backend2> is not considering all the parameters. The reason is rather obvious: ================ while getopts "hZ:vd:D:ENa:rs:x:CSut:n:UmMo1qc:" flag do case $flag in h) usage exit 0;; Z) servid=$OPTARG;; n) benameopt="-n $OPTARG" required_param="yes";; s) includeSuffix="-s \"$OPTARG\"" required_param="yes";; x) excludeSuffix="-x \"$OPTARG\"";; ================= should be: ================ while getopts "hZ:vd:D:ENa:rs:x:CSut:n:UmMo1qc:" flag do case $flag in h) usage exit 0;; Z) servid=$OPTARG;; n) benameopt=$benameopt" -n $OPTARG" required_param="yes";; s) includeSuffix=$includeSuffix" -s \"$OPTARG\"" required_param="yes";; x) excludeSuffix=$excludeSuffix" -x \"$OPTARG\"";; ================= Version-Release number of selected component (if applicable): 389-ds-base-1.3.4.0-29.el7.x86_64 (this is only RHEL7 issue. RHEL6 is doing the right way by passing the full command line to ns-slapd db2ldif). How reproducible: always Steps to Reproduce: use multiple suffix in export, for instance Workaround: change the script shown before.
Upstream ticket: https://fedorahosted.org/389/ticket/48828
Hi German, Your patch looks good to me. Could you please generate a git patch and attach it to the ticket 48828? https://fedorahosted.org/389/ticket/48828 I'll push it for you. Thanks! --noriko
DS builds: [root@ds ~]# rpm -qa | grep 389 389-ds-base-1.3.5.6-1.el7.x86_64 389-ds-base-libs-1.3.5.6-1.el7.x86_64 Steps Performed: On a standalone DS instance, 1. Created a new backend named "userData" and a new root suffix "dc=redhat,dc=com" 2. Added some entries to the root suffix "dc=redhat,dc=com" as below: [root@ds ~]# ldapadd -x -D 'cn=Directory Manager' -w secret123 -h localhost -p 389 -f new_suffix.ldif adding new entry "dc=redhat,dc=com" adding new entry "ou=Users,dc=redhat,dc=com" adding new entry "uid=tuser0,ou=Users,dc=redhat,dc=com" adding new entry "uid=tuser1,ou=Users,dc=redhat,dc=com" adding new entry "uid=tuser2,ou=Users,dc=redhat,dc=com" adding new entry "uid=tuser3,ou=Users,dc=redhat,dc=com" adding new entry "uid=tuser4,ou=Users,dc=redhat,dc=com" adding new entry "uid=tuser5,ou=Users,dc=redhat,dc=com" adding new entry "uid=tuser6,ou=Users,dc=redhat,dc=com" adding new entry "uid=tuser7,ou=Users,dc=redhat,dc=com" adding new entry "uid=tuser8,ou=Users,dc=redhat,dc=com" adding new entry "uid=tuser9,ou=Users,dc=redhat,dc=com" 3. Exported both root suffixes at once using db2ldif as below: [root@ds ~]# /usr/lib64/dirsrv/slapd-ds/db2ldif -s "dc=example,dc=com" -s "dc=redhat,dc=com" Exported ldif file: /var/lib/dirsrv/slapd-ds/ldif/ds-example-redhat-2016_06_27_133919.ldif [27/Jun/2016:13:39:19.295507690 +051800] Backend Instance(s): [27/Jun/2016:13:39:19.397681216 +051800] userRoot [27/Jun/2016:13:39:19.414418295 +051800] UserData ldiffile: /var/lib/dirsrv/slapd-ds/ldif/ds-example-redhat-2016_06_27_133919.ldif [27/Jun/2016:13:39:19.444080681 +051800] export userRoot: Processed 9 entries (100%). [27/Jun/2016:13:39:19.464472276 +051800] All database threads now stopped ldiffile: /var/lib/dirsrv/slapd-ds/ldif/ds-example-redhat-2016_06_27_133919.ldif [27/Jun/2016:13:39:19.493176052 +051800] export UserData: Processed 12 entries (100%). [27/Jun/2016:13:39:19.514742424 +051800] All database threads now stopped 4. Checked the /var/lib/dirsrv/slapd-ds/ldif directory [root@ds ~]# ll /var/lib/dirsrv/slapd-ds/ldif/ds-example-redhat-2016_06_27_133919.ldif -rw-------. 1 dirsrv dirsrv 9305 Jun 27 13:39 /var/lib/dirsrv/slapd-ds/ldif/ds-example-redhat-2016_06_27_133919.ldif as can be seen above, an ldif file containing the data of both root suffixes is created 5. Exported both backends at once using db2ldif as below: [root@ds ~]# /usr/lib64/dirsrv/slapd-ds/db2ldif -n userRoot -n userData Exported ldif file: /var/lib/dirsrv/slapd-ds/ldif/ds-userRoot-userData-2016_06_27_134234.ldif WARNING: several backends are being exported to a single ldif file use option -M to export to multiple ldif files ldiffile: /var/lib/dirsrv/slapd-ds/ldif/ds-userRoot-userData-2016_06_27_134234.ldif [27/Jun/2016:13:42:34.764595457 +051800] export userRoot: Processed 9 entries (100%). [27/Jun/2016:13:42:34.920198735 +051800] All database threads now stopped ldiffile: /var/lib/dirsrv/slapd-ds/ldif/ds-userRoot-userData-2016_06_27_134234.ldif [27/Jun/2016:13:42:34.940199101 +051800] export UserData: Processed 12 entries (100%). [27/Jun/2016:13:42:34.970829119 +051800] All database threads now stopped 6. Checked the /var/lib/dirsrv/slapd-ds/ldif directory [root@ds ~]# ll /var/lib/dirsrv/slapd-ds/ldif/ds-userRoot-userData-2016_06_27_134234.ldif -rw-------. 1 dirsrv dirsrv 9305 Jun 27 13:42 /var/lib/dirsrv/slapd-ds/ldif/ds-userRoot-userData-2016_06_27_134234.ldif as can be seen above, an ldif file containing the data of both backends is created Additional info: I've performed the same steps with db2ldif.pl perl script and it works correctly as well.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2016-2594.html