#! /bin/sh /usr/share/dpatch/dpatch-run ## config.dpatch by ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Adaptation of config.tcl and daemontools/run to debian install. @DPATCH@ diff -urNad dotlrn-2.4.1~/etc/config.tcl dotlrn-2.4.1/etc/config.tcl --- dotlrn-2.4.1~/etc/config.tcl 2008-09-23 16:04:25.000000000 +0200 +++ dotlrn-2.4.1/etc/config.tcl 2008-10-22 13:16:29.000000000 +0200 @@ -24,10 +24,11 @@ # started by root, and, in AOLserver 4, the run script have a # '-b address' flag which matches the address according to settings (above) -set server "service0" -set servername "New OpenACS Installation - Development" +set server "dotlrn" +set servername "dotLRN" -set serverroot "/var/www/${server}" +set serverroot "/usr/share/${server}" +set pidfile /var/run/aolserver4/${server}.pid #--------------------------------------------------------------------- # which database do you want? postgres or oracle @@ -38,9 +39,8 @@ if { $database eq "oracle" } { set db_password "mysitepassword" } else { - set db_host localhost - set db_port "" - set db_user $server +## Debconf changes (DO NOT EDIT BYHAND) ## +## End Debconf Changes ################### } #--------------------------------------------------------------------- @@ -85,6 +85,7 @@ ns_param maxbackup 5 ns_param debug $debug # ns_param mailhost localhost + ns_param pidfile ${pidfile} # setting to Unicode by default # see http://dqd.com/~mayoff/encoding-doc.html @@ -100,7 +101,7 @@ ns_section ns/threads ns_param mutexmeter true ;# measure lock contention # The per-thread stack size must be a multiple of 8k for AOLServer to run under MacOS X - ns_param stacksize [expr {128 * 8192}] + ns_param stacksize [expr {512 * 8192}] # # MIME types. @@ -569,7 +570,7 @@ ns_param driver postgres ns_param datasource ${db_host}:${db_port}:${db_name} ns_param user $db_user - ns_param password "" + ns_param password $db_password } ns_section ns/db/pool/pool2 @@ -588,7 +589,7 @@ ns_param driver postgres ns_param datasource ${db_host}:${db_port}:${db_name} ns_param user $db_user - ns_param password "" + ns_param password $db_password } ns_section ns/db/pool/pool3 @@ -607,7 +608,7 @@ ns_param driver postgres ns_param datasource ${db_host}:${db_port}:${db_name} ns_param user $db_user - ns_param password "" + ns_param password $db_password } ns_section ns/server/${server}/db @@ -659,9 +660,7 @@ } # nsthread library which should become standard in 5.3 - if {[file exists ${homedir}/lib/thread2.6.4/libthread2.6.4[info sharedlibextension]]} { - ns_param libthread ${homedir}/lib/thread2.6.4/libthread2.6.4[info sharedlibextension] - } + ns_param libthread [lindex [glob /usr/lib/tcltk/thread*/libthread*-aolserver[info sharedlibextension]] 0] if {[ns_info version] >= 4.5} { ns_limits set default -maxupload [ns_config ns/server/${server}/module/nssock maxinput] @@ -671,4 +670,4 @@ ns_log notice "nsd.tcl: finished reading config file." if {[ns_info version] >= 4.5} { ns_limits set default -maxupload [ns_config ns/server/${server}/module/nssock maxinput] -} \ No newline at end of file +} diff -urNad dotlrn-2.4.1~/etc/daemontools/run dotlrn-2.4.1/etc/daemontools/run --- dotlrn-2.4.1~/etc/daemontools/run 2008-09-23 16:04:25.000000000 +0200 +++ dotlrn-2.4.1/etc/daemontools/run 2008-10-22 13:18:55.000000000 +0200 @@ -9,7 +9,14 @@ # see http://openacs.org/forums/message-view?message_id=176100 sleep 4 -exec /usr/lib/aolserver4/bin/nsd -it /var/www/service0/etc/config.tcl -u service0 -g web +DAEMON="/usr/lib/aolserver4/bin/nsd" +USER="www-data" +GROUP="www-data" +CONF="/etc/dotlrn/config.tcl" +ADDRESS=$(grep "^set address" $CONF | sed 's/set//;s/address//;s/^[ \t]*//') +PORT=$(grep "^set httpport" $CONF | sed 's/set//;s/httpport//;s/^[ \t]*//') + +exec $DAEMON -it $CONF -u $USER -g $GROUP -b $ADDRESS:$PORT # For AOLserver 4 using privileged ports (usually < 1024), add the flag # -b youraddress:yourport to the nsd command