Huygens Remote Manager
  • Namespace
  • Class
  • Tree
  • Todo

Namespaces

  • hrm
    • job
    • param
      • base
    • setting
      • base
    • shell
    • stats
    • user
      • proxy

Classes

  • ExternalProcess
  • ExternalProcessFactory
  • LocalExternalProcess

Class ExternalProcess

Launches tasks on a shell on another host (via secure connection).

Direct known subclasses

hrm\shell\LocalExternalProcess

Namespace: hrm\shell
Package: hrm
Located at shell/ExternalProcess.php

Methods summary

public
# __construct( string $host, string $huscript_path, string $logfileName, string $errfileName )

ExternalProcess constructor.

ExternalProcess constructor.

Sets all shell pipes and file descriptors for given host.

Parameters

$host

Host on which the process will be started. All communication to the host will happen via secure connection.

$huscript_path
HuCore full executable path on host.
$logfileName
Name of the process log (relative to the global $logdir)
$errfileName
Name of the process error log (relative to the global $logdir)
public
# __destruct( )

Destructor

Destructor

public boolean
# existsHuygensProcess( integer $pid )

Checks whether an Huygens Process with given Process IDentifier exists.

Checks whether an Huygens Process with given Process IDentifier exists.

Parameters

$pid
Process identifier as returned by the OS.

Returns

boolean

True if the process exists, false otherwise. \todo Refactor

public boolean
# isHuygensProcessSleeping( integer $pid )

Checks whether the Huygens Process with given Process IDentifier is sleeping.

Checks whether the Huygens Process with given Process IDentifier is sleeping.

Parameters

$pid
Process identifier as returned by the OS.

Returns

boolean

True if the process is sleeping, false otherwise. \todo Refactor: why is this saving to hrm_tmp?

public
# rewakeHuygensProcess( integer $pid )

Wakes up the Huygens Process with given Process IDentifier

Wakes up the Huygens Process with given Process IDentifier

Parameters

$pid
Process identifier as returned by the OS.

Todo

Replace deprecated split() call.
public boolean
# ping( )

Pings the host.

Pings the host.

Returns

boolean
True if pinging the host was successful, false otherwise.

Todo

Refactor: why is this saving to hrm_tmp?
public integer
# pid( )

Returns the Process IDentifier of the Huygens process.

Returns the Process IDentifier of the Huygens process.

Returns

integer
The pid of the process.
public boolean
# runShell( )

Starts the shell.

Starts the shell.

Returns

boolean
True if the shell started successfully, false otherwise.
public boolean
# execute( string $command )

Executes a command.

Executes a command.

Parameters

$command
Command to be executed on the host.

Returns

boolean
True if the command was executed, false otherwise.
public
# removeFile( string $fileName )

Attempts to remove a file, if existing.

Attempts to remove a file, if existing.

Parameters

$fileName
The name of the file including its path.
public
# renameFile( string $oldName, string $newName )

Attempts to rename a file, if existing.

Attempts to rename a file, if existing.

Parameters

$oldName
The name of the file including its path.
$newName
The new name of the file including its path.
public string
# readFile( string $fileName )

Attempts to read a file, if existing.

Attempts to read a file, if existing.

Parameters

$fileName
The name of the file including its path.

Returns

string
The contents of the file in an array.
public boolean
# copyFile2Host( string $fileName )

Copies a local file to another server.

Copies a local file to another server.

Parameters

$fileName
The name of the file including its path.

Returns

boolean
True if succeeded, false otherwise.
public integer
# runHuygensTemplate( string $templateName )

Runs the Huygens template with a given name in the shell.

Runs the Huygens template with a given name in the shell.

Parameters

$templateName
File name of the Huygens template.

Returns

integer
The Process Identifier of the running task

Todo

Improve the pid acquisition process.
Better management of file handles.
Refactor!
public
# release( )

Releases all files and pipes and closes the shell.

Releases all files and pipes and closes the shell.

public boolean
# killHucoreProcess( integer $pid )

Kill the Huygens process with the given Process IDentifier and its child, if it exists.

Kill the Huygens process with the given Process IDentifier and its child, if it exists.

Parameters

$pid
Process IDentifier of the Job,

Returns

boolean
True if the Job was killed, false otherwise.
public boolean
# killHucoreChild( integer $ppid )

Kill the child of the Huygens process if it exists.

Kill the child of the Huygens process if it exists.

Parameters

$ppid
Process Identifier of the parent.

Returns

boolean
True if a child was killed or didn't exist, false otherwise.

Properties summary

public integer $pid

OS Identifier for the Process

OS Identifier for the Process

#
public string $host

Host on which the process will be started.

Host on which the process will be started.

Todo

Implement better management of multiple hosts
#
public string $huscript_path

HuCore full executable path on host.

HuCore full executable path on host.

For historical reason, HuCore is still referred to as huscript.

#
public array $pipes

Pipes for communication with the process.

Pipes for communication with the process.

#
public resource $shell

The shell process resource.

The shell process resource.

#
public string $logfileName

Name of the process log (relative to the global $logdir)

Name of the process log (relative to the global $logdir)

#
public string $errfileName

Name of the process error log (relative to the global $logdir)

Name of the process error log (relative to the global $logdir)

#
public resource $out_file

Handle for the output file.

Handle for the output file.

#
public array $descriptorSpec

File descriptors to open in the shell.

File descriptors to open in the shell.

#
Huygens Remote Manager API documentation generated by ApiGen