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

zmcertmgr error #168

Closed
skelkelos992 opened this issue Jun 4, 2023 · 1 comment
Closed

zmcertmgr error #168

skelkelos992 opened this issue Jun 4, 2023 · 1 comment

Comments

@skelkelos992
Copy link

skelkelos992 commented Jun 4, 2023

The following error is shown when renewing a certificate and the deploy-hook is executed on a Rocky Linux 8 / Zimbra 9.0.0 server:

 Deploying certificates.
 zmcertmgr: ERROR deploycrt(comm /run/certbot_zimbra.sh/certs-oXnDDaXJ/cert.pem /run/certbot_zimbra.sh/certs-oXnDDaXJ/zimbra_chain.pem) failed:
  chdir(/root) failed: Permission denied

Folder permissions are the following

dr-xr-x--- 2 root zimbra 100 4 giu 10.08 certs-9YhF8BWL

To solve the issue I had to manually run as zimbra user

zmcertmgr deploycrt comm /run/certbot_zimbra.sh/certs-9YhF8BWL/cert.pem /run/certbot_zimbra.sh/certs-9YhF8BWL/zimbra_chain.pem

and then

zmcontrol restart

@jjakob
Copy link
Collaborator

jjakob commented Jun 4, 2023

zmcertmgr seems to want to chdir into PWD, since PWD=/root and zmcertmgr is ran as zimbra it doesn't have permission to access that path. I don't know why zmcertmgr is doing this, it doesn't need to. I didn't encounter this bug when doing testing as I always ran certbot_zimbra with sudo, never as logged-in root in /root.

@jjakob jjakob closed this as completed in 8b352f7 Jun 4, 2023
jjakob added a commit that referenced this issue Jun 18, 2023
capsh does not set HOME to the user's home. Reverting to sudo is
necessary to set the user's HOME and other login environment.
sudo was previously replaced with capsh in 930fa01.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants