%META:TOPICINFO{author="StephaneLenclud" date="1179353087" format="1.1" version="1.5"}%
---+!! Task Executer
<!--
One line description, required for extensions repository catalog.
   * Set SHORTDESCRIPTION = Scripts running on a remote machine and executing tasks as defined by TaskExeContrib.
-->
%SHORTDESCRIPTION%

%TOC%

---++ Purpose & scope 

The task executer is running on a remote machine executing a task. It is a key concept of the TWiki.TaskExeContrib.
Here we describe how to set-up and use an executer machine. We also provide technical information about the executer implementation.

---++ Installation instructions

DO NOT install on a TWiki server. <br />
The task executer is typically set-up on a remote machine where it runs as a __Linux service__ or __Windows service__.

---+++ MS Windows executer set-up

In the following set-up instructions paths and command lines are given as examples and should be altered according to your machine settings. 

   1 Set-up a web server. Preferably Apache 2.2.
   1 Install the executer using the [[%ATTACHURL%/ExecuterSetup.msi][Windows installer]] provided.
   1 Fix the [[http://en.wikipedia.org/wiki/Shebang_%28Unix%29][Shebang line]] in the CGI =exestart= and =exestatus=.
   1 Copy the folder =c:\executer\cgi-bin\executer= to your web server =cgi-bin= directory. 
   1 Set the credentials for accessing your TWiki web site in =c:\executer\cfg\executer.cfg=.  
   1 Set the =smtphost= in =c:\executer\cfg\executer.cfg= for =SENDMAIL= command.
   1 Run the Executer:
      * In a console:
         * Open a console. Go to =c:\executer\bin\executer= and run =perl executer.pl=.
      * As a Windows service:
         * You can use [[https://slion.net/view/Dev/ExeService][ExeService]] to set it up for you. 
         * Double check the service's _Log On_ information. Maybe you want to use specific user to gain write access to your TWiki pages.

__Note:__ When using MS Windows operating system as a build server you may want to prevent long running process to freeze on a dialog box:
   1 [[http://www.support.microsoft.com/kb/229012/en-us/][Disable Windows modal dialog box]] that can potentially freeze the executer.
   1 Restart your machine if you have updated the MS Windows registry.

---+++ Linux executer set-up

   1 Set-up a web server. Preferably Apache 2.2.
   1 Install the =zip= or =tgz= provided in your home directory. 
   1 Fix the [[http://en.wikipedia.org/wiki/Shebang_%28Unix%29][Shebang line]] in the CGI =exestart= and =exestatus=.
   1 Set the credentials for accessing your TWiki web site in =~/executer/cfg/executer.cfg=  
   1 Run the executer:
      * In a console:
         * Open a console. Go to =~/executer/bin/executer= and run =perl executer.pl=.

---+++ Executer registration

Once your machine is set-up [[ExecuterRegistration][register your executer]].

---+++ Executer troubleshooting

If you are experiencing problems with an Executer you should:
   * Check login/password in =executer.cfg=
   * Check login/password of the Executer Windows service
   * Delete files in =c:\executer=. DO NOT delete the directories in =c:\executer=.
   * Try to run it in console instead of Windows service

---++ System documentation

*\lib\Slion\bin\executer.pl* - Infinite loop using !Slion::TWiki::Executer and waiting for task request from web server. <br />
*\lib\Slion\TWiki\Executer.pm* - Sub class !Slion::TWiki::Client adding functionalities for parsing a Task topic and and executing Commands <br />
*\lib\Slion\TWiki\Client.pm* - Provides API for reading and writing topics from a TWiki web site <br />
*\cgi-bin\executer\exestatus* - CGI, output some Javascript for automatic status update from web page. <br />
*\cgi-bin\executer\exestart* - CGI, used to trigger a [[TWiki.TaskExeContrib#Task][Task]].

---++ Package content

     | *File:* | *Description:* |
   | ==data/TWiki/TaskExeContrib.txt== | Documentation |
   | ==data/TWiki/TaskExeManager.txt== | TWiki Application  |
   | ==data/TWiki/TaskStarter.txt== | TWiki Application |
   | ==data/TWiki/TaskSpecList.txt== | TWiki Application |
   | ==data/TWiki/TaskSpecCreate.txt== | TWiki Application |
   | ==data/TWiki/TaskSpecForm.txt== | TWiki Application |
   | ==data/TWiki/TaskSpecTemplate.txt== | TWiki Application |
   | ==data/TWiki/TaskSpecSelect.txt== | TWiki Application |
   | ==data/TWiki/ExecuterContrib.txt== | Documentation |
   | ==data/TWiki/ExecuterList.txt== | TWiki Application |
   | ==data/TWiki/ExecuterRegistration.txt== | TWiki Application |
   | ==data/TWiki/ExecuterForm.txt== | TWiki Application |
   | ==data/TWiki/ExecuterTemplate.txt== | TWiki Application |
   | ==data/TWiki/ExecuterSelect.txt== | TWiki Application |
   | ==data/Sandbox/TaskSpecDemo.txt== | TWiki Application |
   | ==data/Sandbox/TaskExeParent.txt== | TWiki Application |


---++ Contrib Info

|  Author: | TWiki:Main/StephaneLenclud |
|  Copyright &copy;: | 2006-2007,  Stphane Lenclud, All Rights Reserved |
|  Contrib Version: | 15567 (12 Dec 2008) |
|  License: | [[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]] |
|  Change History: | <!-- versions below in reverse order -->&nbsp; |
|  16 May 2007 | Adding support for =$taskspecweb=, =$taskspectopic= and =SENDMAIL= |
|  15 May 2007 | Adding support for =URLEXISTS=, =IF=, =ELSE=, =ENDIF= |
|  14 May 2007 | Initial release |
|  Dependencies: | <table border="1"><tr><th>Name</th><th>Version</th><th>Description</th></tr><tr><td align="left">TWiki::Plugins::TaskExePlugin</td><td align="left">&gt;=latest</td><td align="left">Required. Download and install from TWiki:Plugins/TaskExePlugin </td></tr></table> <br /> Other dependencies might be added through the [[TWiki.TaskExeContrib#Task_Specification][Task specification]]. |
|  Contrib Home: | http://twiki.org/cgi-bin/view/Plugins/ExecuterContrib |
|  Feedback: | http://twiki.org/cgi-bin/view/Plugins/ExecuterContribDev |
|  Appraisal: | http://twiki.org/cgi-bin/view/Plugins/ExecuterContribAppraisal |

<!-- Do _not_ attempt to edit this topic; it is auto-generated. Please add comments/questions/remarks to the Dev topic instead. -->

%META:FILEATTACHMENT{name="ExecuterSetup.msi" attachment="ExecuterSetup.msi" attr="" comment="Windows installer" date="1179311219" path="ExecuterSetup.msi" size="108544" stream="ExecuterSetup.msi" user="Main.StephaneLenclud" version="3"}%
