[Vienna-pm] Krauses Problem mit system in Linux

Stefan Seifert nine at detonation.org
Wed May 13 01:20:10 PDT 2009


On Wednesday, 13. May 2009, nagy wrote:

> Der Ausdruckt funktioniert auf der Commandline.
>
> print system('sudo -u xxxx -p xxxxx  /etc/rc3.d/S86tomcat8181 stop'); #

Ich kann mir nicht vorstellen, dass das funktioniert, es sei denn du hast eine 
komplett andere Version von sudo als ich:

man sudo:
"-p  The -p (prompt) option allows you to override the default password prompt 
and use a custom one.  The following percent (`%') escapes are supported..."

Was sudo nicht erlaubt ist, das Passwort auf der command line mitzugeben.

"Upon successful execution of a program, the return value from sudo will 
simply be the return value of the program that was executed. Otherwise, sudo 
quits with an exit value of 1 if there is a configuration/permission problem 
or if sudo cannot execute the given command."

Der 1er, den du da bekommst scheint genau der Hinweis zu sein, dass sudo das 
Script nicht ausführen konnte.

Stefan


More information about the Vienna-pm mailing list