GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  REX::COMMANDS::PROCESS (3)

.ds Aq ’

NAME

Rex::Commands::Process - Process management commands

CONTENTS

DESCRIPTION

With this module you can manage processes. List, Kill, and so on.

Version <= 1.0: All these functions will not be reported.

All these functions are not idempotent.

SYNOPSIS



 kill $pid;
 killall "apache2";
 nice($pid, $level);



EXPORTED FUNCTIONS

kill($pid, CW$sig)

Will kill the given process id. If $sig is specified it will kill with the given signal.



 task "kill", "server01", sub {
   kill 9931;
   kill 9931, -9;
 };



killall($name, CW$sig)

Will kill the given process. If $sig is specified it will kill with the given signal.



 task "kill-apaches", "server01", sub {
   killall "apache2";
   killall "apache2", -9;
 };



    ps

List all processes on a system. Will return all fields of a ps aux.



 task "ps", "server01", sub {
   for my $process (ps()) {
    say "command  > " . $process->{"command"};
    say "pid    > " . $process->{"pid"};
    say "cpu-usage> " . $process->{"cpu"};
   }
 };



On most operating systems it is also possible to define custom parameters for ps() function.



 task "ps", "server01", sub {
   my @list = grep { $_->{"ni"} == -5 } ps("command","ni");
 };



This example would contain all processes with a nice of -5.

nice($pid, CW$level)

Renice a process identified by $pid with the priority $level.



 task "renice", "server01", sub {
   nice (153, -5);
 };



Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 REX::COMMANDS::PROCESS (3) 2016-03-07

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.