Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Perl system() call throws an error

Discussion in 'cPanel Developers' started by srkumar1986, Apr 9, 2018.

  1. srkumar1986

    srkumar1986 Member

    Joined:
    Mar 28, 2018
    Messages:
    13
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    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
     
  2. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,762
    Likes Received:
    116
    Trophy Points:
    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.
     
  3. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. srkumar1986

    srkumar1986 Member

    Joined:
    Mar 28, 2018
    Messages:
    13
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Coimbatore, Tamil Nadu
    cPanel Access Level:
    Root Administrator

    letsencrypt folder has 755 access rights and root ownership

    Thank you.
     
  5. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. srkumar1986

    srkumar1986 Member

    Joined:
    Mar 28, 2018
    Messages:
    13
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Coimbatore, Tamil Nadu
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice