Index: kernel/classes/ezruncronjobs.php
===================================================================
--- kernel/classes/ezruncronjobs.php	(revision 25229)
+++ kernel/classes/ezruncronjobs.php	(working copy)
@@ -40,6 +40,7 @@
         $scriptMutex = new eZMutex( $scriptFile );
         $lockTS = $scriptMutex->lockTS();
         $runScript = false;
+        $maxTime = self::maxScriptExecutionTime();
         if ( $lockTS === false )
         {
             if ( $scriptMutex->lock() )
@@ -52,14 +53,14 @@
                 $cli->error( 'Failed to aquire cronjob part lock: ' . $scriptFile );
             }
         }
-        // If the cronjob part has been blocked for  2 * eZRunCronjobs_MaxScriptExecutionTime,
+        // If the cronjob part has been blocked for  2 * self::maxScriptExecutionTime(),
         // force stealing of the cronjob part
-        else if ( $lockTS < time() - 2 * eZRunCronjobs_MaxScriptExecutionTime )
+        else if ( $lockTS < time() - 2 * $maxTime )
         {
             $cli->output( 'Forcing to steal the mutex lock: ' . $scriptFile );
             $runScript = eZRunCronjobs::stealMutex( $cli, $scriptMutex, true );
         }
-        else if ( $lockTS < time() - eZRunCronjobs_MaxScriptExecutionTime )
+        else if ( $lockTS < time() - $maxTime )
         {
             $cli->output( 'Trying to steal the mutex lock: ' . $scriptFile );
             $runScript = eZRunCronjobs::stealMutex( $cli, $scriptMutex );
@@ -80,6 +81,24 @@
 
     /*!
      \static
+     Returns the maximum permitted execution time for cronjobs.
+     This may be different per cronjob part (see cronjob.ini).
+     \return execution time in seconds
+    */
+    static function maxScriptExecutionTime()
+    {
+        global $cronPart;
+        $cronjobIni = eZINI::instance( 'cronjob.ini' );
+
+        $scriptGroup = "CronjobPart-$cronPart";
+        if ( $cronPart !== false and $cronjobIni->hasVariable( $scriptGroup, 'MaxScriptExecutionTime' ) )
+            return $cronjobIni->variable( $scriptGroup, 'MaxScriptExecutionTime' );
+        else
+            return $cronjobIni->variable( 'CronjobSettings', 'MaxScriptExecutionTime' );
+    }
+
+    /*!
+     \static
      \private
 
      Steal a script mutex
Index: runcronjobs.php
===================================================================
--- runcronjobs.php	(revision 25229)
+++ runcronjobs.php	(working copy)
@@ -29,13 +29,10 @@
 
 
 // No more than one instance of a cronjob script can be run at any given time. If a script uses more
-// time than eZRunCronjobs_MaxScriptExecutionTime, the next instance of it will try to gracefully steal
-// the cronjob script mutex. If the process has been running for more than
-// two times the eZRunCronjobs_MaxScriptExecutionTime, the original process will be killed.
+// time than the configured MaxScriptExecutionTime (see cronjob.ini), the next instance of it will
+// try to gracefully steal the cronjob script mutex. If the process has been running for more than
+// two times MaxScriptExecutionTime, the original process will be killed.
 
-// Define maximum script execution time to 12 hours
-define( 'eZRunCronjobs_MaxScriptExecutionTime', 12*3600 );
-
 // Set a default time zone if none is given. The time zone can be overriden
 // in config.php or php.ini.
 if ( !ini_get( "date.timezone" ) )
Index: settings/cronjob.ini
===================================================================
--- settings/cronjob.ini	(revision 25229)
+++ settings/cronjob.ini	(working copy)
@@ -25,6 +25,14 @@
 #Extension directory for cronjobs.
 ExtensionDirectories[]
 
+# No more than one instance of a cronjob script can be run at any given time.
+# If a script uses more time than MaxScriptExecutionTime, the next instance of
+# it will try to gracefully steal the cronjob script mutex. If the process has
+# been running for more than two times MaxScriptExecutionTime, the original
+# process will be killed. The default is 12 hours. MaxScriptExecutionTime can
+# also be set per cronjob part, that will override this global setting.
+MaxScriptExecutionTime=43200
+
 [CronjobPart-infrequent]
 Scripts[]=basket_cleanup.php
 Scripts[]=linkcheck.php
