On Tuesday 11 February 2003 04:28 pm, Eric Wolzak wrote: > Kind of old kind of failure treatment, now and then a bang on the > case brings the screen back . Not so now, so I have to tight-vnc in to > edit this email ;(
Maybe you need a bigger hammer. ;-) Been there. > Some remarks. lo leaf-cdb > first of all the database in the directory form is great !! > it is a large advance over a flat database file from the point of view of > changeing a var etc. > If someone wants to modify the database by hand it is only a few > lines of shell script to convert a directorytree to a flat file -> edit and > write it back. Yes it is. Thanks to all (especially Chad and Charles) for insisting in proving that this is a better way. I figured it would be harder to manipulate or eat up a lot CPU cycles. > 3 apart from getting a tree it would be nice to get a horizontal set of > parameters > example assume in the database are > > /etc/shorewall/rules/action/0 > /etc/shorewall/rules/action/1 > /etc/shorewall/rules/action/2 > > /etc/shorewall/rules/proto/0 > /etc/shorewall/rules/proto/1 > > etc > leaf-cdb tree get /etc/shorewall/rules/action > would return action/0 action/1 and action/2 > What I would like is getting back > for i in 0 1 2 > do > find etc/shorewall/rules/*/$i > done Try: leaf-cdb tree get /etc/shorewall/rules/action |sed 's/^.*\///g' > so I can use it in the shorewall template as > for i in 0 1 2 ( can be got by asking how many rules/action there are > do > cat action/$i proto/$i port/$1 # etc > done > this will create the complete shorewall/rules file > i tried this also with > for i in 0 1 2 etc > action=` leaf-cdb get /etc/shorewall/rules/action/$i` > proto=`leaf-cdb get /etc/shorewall/rules/proto/$i` > --- > echo $action $proto > this got a performance problem on my pentium 60 system. > I think my "trigger system isn't clear yet" > I 'll try to put it in pseudocode. > > apart from leaf/cdb there exists a directory /leaf/dep > this is created at boot or after inserting a new package > this takes the variables from all templates in /leaf/tmpl > by something like > for each var in the database if there is a reference to this var in the > templates file the name of the file is stored as a filename in > /etc/dep/var > > Example > eth1_ip in database is used in interfaces and sh-httpd.conf > # ls /etc/dep/eth1_ip > sh-httpd.conf > interfaces > the script to realize this is short and rather fast. > > after updateing one or more variables > something like > for v in changed variables > do > ls /etc/dep/$v >>templates_to_update > done > After the update session is ready > a script like > for f in `cat templates_to_update |sort | uniq ` > do > update_files -i /tmpl/$f ( something like your leaf-tmpl) > done Ah, I see now! But how will the order run correctly? > Now there has to be an anolog mechanism to reload or restart the > whole package. > one way to do this is let each template be a programm ( like in > shorewall rules ) and drops the files to be restarted in a queue like > init_files_to be_restarted > > last line of template is > echo "shorewall" >> init_files_to_be_restarted > > if the update of the config files is ready the same process can be > used to restart the programms > ( extract the init nr for the programms and restart in the correct order) I was thinking more along the lines of changing a global variable (eth0_ip) which affects more (unknown) packages. > Hope this is clearer now. > I hope I have time tomorrow to create some code to test this method. Yes, I haven't been as clear as I would like myself. I'm going to have to work with some code myself. -- ~Lynn Avants Linux Embedded Appliance Firewall developer http://leaf.sourceforge.net ------------------------------------------------------- This SF.NET email is sponsored by: FREE SSL Guide from Thawte are you planning your Web Server Security? Click here to get a FREE Thawte SSL guide and find the answers to all your SSL security issues. http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en _______________________________________________ leaf-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/leaf-devel