]> mj.ucw.cz Git - moe.git/commitdiff
Submitd now keeps a log file if asked to.
authorMartin Mares <mj@ucw.cz>
Sun, 10 Jun 2007 14:39:24 +0000 (16:39 +0200)
committerMartin Mares <mj@ucw.cz>
Sun, 10 Jun 2007 14:39:24 +0000 (16:39 +0200)
TODO
bin/mo-create-submit
submit/config
submit/submitd.c

diff --git a/TODO b/TODO
index 17ef152b5ea89762dca9d8bad43aefddaa750ed7..3f8f8dba2207721217e895c210b7bbc306221d8f 100644 (file)
--- a/TODO
+++ b/TODO
@@ -12,6 +12,7 @@ fpc: add switch -gl (runtime errors write line#)
 Installer:
 - mo-install: reduce what gets copied to mo-eval home
 - update group permissions
+- fix makefiles, so that submit/Makefile gets called
 
 New submitter:
 - Checking of contest time (and per-contestant exceptions)
index ec209785d766db8e1099638b4eff1cdceb866d33..d334d1f6f3569093ff15876bb11c3859b9e738ff 100755 (executable)
@@ -27,4 +27,6 @@ done
 rm -rf tmp
 mkdir -p tmp
 
+mkdir -p log
+
 chown -R $REMOTE_SUBMIT_USER.$REMOTE_SUBMIT_GROUP $MO_ROOT/eval/submit
index f52f8e5dd0afd9ef743c59045e6673557e79aa79..cbe27e073df65af5165740d522f9d2343c82aad2 100644 (file)
@@ -2,6 +2,9 @@
 
 SubmitD {
 
+# Log file
+LogFile                        log/submitd
+
 # Port number
 Port                   8888
 
index 3aadc75f7352e952ae250c200f0f262d1202f384..b3b5aac0537f4a9664023fabb8dd63e8291d2e9f 100644 (file)
@@ -25,6 +25,7 @@
 
 /*** CONFIGURATION ***/
 
+static byte *log_name;
 static uns port = 8888;
 static uns dh_bits = 1024;
 static uns max_conn = 10;
@@ -51,6 +52,7 @@ static struct cf_section access_conf = {
 
 static struct cf_section submitd_conf = {
   CF_ITEMS {
+    CF_STRING("LogFile", &log_name),
     CF_UNS("Port", &port),
     CF_UNS("DHBits", &dh_bits),
     CF_UNS("MaxConn", &max_conn),
@@ -531,6 +533,8 @@ int main(int argc, char **argv)
   if ((opt = cf_getopt(argc, argv, CF_SHORT_OPTS, CF_NO_LONG_OPTS, NULL)) >= 0)
     die("This program has no options");
 
+  log_file(log_name);
+
   log(L_INFO, "Initializing TLS");
   tls_init();