The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

createacct skipping homedir

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

  1. guigsa

    guigsa Registered

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

    KostonConsulting Well-Known Member

    Joined:
    Jun 17, 2010
    Messages:
    255
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    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:

    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.
     
Loading...

Share This Page