-
Notifications
You must be signed in to change notification settings - Fork 12
/
freenode-main.rkt
43 lines (33 loc) · 1.44 KB
/
freenode-main.rkt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#lang racket
(require "loop.rkt"
(except-in "vars.rkt" log)
"git-version.rkt"
"clearenv.rkt"
(only-in "servers.rkt" real-server)
(only-in "userinfo.rkt" *userinfo-database-directory-name*)
(only-in "iserver.rkt" make-incubot-server)
version/utils)
(module+ main
(let ([required-version "5.2.900.1"])
(when (not (>= (version->integer (version))
(version->integer required-version)))
(error 'freenode-main "You need at least version ~a of racket, to avoid a memory leak in sqlite" required-version)))
(clearenv)
(command-line
#:program "rudybot"
#:once-each)
;; TODO -- the equivalent of "echo -17 > /proc/self/oom_adj", to
;; immunize this process from being killed by the dreaded oom_killer
;; (it happened once). See http://linux-mm.org/OOM_Killer
(log "Main starting: ~a" (git-version))
;; (parameterize ([current-namespace (module->namespace "freenode-main.rkt")])
;; (read-eval-print-loop))
(parameterize* ([*irc-server-hostname* "chat.freenode.org"]
[*irc-server-port* 6697]
[*userinfo-database-directory-name* "userinfo.db"]
[*incubot-logger* log]
[*incubot-server* (make-incubot-server)])
(if (*nickserv-password*)
(connect-and-run real-server)
(error 'freenode-main "You didn't specify a NickServ password"))))
(provide (all-defined-out))