[ltb-dev] [LDAP Tool Box - Bug #540] (Closed) Init script does not throw error if backup failed

noreply at lsc-project.org noreply at lsc-project.org
Mon Mar 11 23:02:00 CET 2013


Issue #540 has been updated by Clément OUDOT.

Status changed from Assigned to Closed
Target version changed from openldap-initscript-? to openldap-initscript-2.0
% Done changed from 0 to 100


----------------------------------------
Bug #540: Init script does not throw error if backup failed
http://tools.lsc-project.org/issues/540

Author: Clément OUDOT
Status: Closed
Priority: Normal
Assigned to: Clément OUDOT
Category: OpenLDAP init script
Target version: openldap-initscript-2.0


Because of chown done after slapcat command, we do net get the return of slapcat command. If it fails, the script does not stop.

Fix:
<pre>
                        # slapcat
                        ret=0
                        if [ -z "$SU" ]
                        then
                                $SLAPCAT_BIN -b "$sufprint" $SLAPCAT_PARAMS -l "$file"
                                ret=$?
                        else
                                $SU "$SLAPCAT_BIN -b \"$sufprint\" $SLAPCAT_PARAMS" > "$file"
                                ret=$?
                                chown $SLAPD_USER:$SLAPD_GROUP $file
                        fi

                        # alert
                        if [ $ret -ne 0 ]
                        then
                                message "alert" "[ALERT] OpenLDAP database backup failed"
                                exit 1
                        fi

</pre>


-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://tools.lsc-project.org/my/account
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ltb-project.org/pipermail/ltb-dev/attachments/20130311/15c8ab63/attachment.htm>


More information about the ltb-dev mailing list