Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with restoreconfig and stop when BACKUP_AT_SHUTDOWN="1" #87

Open
cyrilstoll opened this issue Jan 23, 2025 · 1 comment
Open

Issue with restoreconfig and stop when BACKUP_AT_SHUTDOWN="1" #87

cyrilstoll opened this issue Jan 23, 2025 · 1 comment
Assignees
Labels
Milestone

Comments

@cyrilstoll
Copy link

Hi

I think the slapd-cli script is missing to ret=$? statements which lead to an issue if BACKUP_AT_SHUTDOWN is set to "1" when executing slapd-cli with either restoreconfig or stop as action.

This is a real world output when executing "slapd-cli stop"

slapd-cli: [INFO] Using /usr/local/openldap/etc/openldap/slapd-cli.conf for configuration
slapd-cli: [INFO] Halting OpenLDAP...
slapd-cli: [OK] OpenLDAP stopped
slapd-cli: [INFO] Launching OpenLDAP database backup...
/usr/bin/xz: /var/backups/openldap/openldap-data-20250123143741.ldif.xz: File exists
slapd-cli: [ALERT] OpenLDAP database backup compression failed

The same ALERT message occurs when using the action "restoreconfig".

However it does not happen when I implement the "ret=$?" after line 1035 which is:

$UMASK $MASK && $BACKUP_COMPRESS_BIN "$file"

and after line 1037 which is:

$SU "$UMASK $MASK && $BACKUP_COMPRESS_BIN $file"

I am talking about the last line in the output with the ALERT message. That is what I think can easily be fixed when saving the return code in the ret variable.

You might have noticed a second issue with xz claiming the compressed file already esists. I was not yet able to understand why this sometimes happens and sometimes not. But I can live whit that and currently don't have time to investigate in more detail.

I am using OpenLDAP-LTB 2.6.x on RHEL 8 though the RHEL 9 script looks to be the same so probably has the same issue as well.

Let me know if I should create a pull request with my proposed change.

Best,
Cyril

@davidcoutadeur davidcoutadeur added this to the 3.5 milestone Jan 24, 2025
@davidcoutadeur davidcoutadeur self-assigned this Jan 24, 2025
@davidcoutadeur
Copy link
Contributor

Thank you for your feedback, we'll give a look at it for next openldap-ltb release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants