McFeely Usage Examples

As far as we know the only place McFeely is being used as the moment is at Kiva Networking, the place where the Systhug's work. Herein find some descriptions of how McFeely is used at Kiva.

User Management

McFeely is a crucial piece in Kiva's user management structure. A collection of perl tools (Kiva::User) represent a user and it's attributes in an object. The object is then passed to routines which create (as necessary) McFeely jobs containing tasks which do things like create home directories, set mail aliases, change permissions, send mail messages, edit log files and access lists. All this on whatever machine is necessary. So far the following tools have been created which utilize McFeely on the back end:

addusers
Create some users.
disable-users
Disable some users.
rename-user
Change a user's username (thus requiring homedir renames and the like).
changeclass
Change a user's class (which cascades to GID changes and file permission changes).
mcprop
Cause user information files to be sent off to NIS servers and initialize an NIS master to slave push. Also allows updates radius raddb/users files.
In the works, but not yet done, are delete-users and a generic morph-users which will allow the arbritrary changing of any attribute on a user.

This all works because Kiva::User has the smarts to create and inject the proper McFeely jobs to accomplish the tasks to change the attributes. See the list of comms to see the sorts of tasks that are done.

Virtual Domain Management

Kiva sells virtual domain hosting on a shared web server. A customer signs up for a virtual domain and then several things need to happen to ensure that the domain is created. This was initially done with a distributed tool all of its own called virtdom. When we realized that we were going to move to a multi-server web architecture it was decided it would be a good time to switch virtdom to McFeely and mcvirtom was created. Analysis (analysis before design) of the problem revealed that one thing that would be handy to have would be a way to fix failed virtual domain creations. In the previos version it was a pain in the butt to go back and clean up a virtual domain creation that had gone halfway through and failed. A lot of manual intervention was required.

Thus VirtdomInjector.pm was born. It is included here as an example of a complex McFeely based program that uses dependencies extensively. VirtdomInjector.pm is a perl library behind a couple of different client programs that manages the creation of full or partial virtdom mcfeely jobs. A full job injects all the tasks necessary to do the following:

These tasks are all identified in a %TASKS hash in the Virtdom.pm. That hash maintains a list of implications and dependencies. An implication states what other tasks must run if this one does. A dependency states what task must complete before I do in order for me to run.

A partial job is a subset of all the tasks and is determined by the client code. Implications are resolved and if requested dependencies can be filled in. So if there is a failed tasks in a list of tasks and some of the dependencies failed as well as a result, you can start a new job with just the name of the failed task and those tasks which depended on it can be run as well.

domainsys.cgi is a CGI program used by customer service representatives that injects a full job.

virt_injector is a tool for sysadmins that can be used to inject full or partial jobs in a whole slew of weird ways.

List of comms

Here is a list of the current McFeely comms in use at Kiva. In case it hasn't been made clear elsewhere, a comm is any sort of program that is used as the executor of a McFeely task. Its exit code is used to indicate success (0), deferral (99) or failure (100) back to the McFeely server.

aupdeliver
bounce_email
change_class
change_emaildb
change_grp_perms
check_dir_owner
initiate_dumper
initiate_propclient
initiate_propserver
listfile_add
listfile_rm
lockdir
make_homedir
make_in_emaildb
make_in_virtusers
make_www_homedir
rename_homedir
rename_http-statsdir
rm_homedir
setquota
test_comm
unbounce_email
unlockssh
unlockwww
update_maildest
update_maildest.org
virtdom_alias_info
virtdom_alias_webmaster
virtdom_forward_domain
virtdom_http_stubindex
virtdom_httpd_conf_add
virtdom_httpd_hup
virtdom_httpd_stats_conf
virtdom_interface
virtdom_named_conf_add
virtdom_named_hup
virtdom_qmail_hup
virtdom_rcpthosts_add
virtdom_reverse_domain
virtdom_virtualdomains_add
wwwlink

Back to McFeely