Nevyn's Blog

Monday, 4 August 2008

BlueQuartz::DB4

Hi folks - just having some more fun poking around under the hood of the sausalito UI (user interface) for BlueQuartz linux. I'm actually just trying to amend one of the package names installed under the BlueLinQ tab, because I have installed Webmin 1.250, and after upgrading it to 1.420 BlueLinQ has frustratingly kept the original 1.250 version number.

I have traversed the JavaScripts, read the PHP, and found my way into the $cce objects. That led me to the discovery of the cce.so module used by the php4 admin backend webserver. it would appear that with this, the $cce object in PHP communicates with the /usr/sausalito/sbin/cced daemon via the cced.socket unix socket. (I could be slightly off here, but that seems to be vaguely representative?)

There are 2 xml files in the /usr/sausalito/ui/style folder which define the colour schemes, 'Merlot' and 'trueBlue'. However, there are over 100 other .xml files in the /usr/sausalito/ui subfolders, which looked like a good place to find where BlueQuartz kept its data, but upon inspection appeared only to contain definitions for the various menus etc associated with the admin UI.

Without looking at (for) the objects, methods and function calls in the php which manipulate the cced, I investigated the cceclient /usr/sausalito/bin/cceclient. I recommend setting up an alias by using a line like "alias cceclient='/usr/sausalito/bin/cceclient'" in your terminal session (or better, in your ~/.bashrc file) to make it easier. See my earlier post for commands you can use, and READ THE WARNINGS!

So now you've got access to the backend. Perhaps you can even GET and SET some values, and whilst this may be enough to solve the above problem (altering the description of an installed package), I was still curious about where it stored the data, as it wasnt in any of the .xml files found thus far, I couldn't see any evidence in the MySQL db, and there was no sign of a postgreSQL server either.

The clue is /usr/sausalito/db4 - looks like a Berkeley db4 v4.0.14 backend, and sure enough, the apache admin instance also has dba support built in. It doesnt appear to use SQL, resembling more of a structured file like xml with key=value pairs. I'll try and update this section shortly...

Until then, for more info see these links:

/usr/sausalito/db4/docs/index.html is the path to the (local) documentation on BlueQuartz and contains the API for C/C++, Java and Tcl. See also the docu about the supporting utilities (in db4/bin)

Adding dba support to php

How to Create a db4 Database from a Text File or Array

http://www.stanford.edu/services/pubsw/package/libraries/db4.html

"Description: Embedded database and hash file library
Source: http://www.sleepycat.com/

Berkeley DB is a programmatic toolkit that provides high-performance built-in database support for desktop and server applications and for information appliances.

The Berkeley DB access methods include B+tree, Extended Linear Hashing, Fixed and Variable-length records, and Queues. Berkeley DB provides full transactional support, database recovery, online backups, and separate access to locking, logging and shared memory caching subsystems."

Labels: , , , , , , , ,

Sunday, 3 August 2008

BlueQuartz::Using the cceclient tool

Came across this excellent article whilst messing around with Sausalito, the backend UI on my BlueQuartz server. Its a low level way of accessing cce, the Cobalt Configuration Engine, and from what I gather an efficient way of hosing your system if not careful.

(It resembles accessing Cisco switches over serial console links, or using the MSC / MMSC on my SGI Origin servers, and has a very arcane feel to it. Perhaps I should set the terminal font colour to green or amber for best effect)

I pinched it from http://www.cobaltfaqs.com/index.php/Using_cceclient_tool, and reposted it here, because you never know when useful stuff like this will disappear. Dont forget to check the original page, in case their copy is fresher.

Using cceclient tool
From CobaltFAQs

CCE is the Cobalt Configuration Engine. It is a series of XML files that are used to configure the user interface settings. This is not a beginner tool. There is no undo function so be careful.

You must be logged in as root. Then issue the command:

/usr/sausalito/bin/cceclient

This will bring you to a command prompt:

100 CSCP/0.80 200 READY

Help is available by typing

help

ADMIN suspend | resume : suspend or resume write operations

AUTH : Authenticate as a user

AUTHKEY : Attempt to resume a session

BEGIN : Begin a transaction

BYE [SUCCESS | FAIL | DEFER] : Disconnect immediately, indicating exit status

CLASSES : List all classes

CREATE [= ...] : Create a new instance of the specified class

DESTROY : Destroy the specified object

ENDKEY : Expire the current sessionid now

FIND [= ...] : Find instances of the specified class, matching given criteria

GET [.] : Get a list of key=value pairs for the specified object

HELP : Show help about all commands currently available

NAMES | : List available namespaces for an object or class

SET [.] [= ...] : Set all listed keys to listed values in the specified object

WHOAMI : Get the object id of the currently logged in user

To exit use the command:

bye

Please note that commands are case specific! Also, there is no undo for these commands so I suggest capturing the settings before editing by using the GET command. Use the cceclient command at your own risk!

--ChrisD 18:18, 15 May 2005 (UTC)

Labels: , , , , , ,