Why execute a command with exec, do not succeed inside the script, put to the server command line is OK, little brother I also made the configuration in/etc/sudoers

Source: Internet
Author: User
Why execute a command with exec is unsuccessful within the script, put it on the server command line, and I've configured it in/etc/sudoers.
I first made the following configuration in/etc/sudoers

And then restarted the next Apache server.
Within the TP frame, write to

EXEC ('/usr/bin/unoconv--server localhost--port 8100-o/usr/local/webserver/www/server/exam/public/uploads/ Resource/transform/document/201309/52419a788a553.pdf-f pdf/usr/local/webserver/www/server/exam/public/uploads/ Resource/untransform/document/201309/52419a788a553.doc ');

Run under, no effect, transcoding is not successful, the code directly out can be executed.

At the same time, I wrote the transcoding section into a shell script.

#!/bin/sh


Turncode () {
Local pdf= ' echo $ | cut-d:-f1 ';
Local file= ' echo $ | cut-d:-f2 ';
Echo $pdf;
Echo $file;
'/usr/bin/unoconv--server localhost--port 8100-o $pdf-F PDF $file '

}



Action= "$"
Setting= "$"
Case $action in

Turncode)
Turncode "$setting"
;;

*)
;;

Esac


Called by exec

EXEC ("sudo./bash turncode $save _path1: $file _path1", $out, $status);

The result is still unable to transcode, who has been kindly pointed out, not very grateful!!! Shell

Share to:


------Solution--------------------
command line, you are using the permissions of your account. The script can be different, completely controlled by the owner or the creator's account permissions.
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.