You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_dtcl@tcl.apache.org by Wojciech Kocjan <wo...@kocjan.org> on 2001/02/10 20:52:47 UTC

another concept

Hello.

After a looong while being busy with other stuff, I returned to working
with dtcl :>

Right now I'm testing a small subscription system and here's what I find
missing: ability to run a certain dtcl script with crontab. It's
possible with php (php4-cgi in debian), it should be possible with dtcl.
Yes, there's tclsh but here's what's missing:
- I have a lot of functions read in GlobalInitScript & ChildInitScript
  (ie. SQL connections, mail sending functions)
- I might want to use 'parse'

The only thing I came up with is putting the script somewhere within
DocumentRoot and putting wget on cron... But this may be a security
feature when the script will be doing unerasable duties like rotating
logs (ie. for calculating statistics)... Or logging user access - this
may be used to remove some entries. I know, I'm a bit paranoid :>

Anyways, it would be wise for mod_dtcl to have a config file, whose name
could preferably supplied during compilation (and overridden in
httpd.conf :). This would allow compiling dtclsh, it reading config
files and launching file in a dtcl-like way. Also it would allow testing
very nasty things - like constant changing GlobalInit/ChildInit, loading
a shared object and many other things. I try to use C code in many
situations, so it would be nice to be able to test .so's w/o apachectl
start every SEGV occurs...

I suppose it's a good idea, and if the code is separated (I don't
suppose send_parsed_file() was ... but maybe that's changed now :).

-- 
Wojciech Kocjan
email: wojciech@kocjan.org
tel:   +48-501-778778


Re: another concept

Posted by "David N. Welton" <da...@apache.org>.
Hrmm... I could swear I had attached some text explaining this.

Anyway, it's a pure Tcl dtcl parser/executer which I whipped up a few
days ago.  It's not there %100, but it seems to work decently, and I
would welcome anyone who wanted to work on it:-)

-- 
David N. Welton
     Personal:           http://www.efn.org/~davidw/  
Free Software:           http://people.debian.org/~davidw/
   Apache Tcl:           http://tcl.apache.org

Re: another concept

Posted by "David N. Welton" <da...@apache.org>.
Wojciech Kocjan <wo...@kocjan.org> writes:

> Right now I'm testing a small subscription system and here's what I
> find missing: ability to run a certain dtcl script with
> crontab. It's possible with php (php4-cgi in debian), it should be
> possible with dtcl.  Yes, there's tclsh but here's what's missing:

> - I have a lot of functions read in GlobalInitScript & ChildInitScript
>   (ie. SQL connections, mail sending functions)
> - I might want to use 'parse'

Hrm, and 'source' isn't enough?

mod_dtcl is pretty tightly tied with Apache at the moment - however,
maybe by seperating a few things out, we could make something like
dtcl-cgi.  I think the most important thing is probably the file
parser.  Most of the dtcl commands could probably be just rewritten as
Tcl procs (hputs, for instance).
 
> The only thing I came up with is putting the script somewhere within
> DocumentRoot and putting wget on cron... But this may be a security
> feature when the script will be doing unerasable duties like
> rotating logs (ie. for calculating statistics)... Or logging user
> access - this may be used to remove some entries. I know, I'm a bit
> paranoid :>

Yeah, and using wget in this way is an ugly solution in any case.

> Anyways, it would be wise for mod_dtcl to have a config file, whose
> name could preferably supplied during compilation (and overridden in
> httpd.conf :). This would allow compiling dtclsh, it reading config
> files and launching file in a dtcl-like way. Also it would allow
> testing very nasty things - like constant changing
> GlobalInit/ChildInit, loading a shared object and many other
> things. I try to use C code in many situations, so it would be nice
> to be able to test .so's w/o apachectl start every SEGV occurs...

I use 'apache -X' for testing, myself...

> I suppose it's a good idea, and if the code is separated (I don't
> suppose send_parsed_file() was ... but maybe that's changed now :).

Yes, it's a good idea, and I will work with you if you want to try and
accomplish this.  I don't know if I'll have time to do it myself in
the near future, though.

I have at least added it to the todo list on the site:-)

-- 
David N. Welton
     Personal:           http://www.efn.org/~davidw/  
Free Software:           http://people.debian.org/~davidw/
   Apache Tcl:           http://tcl.apache.org