diff --git a/build/ripping-cluster-worker.init-gentoo b/build/ripping-cluster-worker.init-gentoo new file mode 100644 index 0000000..0abdb95 --- /dev/null +++ b/build/ripping-cluster-worker.init-gentoo @@ -0,0 +1,29 @@ +#!/sbin/runscript +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +PID_FILE="/var/run/ripping-cluster-worker.pid" + +depend() { + need localmount net + use dns logger puppetmaster netmount nfsmount +} + +start() { + ebegin "Starting ripping-cluster-worker" + start-stop-daemon --start --quiet \ + --background --make-pidfile --pidfile ${PID_FILE} \ + --exec /usr/bin/php /usr/lib/ripping-cluster/worker/ripping-cluster-worker.php + eend $? "Failed to start ripping-cluster-worker" +} + +stop() { + ebegin "Stopping ripping-cluster-worker" + start-stop-daemon --stop --quiet \ + --pidfile ${PID_FILE} + local ret=$? + eend ${ret} "Failed to stop puppet" + rm -f ${PID_FILE} + return ${ret} +} + diff --git a/private/config.php.dist b/private/config.php.dist index f174732..0842246 100644 --- a/private/config.php.dist +++ b/private/config.php.dist @@ -1,5 +1,25 @@ \ No newline at end of file +/** + * Sihnon Config Plugin + * + * Specifies the plugin to use for configuration value storage. + * Options include: + * - Database (Requires Database Support to be enabled, and the Sihnon_ConfigTable option set) + * - FlatFile (Requires the Sihnon_ConfigFile option set) + * + * @var string + */ +define('Sihnon_ConfigPlugin', 'Database'); + +/** + * Sihnon Config Table + * + * Specifies the name of the database table thats used for storing configuration values + * when the Database Config Plugin is used. + * + * @var string + */ +define('Sihnon_ConfigTable', 'settings'); + +/** + * Sihnon Config File + * + * Specifies the name of the file used to store configuration values when the FlatFile Config Plugin is used + * + * @var string + */ +define('Sihnon_ConfigFile', '/etc/ripping-cluster/settings.txt'); + +/** + * Sihnon Development Mode + * + * Specifies whether or not the Framework should operate in debug mode + * + * @var bool + */ +define('Sihnon_Dev', false); + +?> diff --git a/private/dbconfig.conf.dist b/private/dbconfig.conf.dist index 5bc9cce..2c5a74c 100644 --- a/private/dbconfig.conf.dist +++ b/private/dbconfig.conf.dist @@ -1,5 +1,5 @@ hostname = localhost -username = handbrake -password = handbrake -dbname = handbrake_cluster +username = ripping +password = ripping +dbname = ripping_cluster diff --git a/webui/_inc.php b/webui/_inc.php index 09521ce..d80eca9 100644 --- a/webui/_inc.php +++ b/webui/_inc.php @@ -1,10 +1,9 @@ diff --git a/webui/run-jobs.php b/webui/run-jobs.php index 047e2c8..7fdb68a 100644 --- a/webui/run-jobs.php +++ b/webui/run-jobs.php @@ -2,12 +2,12 @@ define('HBC_File', 'run-jobs'); -require_once '../private/config.php'; +require_once '/etc/ripping-cluster/config.php'; require_once(SihnonFramework_Lib . 'SihnonFramework/Main.class.php'); require_once 'Net/Gearman/Client.php'; SihnonFramework_Main::registerAutoloadClasses('SihnonFramework', SihnonFramework_Lib, - 'RippingCluster', SihnonFramework_Main::makeAbsolutePath('../source/lib/')); + 'RippingCluster', RippingCluster_Lib); try { $main = RippingCluster_Main::instance(); @@ -34,7 +34,7 @@ try { // Start the job queue $result = $client->runSet($set); - RippingCluster_LogEntry::info($log, 'Job queue completed', 'batch'); + RippingCluster_ClientLogEntry::info($log, null, 'Job queue completed', 'batch'); } catch (RippingCluster_Exception $e) { die("Uncaught Exception (" . get_class($e) . "): " . $e->getMessage() . "\n"); @@ -55,7 +55,7 @@ function gearman_fail($task) { $main = RippingCluster_Main::instance(); $log = $main->log(); - $job = RippingCluster_Job::fromId($task->args['rip_options']['id']); + $job = RippingCluster_Job::fromId($task->arg['rip_options']['id']); $job->updateStatus(RippingCluster_JobStatus::FAILED); RippingCluster_ClientLogEntry::info($log, $job->id(), 'Job failed'); diff --git a/worker/handbrake-cluster-worker.php b/worker/ripping-cluster-worker.php similarity index 83% rename from worker/handbrake-cluster-worker.php rename to worker/ripping-cluster-worker.php index 79fabe9..3e9b746 100644 --- a/worker/handbrake-cluster-worker.php +++ b/worker/ripping-cluster-worker.php @@ -2,13 +2,13 @@ define('HBC_File', 'worker'); -require_once '../private/config.php'; +require_once '/etc/ripping-cluster/config.php'; require_once(SihnonFramework_Lib . 'SihnonFramework/Main.class.php'); require_once 'Net/Gearman/Worker.php'; SihnonFramework_Main::registerAutoloadClasses('SihnonFramework', SihnonFramework_Lib, - 'RippingCluster', SihnonFramework_Main::makeAbsolutePath('../source/lib/')); -SihnonFramework_Main::registerAutoloadClasses('Net', SihnonFramework_Main::makeAbsolutePath('../source/lib/')); + 'RippingCluster', SihnonFramework_Main::makeAbsolutePath(RippingCluster_Lib)); +SihnonFramework_Main::registerAutoloadClasses('Net', SihnonFramework_Main::makeAbsolutePath(RippingCluster_Lib)); try {