* Change of website from patches.freeiz.com to alpine.freeiz.com.
[alpine.git] / web / bin / launch.tcl
blob8751c33fb560b4ff41cc42abe3acf0856856e608
1 #!./tclsh
2 # $Id: launch.tcl 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
3 # ========================================================================
4 # Copyright 2006 University of Washington
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # ========================================================================
14 # Generate a session key, create the connection points (fifos),
15 # spawn the mail engine and then hand the session key to the
16 # caller
18 # Source config information
19 source ./alpine.tcl
21 # generate session id
22 WPValidId
24 if {[info exists env(REMOTE_USER)]} {
25 set servlet $_wp(pc_servlet)
26 set env(LOGNAME) $env(REMOTE_USER)
27 } else {
28 set servlet $_wp(servlet)
31 set cmd "exec -- echo $_wp(sockname) | [file join $_wp(bin) $servlet]"
33 # set debug level and configure dmalloc
34 #append cmd " -d -d -d -d -d -d -d"
35 #set env(DMALLOC_OPTIONS) "check-fence,check-heap,check-blank,log=/tmp/logfile.%d"
37 if {[catch {eval $cmd} errmsg]} {
38 puts stderr "Unable to Launch servlet: $errmsg"
39 exit 1
40 } elseif {[info exists env(REMOTE_ADDR)] && [string length $env(REMOTE_ADDR)]} {
41 catch {WPCmd PEInfo set wp_client $env(REMOTE_ADDR)}
42 } elseif {[info exists env(REMOTE_HOST)] && [string length $env(REMOTE_HOST)]} {
43 catch {WPCmd PEInfo set wp_client $env(REMOTE_HOST)}
46 if {$_wp(debug) > 0} {
47 WPCmd PEDebug level $_wp(debug)
50 puts $_wp(sessid)
51 exit 0