• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

Question Call custom shell command with callSbin from within extension

wlanrouterking

New Pleskian
Server operating system version
AlmaLinux 8
Plesk version and microupdate number
Plesk Obsidian 18.0.48
I am currently developing a extension for plesk. I need to use shell scripts for creating files with root privileges. The test command already exists and i created a symlink from /usr/local/psa/admin/bin/test-command.sh to the mod wrapper in /usr/local/psa/admin/sbin/mod_wrapper. When i try to execute the command right now i am getting the following error:
test-command.sh: execve failed for /usr/local/psa/admin/sbin/modules//bin/test-command.sh: No such file or directory System error 2

First question is: Why there is a double slash and the bin directory in front of the shell script?
How does the mapping of the sbin directory work?
i mapped the sbin directory in my project to /usr/local/psa/admin/sbin/modules/test-extension and i execute the command in my IndexController like:
pm_ApiCli::callSbin('test-command.sh', [$param1, $param2]);

I couldnt find any good sources in google explaining the concept of shell scripts in plesk.
Would be great if someone could help me with this issue.
 
Back
Top