Perl system() call throws an error

srkumar1986

Member
Mar 28, 2018
13
2
3
Coimbatore, Tamil Nadu
cPanel Access Level
Root Administrator
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
 

sparek-3

Well-Known Member
Aug 10, 2002
1,985
218
343
cPanel Access Level
Root Administrator
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,213
363
[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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,213
363
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.