guigsa

Registered
Apr 9, 2013
1
0
1
cPanel Access Level
DataCenter Provider
Hello Guys,

I am in process of building a high availability cluster using cPanel servers and I need your help with a specific need using the createacct script or API.

I am looking to skip the homedir creation or setting it to a different user would be enough. Can you help me with an API script for doing that ? What would I need ?

Thank you.
 

KostonConsulting

Well-Known Member
Verifed Vendor
Jun 17, 2010
255
1
68
San Francisco, CA
cPanel Access Level
Root Administrator
Hello Guys,

I am in process of building a high availability cluster using cPanel servers and I need your help with a specific need using the createacct script or API.

I am looking to skip the homedir creation or setting it to a different user would be enough. Can you help me with an API script for doing that ? What would I need ?

Thank you.
There's no option for no homedir or way to hook into createacct part way through.

You should use a standardized hook Whostmgr::Account::create (not sure if thats exact) to change the user's homedir and then delete the old one after create account is run.

Something like:

Code:
usermod -d /new/homedir user
rm -rf /home/user
sed -i s/\/home\/user/\/new\/homedir/g /usr/local/apache/conf/httpd.conf
/usr/local/cpanel/bin/apache_conf_distiller --update
You should also grep /usr/local/cpanel and /var/cpanel to make sure the homedir isn't stored other places.