Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

createacct skipping homedir

Discussion in 'cPanel Developers' started by guigsa, Apr 9, 2013.

  1. guigsa

    guigsa Registered

    Apr 9, 2013
    Likes Received:
    Trophy Points:
    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.
  2. KostonConsulting

    KostonConsulting Well-Known Member

    Jun 17, 2010
    Likes Received:
    Trophy Points:
    San Francisco, CA
    cPanel Access Level:
    Root Administrator
    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:

    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.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice