From: <bla...@pr...> - 2004-02-02 17:46:24
|
Update of /cvsroot/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv347 Modified Files: daemon.rb sampleconfig Log Message: httpd is now started by daemon.rb, misc fixes Index: daemon.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/daemon.rb,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** daemon.rb 31 Oct 2003 13:11:12 -0000 1.9 --- daemon.rb 2 Feb 2004 17:44:18 -0000 1.10 *************** *** 5,23 **** require 'ngetsuite/config' ! conf_file = ENV['HOME'] + File::Separator + '.ngetsuite' $config = NgetSuite::Config.new(conf_file) require 'ngetsuite/downloadmanager' ! $dbh = DBI.connect("DBI:Mysql:#{$config['dbname']}", $config['dbuser'], $config['dbpass']) ! $nget = $config['nget'] ! basedir = $config['basedir'] ! max_dls = $config['max_dls'].to_i ! port = $config['port'] ! logfile = $config['daemon_log'] $logger = File.new(logfile, 'a') ! $debug = $config['debug'] def log(msg=nil) --- 5,32 ---- require 'ngetsuite/config' ! homedir = ENV['HOME'] + File::Separator ! conf_file = homedir + '.ngetsuite' $config = NgetSuite::Config.new(conf_file) require 'ngetsuite/downloadmanager' ! dbuser = $config.fetch('dbuser', 'nget') ! dbname = $config.fetch('dbname', 'ngetcache') ! if not $config.include? 'dbpass' ! puts "Missing required value in config file : dbpass" ! exit 1 ! end ! ! $dbh = DBI.connect("DBI:Mysql:#{dbname}", dbuser, $config['dbpass']) ! ! $nget = $config.fetch('nget', '/usr/bin/nget') ! basedir = $config.fetch('basedir', homedir + 'ngetsuite') ! max_dls = $config.fetch('max_dls', 2) ! port = $config.fetch('port', 12345) ! logfile = $config.fetch('daemon_log', basedir + 'daemon.log') $logger = File.new(logfile, 'a') ! $debug = $config.fetch('debug', false) def log(msg=nil) *************** *** 28,31 **** $manager = NgetSuite::DownloadManager.new(max_dls, basedir) ! DRb.start_service('druby://localhost:' + port, $manager) DRb.thread.join --- 37,53 ---- $manager = NgetSuite::DownloadManager.new(max_dls, basedir) ! DRb.start_service('druby://localhost:' + port.to_s, $manager) ! ! if $config.fetch('autostart_httpd', false) ! require 'webrick' ! include WEBrick ! s = HTTPServer.new( ! :Port => ($config.fetch('httpd_port', 2000)), ! :DocumentRoot => Dir::pwd + "/web" ! ) ! trap("INT"){ s.shutdown } ! httpThread = Thread.new { s.start } ! httpThread.join ! end ! DRb.thread.join Index: sampleconfig =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/sampleconfig,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** sampleconfig 2 Feb 2004 02:41:34 -0000 1.7 --- sampleconfig 2 Feb 2004 17:44:18 -0000 1.8 *************** *** 14,18 **** debug = false httpd_port = 2000 ! --- 14,20 ---- debug = false + extern_headers_update = '' httpd_port = 2000 ! autostart = true ! autostart_httpd = true |