auto-created database and user

dnevins

Member
Jan 31, 2005
13
0
151
On the system we use WHM on, all of our clients' accounts require a database and user created in MySQL. We have some custom software installed by the skeleton files which we'd like to be capable of automatically configuring itself the first time its run. However, the actual web scripts can't create the database and user itself.

We do not want to require users to login to cpanel/WHM and have to manually create teh database and user with the MySQL tool. We would like for all of that to be created automatically when we create the account, and have the database name, user name, and password stored in the client's home dir, and then the web software's install script can get the data out of there to create its tables and run its config utility.

Is there a way to do this without creating an entire addon script? If not, does anyone have any pointers on how to create an addon that registers a callback to be invoked when a new account is created?

Thanks!
 

mrprez

Well-Known Member
Jun 14, 2002
93
0
166
what a coincidence

I am looking for exactly the same thing. I managed to get it so that the skel files are loaded and one of the config files edited but am stuck on the database and user.

I've been trying to get the guy at premierwebsitesolutions.com to write an add-on for me but can't seem to get in touch with him

John
 

dnevins

Member
Jan 31, 2005
13
0
151
There has to be at least a way to just run a script when an account is created without creating a ton of cpaddon meta-data files and stuff, isn't there? I have all the code I need to set things up, but no way to get it to automatically run. I've currently resorted to a cron job which checks the cpanel accounting log for new account creation records and extracts the necessary data from there. The only bit missing now is having access to the account's password during creation for setting up a few other services (for which we want to have a single unified password between cpanel and those services).