From: Martin Mares Date: Sun, 10 Jun 2007 14:39:24 +0000 (+0200) Subject: Submitd now keeps a log file if asked to. X-Git-Tag: python-dummy-working~369 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=09b39ea5a70f8933ab30ec746fbe4e7bb2afd099;p=eval.git Submitd now keeps a log file if asked to. --- diff --git a/TODO b/TODO index 17ef152..3f8f8db 100644 --- 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) diff --git a/bin/mo-create-submit b/bin/mo-create-submit index ec20978..d334d1f 100755 --- a/bin/mo-create-submit +++ b/bin/mo-create-submit @@ -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 diff --git a/submit/config b/submit/config index f52f8e5..cbe27e0 100644 --- a/submit/config +++ b/submit/config @@ -2,6 +2,9 @@ SubmitD { +# Log file +LogFile log/submitd + # Port number Port 8888 diff --git a/submit/submitd.c b/submit/submitd.c index 3aadc75..b3b5aac 100644 --- a/submit/submitd.c +++ b/submit/submitd.c @@ -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();