system command via perl script??

system command via perl script??

am 05.10.2004 00:01:20 von Eric Haskins

Hello,

I currently develop in PHP but I have hit a wall. Is it possible to run
this command and variations of it

killall -USR2 appname

via a web script in perl?? I have an app that runs on my development server
and cant get PHP system() or exec() to work. If it is possible please
direct me to some info on it.

--
Eric Haskins
RackSPEED.Net
WebHosting from $4.99/month
Dedicated Servers
Multiple UpStream Providers

Re: system command via perl script??

am 05.10.2004 02:48:59 von Jim Gibson

In article , Eric Haskins
wrote:

> Hello,
>
> I currently develop in PHP but I have hit a wall. Is it possible to run
> this command and variations of it
>
> killall -USR2 appname

Yes.

>
> via a web script in perl?? I have an app that runs on my development server
> and cant get PHP system() or exec() to work. If it is possible please
> direct me to some info on it.

Perl has a built-in kill function, but it works on PID numbers, not
command names. You can also run the system version of killall with
Perl's system function. If you have access to a perl installation, you
can get more information with

perldoc -f kill
perldoc -f system


A quick search of CPAN (http://search.cpan.org) yields the
Proc::ProcessTable module with its associated Proc::Killall module.
Those might prove useful. If they are installed in your perl, do

perldoc Proc::ProcessTable
perldoc Proc::Killall

If that yields nothing, they are probably not installed. You can
install modules with

perl -MCPAN -e shell

Re: system command via perl script??

am 05.10.2004 10:52:51 von Joe Smith

Eric Haskins wrote:

> Hello,
>
> I currently develop in PHP but I have hit a wall. Is it possible to run
> this command and variations of it
>
> killall -USR2 appname
>
> via a web script in perl?? I have an app that runs on my development server
> and cant get PHP system() or exec() to work.

Are you having problems with system() in general, or just with killall?
If it is the latter, then it is probably because the web server is
running with a different UID than the app is running with.
-Joe