Help:Extension/ScriptFunctions

From Metabolomics.JP
(Difference between revisions)
Jump to: navigation, search
Line 18: Line 18:
 
== Download ==
 
== Download ==
 
<table border="1" cellpadding="3" cellspacing="1">
 
<table border="1" cellpadding="3" cellspacing="1">
  <tr><td>version</td><td>source</td><td>size</td></tr>
+
  <tr><td>version</td><td>source</td><td>md5</td></tr>
 
  <tr><td>0.1(September 11,2008)</td><td>ScriptFunctions.phps</td><td></td></tr>
 
  <tr><td>0.1(September 11,2008)</td><td>ScriptFunctions.phps</td><td></td></tr>
 
</table>
 
</table>
Line 24: Line 24:
  
 
<table border="1" cellpadding="3" cellspacing="1">
 
<table border="1" cellpadding="3" cellspacing="1">
  <tr><td>version</td><td>source</td><td>size</td></tr>
+
  <tr><td>version</td><td>source</td><td>md5</td></tr>
 
  <tr><td>0.1(September 11,2008)</td><td>script_monitoring.sh</td><td></td></tr>
 
  <tr><td>0.1(September 11,2008)</td><td>script_monitoring.sh</td><td></td></tr>
 
</table>
 
</table>
Line 40: Line 40:
 
  <li>Put in any direcotry.( ideal: /etc/cron.d/ )</li>
 
  <li>Put in any direcotry.( ideal: /etc/cron.d/ )</li>
 
  <li>Insert follow line to /etc/crontab
 
  <li>Insert follow line to /etc/crontab
  <pre>* * * * * root /etc/cron.d/lua_monitoring.sh</pre></li>
+
  <pre>* * * * * root /etc/cron.d/script_monitoring.sh</pre></li>
 
</ol>
 
</ol>
  
 
== Function ==
 
== Function ==
 
# [[Help:Extensions#.7B.7B.23lua:program.7Carg.7D.7D|lua]]
 
# [[Help:Extensions#.7B.7B.23lua:program.7Carg.7D.7D|lua]]

Revision as of 10:42, 30 September 2008

Extension Information
Implementation
Description
Author(s)K, Suwa
Version0.1
MediaWiki1.11.1
License
Hooks used
Token type

Contents


Extension to use an external scripting language, Lua.

Since an infinite loop can be achieved by Lua, script_monitoring.sh run by crond will kill all Lua processes running longer than 10 seconds.

For security, Lua's io, debug, package, os library are nullified. Also, the program halts when it finds 'dofile'.

Requirements

lua

Download

versionsourcemd5
0.1(September 11,2008)ScriptFunctions.phps


versionsourcemd5
0.1(September 11,2008)script_monitoring.sh

Installtion

  1. Download the source code and rename it to ScriptFunctions.php and script_monitoring.sh.
  2. Place it in the extensions/ directory.
  3. Insert the follow lines to LocalSettings.php
    require_once( "$IP/extensions/ScritFunctions.php" );
    $egLuaPath = "path to directory which in lua binary";
    $egTmpPath = "path to tmp directory"; ( default: "/tmp" )

    $egLuaPath is required.

    $egTmpPath is a temporary place to save Lua programs.
  4. Put in any direcotry.( ideal: /etc/cron.d/ )
  5. Insert follow line to /etc/crontab
    * * * * * root /etc/cron.d/script_monitoring.sh

Function

  1. lua
Personal tools
Namespaces

Variants
Actions
Navigation
metabolites
Toolbox