Jump to content
Froxlor Forum
  • 0

Cronjobs funktionieren nicht


lolcat

Question

Guten Tag alle beisammen,

bei mir wollen die cronjobs nicht starten hier mal ein auszug der mail die ich vom system bekomme.

 

 

Message 13:

From ** Wed Feb 29 15:20:02 2012

Date: Wed, 29 Feb 2012 15:20:01 +0100

From: ** (Cron Daemon)

To: **

(failed)Cron <root@**> /usr/bin/php5 -q /var/www/froxlor/scripts/froxlor_master_cronjob.php

Content-Type: text/plain; charset=ANSI_X3.4-1968

X-Cron-Env: <PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin>

X-Cron-Env: <SHELL=/bin/sh>

X-Cron-Env: <HOME=/root>

X-Cron-Env: <LOGNAME=root>

 

Could not open input file: /var/www/froxlor/scripts/froxlor_master_cronjob.php

 

 

Habe Debian 6.0

Link to comment
Share on other sites

12 answers to this question

Recommended Posts

ja gibt es inhalt ist:

 

<?php

 

/**

* This file is part of the Froxlor project.

* Copyright © 2010 the Froxlor Team (see authors).

*

* For the full copyright and license information, please view the COPYING

* file that was distributed with this source code. You can also view the

* COPYING file online at http://files.froxlor.org/misc/COPYING.txt

*

* @copyright © the authors

* @author Froxlor team <team@froxlor.org> (2010-)

* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt

* @package Cron

*

*/

 

include_once(dirname(__FILE__) . '/../lib/cron_init.php');

 

$jobs_to_run = includeCronjobs($debugHandler, $pathtophpfiles);

 

/**

* check for --force to include cron_tasks

* even if it's not its turn

*/

if(isset($argv[1]) && strtolower($argv[1]) == '--force')

{

$crontasks = makeCorrectFile($pathtophpfiles.'/scripts/jobs/cron_tasks.php');

if(!in_array($crontasks, $jobs_to_run))

{

array_unshift($jobs_to_run, $crontasks);

}

}

 

foreach($jobs_to_run as $cron)

{

require_once($cron);

}

 

fwrite($debugHandler, 'Cronfiles have been included' . "\n");

 

/*

* we have to check the system's last guid with every cron run

* in case the admin installed new software which added a new user

* so users in the database don't conflict with system users

*/

$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Checking system\'s last guid');

checkLastGuid();

 

/*

* shutdown cron

*/

include_once($pathtophpfiles . '/lib/cron_shutdown.php');

 

?>

 

Link to comment
Share on other sites

sorry, also ich als "rookie" w?re so vorgegangen: Die Datei zu Testzwecken auf rwxrwxrwx setzen und schauen obs dann geht, wenn ja schlie?e ich auf ein Berechtigungsproblem!

 

@SaneG bin mir jetzt nicht sicher, aber da der CRON ja von root ausgef?hrt wird, spielt es glaub keine Rolle wer Besitzer ist (i think so)

Link to comment
Share on other sites

Da die Datei per php ausgef?hrt wird und auch nur eine php Datei ist, setzt man dort keinesfalls chmod 777

Da cron an der Stelle vom System (cron.d) ausgef?hrt wird, muss die Datei auch nicht dem Webserver (www-data) geh?ren, geh?rt sie aber meistens da der ganze Froxlor Ordner www-data oder froxlor bzw. froxlorlocal geh?rt.

 

Pr?f mal wie die Rechte der ?berordner aussehen.

Link to comment
Share on other sites

Die Datei zu Testzwecken auf rwxrwxrwx setzen und schauen obs dann geht, wenn ja schlie?e ich auf ein Berechtigungsproblem!

 

Auf gar keinen Fall! Wer sich auf einem bestehenden Produktionssystem mal die Modes der Datei im Directory listing (ls -l) ansieht, bemerkt das die Datei nicht einmal Ausf?hrungs-Modes besitzt. Warum auch, die Datei wird doch auch als Paramter von php ?bergeben und selbst eingelesen+interpretiert, nicht aber ausgef?hrt.

 

@SaneG bin mir jetzt nicht sicher, aber da der CRON ja von root ausgef?hrt wird, spielt es glaub keine Rolle wer Besitzer ist (i think so)

 

Ein guter Admin wei?, dass Dateien von Webanwendungen schonmal nicht root geh?ren sollten.

 

Daher (Debian):

 

mod_php (Regelfall): chown -R www-data:www-data /path/to/froxlor 
mod_fcgi: chown -R <froxloruser>:<froxlorgroup> /path/to/froxlor

 

 

@lolcat:

 

Wie wachert bereits gebeten hat, einmal

 

ls -la /path/to/froxlor

 

und froxlor_master_cronjob.php manuell mit

 

php5 /path/to/froxlor/scripts/froxlor_master_cronjob.php --force

 

ausf?hren bitte.</froxlorgroup></froxloruser>

Link to comment
Share on other sites

Ich sehe KEIN PROBLEM wenn ich zu Testzwecken die CHMOD auf 777 ?ndere!?

Ich schrieb ja auch: "Zu Testzwecken" und nicht f?r ein Produktivsystem!

Nat?rlich muss man danach die CHMOD entsprechend setzen, nur so kann ich schon mal ein Berechtigungsproblem ausschlie?en!

 

Auch ist es klar das die Dateien nicht root geh?ren sollen, aber der CRON wird doch von ROOT bzw. Mit ROOT Rechten ausgef?hrt oder etwa nicht?

 

Siehe:

#
# Set PATH, otherwise restart-scripts won't find start-stop-daemon
#
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
#
# Regular cron jobs for the froxlor package
#
*/5 * * * * root /usr/bin/php5 -q /var/www/froxlor/scripts/froxlor_master_cronjob.php

Link to comment
Share on other sites

PHP wird in der CLI im Cronjob nat?rlich von root ausgef?hrt. Die Datei wird ja nicht direkt ausgef?hrt, hat im Regelfall 644 Rechte. Weshalb dann allen Lese-, Schreibe- und Ausf?hrungsrechte geben?

 

 

Edit:

 

@lolcat: Wie wurde Froxlor bezogen? Apt, Tarball, Git, ... ?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...