Perl system() call throws an error
Hello,
I am back with another issue in cPanel-Perl Call.
My Perl Module function has some system() command to execute
below is a piece of code
my $command = "/root/letsencrypt/./certbot-auto certonly --standalone -n -d ". $domainname ." -w ". $webroot;
system ($command);
my code always ends with below error response which is from "error_log"
[2018-04-09 12:21:14 -0500] warn [Internal Warning while parsing unknown 13256] Can't exec "/root/letsencrypt/./certbot-auto": Permission denied at /usr/local/cpanel/Cpanel/API/CertificateDetails.pm line 80.
I think its very chilly mistake, but i couldn't able to find so far. Can anyone help to resolve this please.
Thanks in advance
Rajkumar
-
What user is running this perl script? Does that user have access to execute /root/letsencrypt/./certbot-auto? If the user running the perl script is an under-privileged user (i.e. not root) then they may not have access to /root/letsencrypt/./certbot-auto and you probably don't want them to have access to /root/letsencrypt/./certbot-auto. 0 -
[2018-04-09 12:21:14 -0500] warn [Internal Warning while parsing unknown 13256] Can't exec "/root/letsencrypt/./certbot-auto": Permission denied at /usr/local/cpanel/Cpanel/API/CertificateDetails.pm line 80.
Hello, In addition to the information requested in the previous post, can you also let us know the permission and ownership values you've configured for the /root/letsencrypt/./certbot-auto file? Thank you.0 -
Hello, In addition to the information requested in the previous post, can you also let us know the permission and ownership values you've configured for the /root/letsencrypt/./certbot-auto file? Thank you.
letsencrypt folder has 755 access rights and root ownership Thank you.0 -
Hello, This seems more like an issue with the Perl code itself as opposed to a cPanel & WHM API function. I recommend troubleshooting this on a website where Perl coding itself is discussed (e.g. StackOverflow). Also, it looks like you are troubleshooting this particular topic on the following external URL: Execute certbot-auto command using perl system command Feel free to post the outcome here or let us know of any additional questions. Thank you. 0 -
There is some access rights issues. i have tried to execute this plugin from another user which is running in root. Now i am moving the cPanel plugin into WHM plugin. Thank you. 0
Please sign in to leave a comment.
Comments
5 comments