Hi everyone,
Basically I am trying to restart a service from a php web page.
Here is the code:
<?php
exec ('/usr/bin/sudo /etc/init.d/portmap restart');
?>
But, in /var/log/httpd/error_log, I get
unable to change to sudoers gid: Operation not permitted
and in /var/log/messages, I get
Sep 22 15:01:56 ri kernel: audit(12220...
Is there a wchar_t version of exec[lv][pe]* (i.e. an exec that uses wchar_t as path and wchar_t as arguments)?
In Windows, I can just do CreateProcessW(process, cmdline), but in *nix, I'm stuck (i.e. no pure POSIX equivalent).
I'm trying to add UTF-16 support to my program (an autorun).
...
I have a project the requires the use of the exec family. My project consist of making an interactive shell. The shell will implement a few basic commands like cd, ls, echo, etc. I have been researching the use of exec, but have not found a useful site. Any suggested links would help.
int ret;
ret = execl ("/bin/ls", "ls", "-1", (char *...
Hi,
I'd like to invoke bash using a string as input. Something like:
sh -l -c "./foo"
I'd like to do this from Java. Unfortunately, when I try to invoke the command using getRuntime().exec, I get the following error:
foo": -c: line 0: unexpected EOF while looking for matching `"'
foo": -c: line 1: syntax error: unexp...
I have a question about using os.execvp in Python. I have the following bit of code that's used to create a list of arguments:
args = [ "java"
, classpath
, "-Djava.library.path=" + lib_path()
, ea
, "-Xmx1000m"
, "-server"
, "code_swarm"
, params
]
When I output a string using ...
Here's some Ruby code:
puts %x{ pstree #{$$} } # never forks
puts %x{ pstree '#{$$}' } # forks on amd64 only
On 32-bit Ubuntu Dapper, I get this output:
t.rb---pstree
t.rb---pstree
Which makes sense to me. But on 64-bit Ubuntu Hardy, I get this:
t.rb---sh---pstree
t.rb---pstree
What's being shown here is that Ruby forks befor...
(Bear with me, I promise this gets to shebang and windows.)
I have about the simplest of WEBRick servers put together:
require 'webrick'
include WEBrick
s = HTTPServer.new(:Port=>2000, :DocumentRoot=>Dir::pwd)
s.start
Couldn't be simpler. This basic server does accept http connections (firefox, internet exploder, wget, TELENT) and ...
Hello,
I am doing the following in PHP:
exec('java -jar "/opt/flex3/lib/mxmlc.jar" +flexlib "/opt/flex3/frameworks" MyAS3App.as -default-size 360 280 -output MyAS3App.swf');
When I run this from the command line, it runs fine and finishes in a second or two.
When I run this command from PHP exec, the java process takes 100% CPU and ...
Below is the command I tried executing, without success:
exec('ln -s ' . PLUGIN_DIR . '/.htaccess ' . ABSPATH . '/.htaccess');
When you add a die() at the end, it catches that there's an error:
exec('ln -s ' . PLUGIN_DIR . '/.htaccess ' . ABSPATH . '/.htaccess') or die('what?!');
For the above exec() statement, a permissions proble...
I have a single windows shell command I'd like to run (via EXEC master..xp_cmdshell) once for each row in a table. I'm using information from various fields to build the command output.
I'm relativity new to writing T-SQL programs (as opposed to individual queries) and can't quite get my head around the syntax for this, or if it's even...
Hello,
I'm having a little problem with the following:
When I execute this line:
echo exec(createDir($somevariable));
I get this error:
Warning: exec() [function.exec]: Cannot execute a blank command in /home/mydir/myfile.inc.php on line 32
Any ideas.
Thanks.
...
Right now I'm using exec to redirect stderr to an error log with
exec 2>> ${errorLog}
The only downside is that I have to start each run with a timestamp since exec just pushes the text straight into the log file. Is there a way to redirect stderr but allow me to append text to it, such as a time stamp?
...
I am using this php code:
exec("unrar e file.rar",$ret,$code);
and getting an error code of illegal command ie 127 ... but when I am using this command through ssh its working ... because unrar is installed on the server ... so can anyone guess why exec is not doing the right stuff?
...
I'm trying to get an application (a game) to start with a Java script. There is a long explanation behind why, so I'll skip that part.
The game won't run unless it is executed from its own directory, IE: Just telling Java to launch the EXE gives errors within the game. It must be launched from its directory.
I've Googled for hours over...
How can I write a program in Java that will execute another program? Also, the input of that program should be given from our program and the output of that program should be written into a file.
This is my small set of code to get its output:
Process p = Runtime.getRuntime().exec("C:\\j2sdk1.4.0\bin\\helloworld.java");
BufferedReader ...
I want to delete the old log files in log directory.
To delete the log files which are more than 6 months,
I have written the script like
find /dnbusr1/ghmil/BDELogs/import -type f -mtime +120 -exec rm -f {} \;
By using this script i can able to delete the old files. But how to invoke this script by using java? please any one help me....
This does not work (taken from tfsbuild.proj) when queued in BuildExplorer:
Builddef for WFPApp1
.
.
.
.
.
.
.
but this does (taken from the app1.csproj) and build/rebuild inside the VS IDE
csproj for WFPApp1
.
.
.
.
.
.
in the first example, the build just seems to hang indefinitely until cancelled in the Build...
To run my App I need
AxInterop.WMPLib.dll and Interop.WMPLib.dll
that are located in Debug and Release folder
is there any way to include those dlls into exe? so my app is available in one file only.
...
Hello,
I need to write a simple program: There will be a Parent and a few programs [children] (started via execl in Parent). Children communicate to one another in this way: Child I sens to Parent number J, Parent sends a message (something like -- "there is a message to you") to J, J send to Parent number K etc. etc.
And there is a pr...
Hi,
My requirement is that i need to run batch file that is present in remote system from local machine. i am having the following code. But it is giving the following error :Path not correct". I have the ip address of the machine, and i have given the batch file as public share and share name is dsc.
ip address of the machine is 16.18...